@@ -12,6 +12,7 @@ find "$KOKORO_GFILE_DIR"
12
12
13
13
# The output from all the jobs are coalesced into a single dir
14
14
LOCAL_MVN_ARTIFACTS=" $KOKORO_GFILE_DIR " /github/grpc-java/mvn-artifacts/
15
+ LOCAL_OTHER_ARTIFACTS=" $KOKORO_GFILE_DIR " /github/grpc-java/artifacts/
15
16
16
17
# verify that files from all 3 grouped jobs are present.
17
18
# platform independent artifacts, from linux job:
@@ -45,6 +46,9 @@ mkdir -p ~/java_signing/
45
46
gsutil cp -r gs://grpc-testing-secrets/java_signing/ ~ /
46
47
gpg --batch --import ~ /java_signing/grpc-java-team-sonatype.asc
47
48
49
+ gsutil cat gs://grpc-testing-secrets/dockerhub_credentials/grpcpackages.password \
50
+ | docker login --username grpcpackages --password-stdin
51
+
48
52
# gpg commands changed between v1 and v2 are different.
49
53
gpg --version
50
54
@@ -65,5 +69,19 @@ if gpg --version | grep 'gpg (GnuPG) 2.'; then
65
69
--detach-sign -a {} \;
66
70
fi
67
71
72
+ # Just the numbers; does not include leading 'v'
73
+ VERSION=" $( cat $LOCAL_OTHER_ARTIFACTS /version) "
74
+ EXAMPLE_HOSTNAME_ID=" $( cat " $LOCAL_OTHER_ARTIFACTS /example-hostname.id" ) "
75
+ docker load --input " $LOCAL_OTHER_ARTIFACTS /example-hostname.tar"
76
+ LATEST_VERSION=" $(( echo "v$VERSION "; git ls- remote - t https:// github.com/ grpc/ grpc- java.git | cut - f 2 | sed s#refs/ tags/ ##) | sort - V | tail - n 1 )"
77
+
78
+
68
79
STAGING_REPO=a93898609 ef848
69
80
"$GRPC_JAVA_DIR "/buildscripts/sonatype-upload.sh "$STAGING_REPO " "$LOCAL_MVN_ARTIFACTS "
81
+
82
+ docker tag "$EXAMPLE_HOSTNAME_ID " "grpc/java-example-hostname:${VERSION} "
83
+ docker push "grpc/java-example-hostname:${VERSION} "
84
+ if [[ "$VERSION " = "$LATEST_VERSION " ]]; then
85
+ docker tag "$EXAMPLE_HOSTNAME_ID " grpc/java-example-hostname:latest
86
+ docker push grpc/java-example-hostname:latest
87
+ fi
0 commit comments