8
8
9
9
set -eo pipefail
10
10
11
- echo " --- Prepare vault context"
11
+ echo " --- Prepare vault context :vault: "
12
12
VAULT_ROLE_ID_SECRET=$( vault read -field=role-id secret/ci/elastic-ecs-logging-java/internal-ci-approle)
13
13
export VAULT_ROLE_ID_SECRET
14
14
@@ -23,10 +23,7 @@ PREVIOUS_VAULT_TOKEN=$VAULT_TOKEN
23
23
export PREVIOUS_VAULT_TOKEN
24
24
unset VAULT_TOKEN
25
25
26
- echo " --- Prepare keys context"
27
- VAULT_TOKEN=$( vault write -field=token auth/approle/login role_id=" $VAULT_ROLE_ID_SECRET " secret_id=" $VAULT_SECRET_ID_SECRET " )
28
- export VAULT_TOKEN
29
-
26
+ echo " --- Prepare a secure temp :closed_lock_with_key:"
30
27
# Prepare a secure temp folder not shared between other jobs to store the key ring
31
28
export TMP_WORKSPACE=/tmp/secured
32
29
export KEY_FILE=$TMP_WORKSPACE " /private.key"
@@ -36,6 +33,16 @@ export GNUPGHOME=$TMP_WORKSPACE"/keyring"
36
33
mkdir -p $GNUPGHOME
37
34
chmod -R 700 $TMP_WORKSPACE
38
35
36
+ echo " --- Prepare keys context :key:"
37
+ VAULT_TOKEN=$( vault write -field=token auth/approle/login role_id=" $VAULT_ROLE_ID_SECRET " secret_id=" $VAULT_SECRET_ID_SECRET " )
38
+ export VAULT_TOKEN
39
+
40
+ # Nexus credentials
41
+ SERVER_USERNAME=$( vault read -field username secret/release/nexus)
42
+ export SERVER_USERNAME
43
+ SERVER_PASSWORD=$( vault read -field password secret/release/nexus)
44
+ export SERVER_PASSWORD
45
+
39
46
# Signing keys
40
47
vault read -field=key secret/release/signing > $KEY_FILE
41
48
KEYPASS_SECRET=$( vault read -field=passphrase secret/release/signing)
@@ -45,11 +52,7 @@ export KEY_ID_SECRET=D88E42B4
45
52
# Import the key into the keyring
46
53
echo " $KEYPASS_SECRET " | gpg --batch --import " $KEY_FILE "
47
54
48
- # Export secring
49
- export SECRING_FILE=$GNUPGHOME " /secring.gpg"
50
- gpg --pinentry-mode=loopback --passphrase " $KEYPASS_SECRET " --export-secret-key $KEY_ID_SECRET > " $SECRING_FILE "
51
-
52
- echo " --- Configure git context"
55
+ echo " --- Configure git context :git:"
53
56
# Configure the committer since the maven release requires to push changes to GitHub
54
57
# This will help with the SLSA requirements.
55
58
git config --global user.email
" [email protected] "
@@ -65,4 +68,3 @@ tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components
65
68
66
69
export JAVA_HOME
67
70
export PATH=$JAVA_HOME /bin:$PATH
68
-
0 commit comments