-
Notifications
You must be signed in to change notification settings - Fork 31
/
.gitlab-ci.yml
61 lines (48 loc) · 2.06 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
stages:
- deploy_to_sonatype
- create_key
variables:
REGISTRY: 486234852809.dkr.ecr.us-east-1.amazonaws.com
# From the tagged repo, stage the final artifact
# We've already run tests through the CI when creating the changelog and tag, skip them here
deploy_to_sonatype:
stage: deploy_to_sonatype
tags: [ "arch:amd64" ]
image: registry.ddbuild.io/images/mirror/maven:3.8.6-openjdk-8
only:
- tags
script:
# Ensure we don't print commands being run to the logs during credential
# operations
- set +x
- echo "Installing AWSCLI..."
- apt update
- apt install -y python3 python3-pip
- python3 -m pip install awscli
- echo "Fetching Sonatype user..."
- export SONATYPE_USER=$(aws ssm get-parameter --region us-east-1 --name ci.datadog-api-client-java.publishing.sonatype_username --with-decryption --query "Parameter.Value" --out text)
- echo "Fetching Sonatype password..."
- export SONATYPE_PASS=$(aws ssm get-parameter --region us-east-1 --name ci.datadog-api-client-java.publishing.sonatype_password --with-decryption --query "Parameter.Value" --out text)
- echo "Fetching signing key password..."
- export GPG_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name ci.datadog-api-client-java.signing.gpg_passphrase --with-decryption --query "Parameter.Value" --out text)
- echo "Fetching signing key..."
- GPG_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.datadog-api-client-java.signing.gpg_private_key --with-decryption --query "Parameter.Value" --out text)
- printf -- "$GPG_KEY" | gpg --import --batch
- set -x
- echo "Building release..."
- mvn -DperformRelease=true -DskipTests -Darguments=-DskipTests --settings ./settings.xml clean deploy
# This job creates the GPG key
create_key:
stage: create_key
when: manual
tags: [ "arch:amd64" ]
image: $REGISTRY/ci/agent-key-management-tools/gpg:1
variables:
PROJECT_NAME: "datadog-api-client-java"
EXPORT_TO_KEYSERVER: "false"
script:
- /create.sh
artifacts:
expire_in: 13 mos
paths:
- ./pubkeys/