Skip to content

Commit

Permalink
chore: add encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ajasnosz committed Jun 24, 2024
1 parent 991bf1b commit 12766b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/pre-req.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-get install cf-cli
#CF Login
API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -a -pass pass:$ENCRYPT_KEY)
API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
cf login --skip-ssl-validation -a $API_ENDPOINT -u $API_USER -p $API_PASSWORD_DEC

#Create splunk-ci org and space
Expand All @@ -27,7 +27,7 @@ fi

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

if [ $(uaac client get $CLIENT_ID | grep -woc $CLIENT_ID) -eq 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/update_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
#Set below params in github env variable settings
# API_ENDPOINT, API_USER, API_PASSWORD, SPLUNK_TOKEN, SPLUNK_HOST, SPLUNK_INDEX, SPLUNK_METRIC_INDEX
API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -a -pass pass:$ENCRYPT_KEY)
API_PASSWORD_DEC=$(echo $API_PASSWORD | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
#Update manifest for deployment
sed -i 's@API_ENDPOINT:.*@'"API_ENDPOINT: $API_ENDPOINT"'@' scripts/ci_nozzle_manifest.yml
sed -i 's@API_USER:.*@'"API_USER: $API_USER"'@' scripts/ci_nozzle_manifest.yml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ jobs:
echo API_ENDPOINT="https://api.$(jq -r '.sys_domain' ./env.json)" >> "$GITHUB_OUTPUT"
echo API_UAA_ENDPOINT="https://uaa.$(jq -r '.sys_domain' ./env.json)" >> "$GITHUB_OUTPUT"
echo API_PASSWORD="$(hammer -t ./env.json om credentials -- -p cf -t json -c .uaa.admin_credentials | jq -r '.password')" >> "$GITHUB_OUTPUT"
echo $API_PASSWORD | openssl aes-256-cbc -a -salt -pass pass:$ENCRYPT_KEY
API_PASSWORD="$(hammer -t ./env.json om credentials -- -p cf -t json -c .uaa.admin_credentials | jq -r '.password')"
echo $API_PASSWORD | openssl aes-256-cbc -a -pbkdf2 -salt -pass pass:$ENCRYPT_KEY
echo API_PASSWORD=$API_PASSWORD >> "$GITHUB_OUTPUT"
API_CLIENT_PASSWORD="$(hammer -t ./env.json om credentials -- -p cf -t json -c .uaa.admin_client_credentials | jq -r '.password')"
echo $API_CLIENT_PASSWORD | openssl aes-256-cbc -a -salt -pass pass:$ENCRYPT_KEY
echo $API_CLIENT_PASSWORD | openssl aes-256-cbc -a -pbkdf2 -salt -pass pass:$ENCRYPT_KEY
echo API_CLIENT_PASSWORD=$API_CLIENT_PASSWORD >> "$GITHUB_OUTPUT"
echo ENV_ID=$ENV_ID >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 12766b9

Please sign in to comment.