Skip to content

Commit

Permalink
Merge pull request #2429 from sky1045/feature/purge-ncloud-cdn
Browse files Browse the repository at this point in the history
Run as bash & use gdate on macOS
  • Loading branch information
sky1045 committed Mar 28, 2024
2 parents bbefbe1 + 8537a85 commit 17db8fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/internal/launcher/latest-mac.yml"
fi
sh ./scripts/purge-ncloud-cdn.sh ${{ secrets.NAVER_CLOUD_ACCESS_KEY }} ${{ secrets.NAVER_CLOUD_SECRET_KEY }} ${{ secrets.NAVER_CLOUD_CDN_ID }}
bash ./scripts/purge-ncloud-cdn.sh ${{ runner.os }} ${{ secrets.NAVER_CLOUD_ACCESS_KEY }} ${{ secrets.NAVER_CLOUD_SECRET_KEY }} ${{ secrets.NAVER_CLOUD_CDN_ID }}
curl -X POST -H 'Content-type: application/json' --data '{"text":"[Launcher] Had success releasing with '${{ matrix.packCmd }}' pack-cmd"}' ${{ secrets.SLACK_WEBHOOK }}
rm -fR ./dist/*-unpacked
Expand Down
13 changes: 9 additions & 4 deletions scripts/purge-ncloud-cdn.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

ACCESS_KEY=$1
SECRET_KEY=$2
OS=$1
ACCESS_KEY=$2
SECRET_KEY=$3
API_GATEWAY_URL="https://ncloud.apigw.ntruss.com"
RESOURCE_URL="/cdn/v2/requestGlobalCdnPurge?cdnInstanceNo=$3&isWholePurge=true&isWholeDomain=true&responseFormatType=JSON"
TIMESTAMP=$(echo $(($(date +%s%N)/1000000)))
RESOURCE_URL="/cdn/v2/requestGlobalCdnPurge?cdnInstanceNo=$4&isWholePurge=true&isWholeDomain=true&responseFormatType=JSON"
if [[ $OS = "macOS" ]] then
TIMESTAMP=$(echo $(($(gdate +%s%N)/1000000)))
else
TIMESTAMP=$(echo $(($(date +%s%N)/1000000)))
fi

function makeSignature() {
nl=$'\\n'
Expand Down

0 comments on commit 17db8fe

Please sign in to comment.