Skip to content

Commit

Permalink
chore: replace env
Browse files Browse the repository at this point in the history
  • Loading branch information
ajasnosz committed Jun 24, 2024
1 parent 6781685 commit 0a5acd5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .github/pre-req.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ 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 -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
cf login --skip-ssl-validation -a $API_ENDPOINT -u $API_USER -p $API_PASSWORD_DEC
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
if [ "`cf o | grep "splunk-ci-org"`" == "splunk-ci-org" ]; then
Expand All @@ -26,10 +26,10 @@ else
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 -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
uaac token client get $API_USER -s $API_CLIENT_PASSWORD_DEC
uaac target "$API_UAA_ENDPOINT" --skip-ssl-validation
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
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
if [ $(uaac client get "$CLIENT_ID" | grep -woc "$CLIENT_ID") -eq 0 ]; then
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
fi
3 changes: 2 additions & 1 deletion .github/update_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
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 -pbkdf2 -a -pass pass:$ENCRYPT_KEY)
API_PASSWORD_DEC=$(echo "$API_PASSWORD" | openssl aes-256-cbc -d -pbkdf2 -a -pass pass:"$ENCRYPT_KEY")
echo "$API_PASSWORD_DEC"
#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
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:

- name: Claim environment and wait
run: |
echo ENV_ID="5092" >> "$GITHUB_ENV"
echo ENV_ID="$(./selfservice claimAndWait isv_ci_tas_srt_4_0 | jq -r '.id')" >> "$GITHUB_ENV"
- name: Set up Go
uses: actions/setup-go@v3
Expand Down Expand Up @@ -375,6 +375,6 @@ jobs:
env:
API_TOKEN: ${{ secrets.API_TOKEN }}

# - name: release environment
# run: |
# ./selfservice release $ENV_ID
- name: release environment
run: |
./selfservice release $ENV_ID

0 comments on commit 0a5acd5

Please sign in to comment.