Skip to content

Commit 0a5acd5

Browse files
committed
chore: replace env
1 parent 6781685 commit 0a5acd5

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.github/pre-req.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ sudo apt-get update
1010
sudo apt-get install apt-transport-https ca-certificates
1111
sudo apt-get install cf-cli
1212
#CF Login
13-
API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
14-
cf login --skip-ssl-validation -a $API_ENDPOINT -u $API_USER -p $API_PASSWORD_DEC
13+
API_PASSWORD_DEC=$(echo "$API_PASSWORD" | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:"$ENCRYPT_KEY")
14+
cf login --skip-ssl-validation -a "$API_ENDPOINT" -u "$API_USER" -p "$API_PASSWORD_DEC"
1515

1616
#Create splunk-ci org and space
1717
if [ "`cf o | grep "splunk-ci-org"`" == "splunk-ci-org" ]; then
@@ -26,10 +26,10 @@ else
2626
fi
2727

2828
gem install cf-uaac
29-
uaac target $API_UAA_ENDPOINT --skip-ssl-validation
30-
API_CLIENT_PASSWORD_DEC=$(echo $API_CLIENT_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
31-
uaac token client get $API_USER -s $API_CLIENT_PASSWORD_DEC
29+
uaac target "$API_UAA_ENDPOINT" --skip-ssl-validation
30+
API_CLIENT_PASSWORD_DEC=$(echo "$API_CLIENT_PASSWORD" | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:"$ENCRYPT_KEY")
31+
uaac token client get "$API_USER" -s "$API_CLIENT_PASSWORD_DEC"
3232

33-
if [ $(uaac client get $CLIENT_ID | grep -woc $CLIENT_ID) -eq 0 ]; then
34-
uaac client add $CLIENT_ID --name splunk-firehose --secret $CLIENT_SECRET --authorized_grant_types client_credentials,refresh_token --authorities doppler.firehose,cloud_controller.admin_read_only
33+
if [ $(uaac client get "$CLIENT_ID" | grep -woc "$CLIENT_ID") -eq 0 ]; then
34+
uaac client add "$CLIENT_ID" --name splunk-firehose --secret "$CLIENT_SECRET" --authorized_grant_types client_credentials,refresh_token --authorities doppler.firehose,cloud_controller.admin_read_only
3535
fi

.github/update_manifest.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
set -e
33
#Set below params in github env variable settings
44
# API_ENDPOINT, API_USER, API_PASSWORD, SPLUNK_TOKEN, SPLUNK_HOST, SPLUNK_INDEX, SPLUNK_METRIC_INDEX
5-
API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
5+
API_PASSWORD_DEC=$(echo "$API_PASSWORD" | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:"$ENCRYPT_KEY")
6+
echo "$API_PASSWORD_DEC"
67
#Update manifest for deployment
78
sed -i 's@API_ENDPOINT:.*@'"API_ENDPOINT: $API_ENDPOINT"'@' scripts/ci_nozzle_manifest.yml
89
sed -i 's@API_USER:.*@'"API_USER: $API_USER"'@' scripts/ci_nozzle_manifest.yml

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686

8787
- name: Claim environment and wait
8888
run: |
89-
echo ENV_ID="5092" >> "$GITHUB_ENV"
89+
echo ENV_ID="$(./selfservice claimAndWait isv_ci_tas_srt_4_0 | jq -r '.id')" >> "$GITHUB_ENV"
9090
9191
- name: Set up Go
9292
uses: actions/setup-go@v3
@@ -375,6 +375,6 @@ jobs:
375375
env:
376376
API_TOKEN: ${{ secrets.API_TOKEN }}
377377

378-
# - name: release environment
379-
# run: |
380-
# ./selfservice release $ENV_ID
378+
- name: release environment
379+
run: |
380+
./selfservice release $ENV_ID

0 commit comments

Comments
 (0)