From 674154620cd14fcc15828365c2a9e13ed57419ea Mon Sep 17 00:00:00 2001 From: Dmitry Kosolapov home Date: Mon, 12 Sep 2022 20:57:10 +0700 Subject: [PATCH] update .drone.yaml --- .drone.yml | 369 +++++++++++++++++++++++++++++++++++++++++++++++++++++ run.sh | 3 +- 2 files changed, 371 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index e639e0a4..c470fc31 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,6 +34,8 @@ steps: - apk add --no-cache aws-cli bash git openssh-client make rsync - npm install --legacy-peer-deps - make prod +# - aws s3 sync build s3://insports-prod --delete +# - aws cloudfront create-invalidation --distribution-id E3KY6BCU3AYHEW --paths "/*" - aws s3 sync build s3://instat-frontend-test-a --delete - aws cloudfront create-invalidation --distribution-id E1WZHVCHZ48SG6 --paths "/*" - make auth-production-build @@ -44,3 +46,370 @@ steps: - rsync -v -r -C build_auth/ ubuntu@auth.insports.tv:/home/ubuntu/ott-auth/src/frontend/ - rsync -v -r -C build_auth/clients/* ubuntu@auth.insports.tv:/home/ubuntu/ott-auth/src/frontend/templates - ssh ubuntu@auth.insports.tv 'bash -s' < ./run.sh OTT-2535 docker-compose-stage.yaml + +#--- +#kind: pipeline +#type: docker +#name: deploy test-a +# +#concurrency: +# limit: 1 +# +#platform: +# os: linux +# arch: amd64 +# +#trigger: +# ref: +# - refs/heads/test-a +# +#steps: +# - name: deploy script +# image: node:16-alpine +# +# 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 +# REACT_APP_STRIPE_PK: +# from_secret: REACT_APP_STRIPE_PK_TEST +# SSH_KEY_AUTH: +# from_secret: SSH_KEY_AUTH +# +# commands: +# - apk add --no-cache aws-cli bash git openssh-client make rsync +# - npm install --legacy-peer-deps +# - make prod +# - aws s3 sync build s3://instat-frontend-test-a --delete +# - aws cloudfront create-invalidation --distribution-id E1WZHVCHZ48SG6 --paths "/*" +## - make auth-build +## - eval $(ssh-agent -s) +## - echo -n "$SSH_KEY_AUTH" | tr -d '\r' | ssh-add - +## - mkdir -p ~/.ssh && chmod 700 ~/.ssh +## - ssh-keyscan auth.insports.tv >> ~/.ssh/known_hosts +## - rsync -v -r -C build_auth/ ubuntu@auth.insports.tv:/home/ubuntu/ott-auth/src/frontend/ +## - rsync -v -r -C build_auth/clients/* ubuntu@auth.insports.tv:/home/ubuntu/ott-auth/src/frontend/templates +## - ssh ubuntu@auth.insports.tv 'bash -s' < ./run.sh OTT-2535 docker-compose-stage.yaml + + +--- +kind: pipeline +type: docker +name: deploy test-b + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-b + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-b --delete + - aws cloudfront create-invalidation --distribution-id E3FV6BVKSJ892U --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy test-c + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-c + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-c --delete + - aws cloudfront create-invalidation --distribution-id E4FBTH9Z3Q4TM --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy test-d + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-d + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-d --delete + - aws cloudfront create-invalidation --distribution-id E3E5C472O6CVFK --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy test-e + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-e + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-d --delete + - aws cloudfront create-invalidation --distribution-id E1S8ZOPGSJZ7Q3 --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy test-f + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-f + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-f --delete + - aws cloudfront create-invalidation --distribution-id E22E79CELC9QUZ --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy test-g + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-g + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-g --delete + - aws cloudfront create-invalidation --distribution-id E187U4H1ZQD1UV --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy test-h + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-h + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-h --delete + - aws cloudfront create-invalidation --distribution-id E18Y84N03IBWDY --paths "/*" + + +--- +kind: pipeline +type: docker +name: deploy test-i + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/test-i + +steps: + - name: deploy script + image: node:16-alpine + + 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 + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK_TEST + SSH_KEY_AUTH: + from_secret: SSH_KEY_AUTH + + commands: + - apk add --no-cache aws-cli bash git openssh-client make rsync + - npm install --legacy-peer-deps + - make prod + - aws s3 sync build s3://instat-frontend-test-i --delete + - aws cloudfront create-invalidation --distribution-id EJYRP4WNVMWD1 --paths "/*" \ No newline at end of file diff --git a/run.sh b/run.sh index 6e4ce5d0..6b88230f 100644 --- a/run.sh +++ b/run.sh @@ -4,5 +4,6 @@ branch=$1 composefile=$2 cd /home/ubuntu/ott-auth -docker-compose -f $composefile restart +docker-compose -f $composefile down +docker-compose -f $composefile up -d echo "[>] Deployment done."