From e0ee092c9744c87e5fbb6cb3ac02a79207764597 Mon Sep 17 00:00:00 2001 From: Dmitry Kosolapov home Date: Wed, 11 Jan 2023 22:33:25 +0700 Subject: [PATCH] add autodeploy diwan.insports.tv --- .drone.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b40025ce..da0ccd0d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -195,7 +195,6 @@ steps: AWS_MAX_ATTEMPTS: 10 commands: - aws s3 sync build_insports-diwansport s3://insports-diwansport --delete - - aws cloudfront create-invalidation --distribution-id E3LKAH6TR4O2JL --paths "/*" - aws cloudfront create-invalidation --distribution-id E3LKAH6TR4O2JL --paths "/*" # # diwansport.net - aws cloudfront create-invalidation --distribution-id E3NJ2G0QSB6MVI --paths "/*" # tunisia.insports.tv @@ -684,3 +683,59 @@ steps: - rsync -v -r -C build_auth/clients/* ubuntu@auth.test.insports.tv:/home/ubuntu/ott-auth/src/frontend/templates - aws s3 sync build_auth s3://auth-insports-test --delete - aws cloudfront create-invalidation --distribution-id E10YI3RFOZZDLZ --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy diwan.insports.tv + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/diwan.insports.tv + +steps: + - name: npm-install + image: node:16-alpine + environment: + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK + commands: + - apk add --no-cache make + - npm install --legacy-peer-deps + + - name: make-diwansport + image: node:16-alpine + environment: + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK + commands: + - apk add --no-cache make + - make diwansport-prod + depends_on: + - npm-install + + - name: deploy-diwansport + image: amazon/aws-cli:latest + environment: + AWS_ACCESS_KEY_ID: + from_secret: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: AWS_SECRET_ACCESS_KEY + AWS_DEFAULT_REGION: + from_secret: AWS_DEFAULT_REGION + AWS_MAX_ATTEMPTS: 10 + commands: + - aws s3 sync build_tunisia s3://insports-diwansport --delete + - aws cloudfront create-invalidation --distribution-id E3LKAH6TR4O2JL --paths "/*" # # diwansport.net + - aws cloudfront create-invalidation --distribution-id E3NJ2G0QSB6MVI --paths "/*" # tunisia.insports.tv + + depends_on: + - make-diwansport \ No newline at end of file