Skip to content

Commit c1bc063

Browse files
authored
Kokoro release jobs (#472)
* Add Kokoro release scripts * Update pom.xml files with sonatyle release process * Set common configs * Specify the trampoline image to use for release jobs * Fix the execution directory * Fix the execution directory * Fix the execution directory * remove gpg for testing * skip gpg-agent * keyring args are paths * use gpg.homedir * Fix gpg tty * set pinentry-mode
1 parent e601d7d commit c1bc063

File tree

17 files changed

+312
-108
lines changed

17 files changed

+312
-108
lines changed

.kokoro/release/common.cfg

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Download trampoline resources.
11+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
12+
13+
# Use the trampoline script to run in docker.
14+
build_file: "google-http-java-client/.kokoro/trampoline.sh"
15+
16+
# Configure the docker image for kokoro-trampoline.
17+
env_vars: {
18+
key: "TRAMPOLINE_IMAGE"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
20+
}
21+
22+
before_action {
23+
fetch_keystore {
24+
keystore_resource {
25+
keystore_config_id: 70247
26+
keyname: "maven-gpg-keyring"
27+
}
28+
}
29+
}
30+
31+
before_action {
32+
fetch_keystore {
33+
keystore_resource {
34+
keystore_config_id: 70247
35+
keyname: "maven-gpg-passphrase"
36+
}
37+
}
38+
}
39+
40+
before_action {
41+
fetch_keystore {
42+
keystore_resource {
43+
keystore_config_id: 70247
44+
keyname: "maven-gpg-pubkeyring"
45+
}
46+
}
47+
}
48+
49+
before_action {
50+
fetch_keystore {
51+
keystore_resource {
52+
keystore_config_id: 70247
53+
keyname: "sonatype-credentials"
54+
}
55+
}
56+
}

.kokoro/release/common.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
# Copyright 2018 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
# Get secrets from keystore and set and environment variables
19+
setup_environment_secrets() {
20+
export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase)
21+
export GPG_TTY=$(tty)
22+
export GPG_HOMEDIR=/gpg
23+
mkdir $GPG_HOMEDIR
24+
mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg
25+
mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg
26+
export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|')
27+
export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|')
28+
}
29+
30+
create_settings_xml_file() {
31+
echo "<settings>
32+
<servers>
33+
<server>
34+
<id>ossrh</id>
35+
<username>${SONATYPE_USERNAME}</username>
36+
<password>${SONATYPE_PASSWORD}</password>
37+
</server>
38+
<server>
39+
<id>sonatype-nexus-staging</id>
40+
<username>${SONATYPE_USERNAME}</username>
41+
<password>${SONATYPE_PASSWORD}</password>
42+
</server>
43+
<server>
44+
<id>sonatype-nexus-snapshots</id>
45+
<username>${SONATYPE_USERNAME}</username>
46+
<password>${SONATYPE_PASSWORD}</password>
47+
</server>
48+
</servers>
49+
</settings>" > $1
50+
}

.kokoro/release/drop.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Tell the trampoline which build file to use.
4+
env_vars: {
5+
key: "TRAMPOLINE_BUILD_FILE"
6+
value: "github/google-http-java-client/.kokoro/release/drop.sh"
7+
}

.kokoro/release/drop.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# Copyright 2018 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
source $(dirname "$0")/common.sh
19+
20+
pushd $(dirname "$0")/../../
21+
22+
setup_environment_secrets
23+
create_settings_xml_file "settings.xml"
24+
25+
mvn nexus-staging:drop --settings=settings.xml

.kokoro/release/promote.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Tell the trampoline which build file to use.
4+
env_vars: {
5+
key: "TRAMPOLINE_BUILD_FILE"
6+
value: "github/google-http-java-client/.kokoro/release/promote.sh"
7+
}

.kokoro/release/promote.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# Copyright 2018 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
source $(dirname "$0")/common.sh
19+
20+
pushd $(dirname "$0")/../../
21+
22+
setup_environment_secrets
23+
create_settings_xml_file "settings.xml"
24+
25+
mvn nexus-staging:release -DperformRelease=true --settings=settings.xml

.kokoro/release/stage.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Tell the trampoline which build file to use.
4+
env_vars: {
5+
key: "TRAMPOLINE_BUILD_FILE"
6+
value: "github/google-http-java-client/.kokoro/release/stage.sh"
7+
}

.kokoro/release/stage.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
# Copyright 2018 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
source $(dirname "$0")/common.sh
19+
20+
pushd $(dirname "$0")/../../
21+
22+
setup_environment_secrets
23+
create_settings_xml_file "settings.xml"
24+
25+
mvn clean install deploy \
26+
--settings settings.xml \
27+
-DperformRelease=true \
28+
-Dgpg.executable=gpg \
29+
-Dgpg.passphrase=${GPG_PASSPHRASE} \
30+
-Dgpg.homedir=${GPG_HOMEDIR}
31+
32+

google-http-client-android/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<artifactId>maven-javadoc-plugin</artifactId>
1717
<configuration>
1818
<links>
19-
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
19+
<link>http://download.oracle.com/javase/6/docs/api/</link>
2020
</links>
2121
<doctitle>${project.name} ${project.version}</doctitle>
2222
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client-gson/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<artifactId>maven-javadoc-plugin</artifactId>
1717
<configuration>
1818
<links>
19-
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
20-
<link>http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs</link>
19+
<link>http://download.oracle.com/javase/6/docs/api/</link>
20+
<link>https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version}</link>
2121
</links>
2222
<doctitle>${project.name} ${project.version}</doctitle>
2323
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client-jackson/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<artifactId>maven-javadoc-plugin</artifactId>
1717
<configuration>
1818
<links>
19-
<link>https://download.oracle.com/javase/1.6.0/docs/api/</link>
20-
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/1.9.13/documentation</link>
19+
<link>http://download.oracle.com/javase/6/docs/api/</link>
20+
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
2121
</links>
2222
<doctitle>${project.name} ${project.version}</doctitle>
2323
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client-jackson2/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<artifactId>maven-javadoc-plugin</artifactId>
1717
<configuration>
1818
<links>
19-
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
20-
<link>http://fasterxml.github.com/jackson-core/javadoc/2.0.5/</link>
19+
<link>http://download.oracle.com/javase/6/docs/api/</link>
20+
<link>http://fasterxml.github.com/jackson-core/javadoc/${project.jackson-core2.version}/</link>
2121
</links>
2222
<doctitle>${project.name} ${project.version}</doctitle>
2323
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client-jdo/pom.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<artifactId>maven-javadoc-plugin</artifactId>
1616
<configuration>
1717
<links>
18-
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
18+
<link>http://download.oracle.com/javase/6/docs/api/</link>
1919
</links>
2020
<doctitle>${project.name} ${project.version}</doctitle>
2121
<windowtitle>${project.artifactId} ${project.version}</windowtitle>
@@ -30,15 +30,6 @@
3030
</manifest>
3131
</archive>
3232
</configuration>
33-
<executions>
34-
<execution>
35-
<id>jar</id>
36-
<phase>compile</phase>
37-
<goals>
38-
<goal>jar</goal>
39-
</goals>
40-
</execution>
41-
</executions>
4233
</plugin>
4334
<plugin>
4435
<artifactId>maven-source-plugin</artifactId>

google-http-client-test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<artifactId>maven-javadoc-plugin</artifactId>
1717
<configuration>
1818
<links>
19-
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
19+
<link>http://download.oracle.com/javase/6/docs/api/</link>
2020
</links>
2121
<doctitle>${project.name} ${project.version}</doctitle>
2222
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client-xml/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<artifactId>maven-javadoc-plugin</artifactId>
1717
<configuration>
1818
<links>
19-
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
19+
<link>http://download.oracle.com/javase/6/docs/api/</link>
2020
</links>
2121
<doctitle>${project.name} ${project.version}</doctitle>
2222
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
<artifactId>maven-javadoc-plugin</artifactId>
2121
<configuration>
2222
<links>
23-
<link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
24-
<link>http://docs.guava-libraries.googlecode.com/git-history/v13.0.1/javadoc</link>
25-
<link>http://commons.apache.org/proper/commons-codec/javadocs/api-release</link>
23+
<link>http://download.oracle.com/javase/6/docs/api/</link>
24+
<link>https://google.github.io/guava/releases/${project.guava.version}/api/docs/</link>
25+
<link>https://commons.apache.org/proper/commons-codec/archives/${project.commons-codec.version}/apidocs/</link>
2626
</links>
2727
<doctitle>${project.name} ${project.version}</doctitle>
2828
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

0 commit comments

Comments
 (0)