Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1.0
name: Deploy
name: Production-Deploy
agent:
machine:
type: e1-standard-2
Expand Down
8 changes: 6 additions & 2 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ blocks:
commands:
- checkout
- artifact push workflow clevertap.min.js
- artifact push workflow clevertap.js
- artifact push workflow clevertap.js.map
promotions:
- name: Deploy
pipeline_file: deploy.yml
- name: Production
pipeline_file: production-deploy.yml
- name: Staging
pipeline_file: staging-deploy.yml
32 changes: 32 additions & 0 deletions .semaphore/staging-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: v1.0
name: Staging-Deploy
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004
blocks:
- name: Deploy Assets
task:
jobs:
- name: Deploy Assets to S3 and Invalidate CloudFront Cache
commands:
- artifact pull workflow clevertap.min.js
- artifact pull workflow clevertap.js
- artifact pull workflow clevertap.js.map
- |
mkdir utils
aws s3 cp s3://cfstack-init-sources3bucket-b5bxfzywj4ae/utils/generate_assumed_role_creds.py utils/generate_assumed_role_creds.py
eval $(python3 utils/generate_assumed_role_creds.py --role-arn ${PRODUCTION_ACCOUNT_IAM_ROLE_ARN} --session-name SemaphoreAgent)
env | grep AWS
aws sts get-caller-identity
aws s3 cp ./clevertap.min.js s3://static.wizrocket.com/staging/${SEMAPHORE_GIT_BRANCH}/js/ --acl public-read
aws s3 cp ./clevertap.js s3://static.wizrocket.com/staging/${SEMAPHORE_GIT_BRANCH}/js/ --acl public-read
aws s3 cp ./clevertap.js.map s3://static.wizrocket.com/staging/${SEMAPHORE_GIT_BRANCH}/js/ --acl public-read
rm -r clevertap.min.js clevertap.js clevertap.js.map
aws cloudfront create-invalidation --distribution-id E1OCAMMKX0F1A1 --paths /staging/${SEMAPHORE_GIT_BRANCH}/js/clevertap.min.js /staging/${SEMAPHORE_GIT_BRANCH}/js/clevertap.js /staging/${SEMAPHORE_GIT_BRANCH}/js/clevertap.js.map
secrets:
- name: ProductionAccountAwsCredentials
agent:
machine:
type: s1-t2-micro
os_image: ''
Loading