Skip to content

Commit 9911a9b

Browse files
authored
Update release script with new gpg config (#202)
* update using new gpg version * add more comments * update descriptions and comments
1 parent f88fc6b commit 9911a9b

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

aws-iot-device-sdk-java-samples/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<version>0.0.1-dev</version>
77
</parent>
88
<artifactId>aws-iot-device-sdk-java-samples</artifactId>
9+
<name>${project.groupId}:${project.artifactId}</name>
910
<dependencies>
1011
<dependency>
1112
<groupId>com.amazonaws</groupId>

aws-iot-device-sdk-java/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<version>0.0.1-dev</version>
77
</parent>
88
<artifactId>aws-iot-device-sdk-java</artifactId>
9+
<name>${project.groupId}:${project.artifactId}</name>
10+
<description>This SDK is now in maintenance mode and will not receive new features. For the latest functionality, please use aws-iot-device-sdk. The AWS IoT Device SDK for Java lets your device applications communicate with the AWS IoT Core service over MQTT. In addition to basic MQTT messaging, it includes built-in support for AWS IoT services such as Thing Shadows, Jobs, and Fleet Provisioning.</description>
911
<dependencies>
1012
<dependency>
1113
<groupId>org.mockito</groupId>

codebuild/cd/promote-release.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 0.2
2-
#this buildspec assumes the ubuntu 16.04:x64 image
2+
# Assumes this is running on the Ubuntu CodeBuild standard image.
33
# This job is responsible for artifacting the JAR which will have all of the other shared libs stuffed
44
# into it once all platforms are built and artifacted
55
phases:
@@ -9,8 +9,10 @@ phases:
99
- sudo apt-get update -y
1010
- sudo apt-get install openjdk-8-jdk-headless maven -y -f
1111
- sudo apt-get install jq -y
12-
# need latest awscli for secretsmanager
13-
- sudo pip3 install awscli --upgrade
12+
- echo "\nBuild version data:"
13+
- echo "\nJava Version:"; java -version
14+
- echo "\nMaven Version:"; mvn --version
15+
- echo "\n"
1416

1517
pre_build:
1618
commands:
@@ -22,35 +24,38 @@ phases:
2224
- sed -i 's/0.0.1-dev/'"$PKG_VERSION"'/g' aws-iot-device-sdk-java/pom.xml
2325
- sed -i 's/0.0.1-dev/'"$PKG_VERSION"'/g' aws-iot-device-sdk-java-samples/pom.xml
2426
- sed -i 's/0.0.1-dev/'"$PKG_VERSION"'/g' aws-iot-device-sdk-java/src/main/java/com/amazonaws/services/iot/client/mqtt/AwsIotMqttConnection.java
25-
# Get java v1 gpg files
26-
- aws s3 cp --recursive s3://code-sharing-aws-crt/gpg-java-v1/ maven-gpg
27-
# manully copy the maven-gpg in subfolder, since codeBuild does not set localRepository correctly
28-
- cp -r maven-gpg aws-iot-device-sdk-java/maven-gpg
29-
- cp -r maven-gpg aws-iot-device-sdk-java-samples/maven-gpg
27+
3028
# install settings.xml to ~/.m2/settings.xml
3129
- mkdir -p $HOME/.m2
32-
- aws s3 cp s3://code-sharing-aws-crt/iot-sdk-java-v1.settings.central.xml $HOME/.m2/settings.xml
30+
- aws s3 cp s3://code-sharing-aws-crt/aws-iot-device-sdk.settings.token.xml $HOME/.m2/settings.xml
31+
3332
- aws --query "SecretString" secretsmanager get-secret-value --secret-id Sonatype/JIRA/token/V1 > sonatype_secret
3433
- jq fromjson sonatype_secret > sonatype_json
3534
- export ST_PASSWORD=$(jq -r '.password' sonatype_json)
3635
- export ESCAPED_PASSWORD=$(printf '%s\n' "$ST_PASSWORD" | sed 's:[\\/&]:\\&:g')
3736
- export ST_USERNAME=$(jq -r '.username' sonatype_json)
37+
3838
- aws --query "SecretString" secretsmanager get-secret-value --secret-id gpg/IoT/JAVA/V1 > gpg_secret
3939
- jq fromjson gpg_secret > gpg_json
40-
- export GPG_PRINCIPAL=$(jq -r '.username' gpg_json)
4140
- export GPG_CREDENTIAL=$(jq -r '.password' gpg_json)
42-
# Use the password from secret manager to update the settings
43-
- sed -i 's/sonatype_Principal/'"$ST_USERNAME"'/g' $HOME/.m2/settings.xml
44-
- sed -i 's/sonatype_Credential/'"$ESCAPED_PASSWORD"'/g' $HOME/.m2/settings.xml
45-
- sed -i 's/gpg_Principal/'"$GPG_PRINCIPAL"'/g' $HOME/.m2/settings.xml
46-
- sed -i 's/gpg_Credential/'"$GPG_CREDENTIAL"'/g' $HOME/.m2/settings.xml
4741

42+
# Use the username and password from secret manager to update the settings
43+
- sed -i 's|token-username|'"$ST_USERNAME"'|g' $HOME/.m2/settings.xml
44+
- sed -i 's|token-password|'"$ESCAPED_PASSWORD"'|g' $HOME/.m2/settings.xml
45+
46+
# for https://github.com/keybase/keybase-issues/issues/2798
47+
- export GPG_TTY=$(tty)
48+
49+
- aws s3 cp s3://code-sharing-aws-crt/aws-iot-java-sdk.asc .
50+
- gpg --batch --import aws-iot-java-sdk.asc
51+
# refer to https://maven.apache.org/plugins/maven-gpg-plugin/usage.html
52+
- export MAVEN_GPG_PASSPHRASE=$GPG_CREDENTIAL
4853

4954
build:
5055
commands:
5156
- cd $CODEBUILD_SRC_DIR/aws-iot-device-sdk-java
5257
- mvn -B versions:set -DnewVersion=${PKG_VERSION}
53-
- mvn clean deploy -P publishing -Dmaven.test.skip=true
58+
- mvn -B clean deploy -Dmaven.test.skip=true -e -X
5459

5560
cache:
5661
paths:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<version>0.0.1-dev</version>
66
<packaging>pom</packaging>
77
<name>AWS IoT Device SDK for Java</name>
8-
<description>The SDK is in maintenance mode, and no longer receive feature updates. Checkout aws-iot-device-sdk for new features. The AWS IoT Device SDK for Java provides Java APIs for devices to connect to AWS IoT service using the MQTT protocol. The SDK also provides support for AWS IoT specific features, such as Thing Shadow and Thing Shadow abstraction.</description>
8+
<description>This SDK is now in maintenance mode and will not receive new features. For the latest functionality, please use aws-iot-device-sdk. The AWS IoT Device SDK for Java lets your device applications communicate with the AWS IoT Core service over MQTT. In addition to basic MQTT messaging, it includes built-in support for AWS IoT services such as Thing Shadows, Jobs, and Fleet Provisioning.</description>
99
<url>https://aws.amazon.com/iot/sdk</url>
1010
<licenses>
1111
<license>

0 commit comments

Comments
 (0)