|
1 | 1 | version: 2
|
| 2 | +python_env: &python_env |
| 3 | + docker: |
| 4 | + - image: circleci/python:2.7-stretch-browsers |
| 5 | + |
| 6 | +install_awscli: &install_awscli |
| 7 | + name: "Install awscli" |
| 8 | + command: | |
| 9 | + sudo pip install awscli --upgrade |
| 10 | +install_deploysuite: &install_deploysuite |
| 11 | + name: Installation of install_deploysuite. |
| 12 | + command: | |
| 13 | + git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript |
| 14 | + cp ./../buildscript/master_deploy.sh . |
| 15 | + cp ./../buildscript/buildenv.sh . |
| 16 | + cp ./../buildscript/awsconfiguration.sh . |
| 17 | + |
| 18 | +# Instructions of deployment |
| 19 | +deploy_steps: &deploy_steps |
| 20 | + - checkout |
| 21 | + - attach_workspace: |
| 22 | + at: ./workspace |
| 23 | + - run: *install_awscli |
| 24 | + - run: *install_deploysuite |
| 25 | + - setup_remote_docker |
| 26 | + - run: docker build -t tc-project-service:latest . |
| 27 | + - deploy: |
| 28 | + name: "Running Masterscript - deploy tc-project-service " |
| 29 | + command: | |
| 30 | + ./awsconfiguration.sh $DEPLOY_ENV |
| 31 | + source awsenvconf |
| 32 | + ./buildenv.sh -e $DEPLOY_ENV -b ${VAR_ENV}-tc-project-service-deployvar |
| 33 | + source buildenvvar |
| 34 | + ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${VAR_ENV}-global-appvar,${VAR_ENV}-tc-project-service-appvar -i tc-project-service -p FARGATE |
| 35 | + echo "======= Running Masterscript - deploy tc-project-service-consumers ===========" |
| 36 | + if [ -e ${VAR_ENV}-tc-project-service-appvar.json ]; then sudo rm -vf ${VAR_ENV}-tc-project-service-appvar.json; fi |
| 37 | + ./buildenv.sh -e $DEPLOY_ENV -b ${VAR_ENV}-tc-project-service-consumers-deployvar |
| 38 | + source buildenvvar |
| 39 | + ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${VAR_ENV}-global-appvar,${VAR_ENV}-tc-project-service-appvar -i tc-project-service -p FARGATE |
| 40 | + |
2 | 41 | jobs:
|
3 | 42 | test:
|
4 | 43 | docker:
|
@@ -30,70 +69,37 @@ jobs:
|
30 | 69 | root: .
|
31 | 70 | paths:
|
32 | 71 | - dist
|
33 |
| - deployDev: |
34 |
| - docker: |
35 |
| - - image: docker:17.06.1-ce-git |
36 |
| - steps: |
37 |
| - - checkout |
38 |
| - - setup_remote_docker |
39 |
| - - run: |
40 |
| - name: Installation of build dependencies. |
41 |
| - command: apk add --no-cache bash |
42 |
| - - attach_workspace: |
43 |
| - at: ./workspace |
44 |
| - - run: |
45 |
| - name: Installing AWS client |
46 |
| - command: | |
47 |
| - apk add --no-cache jq py-pip sudo |
48 |
| - sudo pip install awscli --upgrade |
49 |
| - - run: |
50 |
| - name: Building |
51 |
| - command: | |
52 |
| - set +e |
53 |
| - ./build.sh DEV |
54 |
| - - run: |
55 |
| - name: Deploying |
56 |
| - command: | |
57 |
| - ./deploy.sh DEV |
| 72 | + |
58 | 73 | deployProd:
|
59 |
| - docker: |
60 |
| - - image: docker:17.06.1-ce-git |
61 |
| - steps: |
62 |
| - - checkout |
63 |
| - - setup_remote_docker |
64 |
| - - run: |
65 |
| - name: Installation of build dependencies. |
66 |
| - command: apk add --no-cache bash |
67 |
| - - attach_workspace: |
68 |
| - at: ./workspace |
69 |
| - - run: |
70 |
| - name: Installing AWS client |
71 |
| - command: | |
72 |
| - apk add --no-cache jq py-pip sudo |
73 |
| - sudo pip install awscli --upgrade |
74 |
| - - run: |
75 |
| - name: Building |
76 |
| - command: | |
77 |
| - set +e |
78 |
| - ./build.sh PROD |
79 |
| - - run: |
80 |
| - name: Deploying |
81 |
| - command: | |
82 |
| - ./deploy.sh PROD |
| 74 | + <<: *python_env |
| 75 | + environment: |
| 76 | + DEPLOY_ENV: "PROD" |
| 77 | + VAR_ENV: "prod" |
| 78 | + steps: *deploy_steps |
| 79 | + |
| 80 | + deployDev: |
| 81 | + <<: *python_env |
| 82 | + environment: |
| 83 | + DEPLOY_ENV: "DEV" |
| 84 | + VAR_ENV: "dev" |
| 85 | + steps: *deploy_steps |
| 86 | + |
83 | 87 | workflows:
|
84 | 88 | version: 2
|
85 | 89 | build:
|
86 | 90 | jobs:
|
87 | 91 | - test
|
88 | 92 | - deployDev:
|
| 93 | + context : org-global |
89 | 94 | requires:
|
90 | 95 | - test
|
91 | 96 | filters:
|
92 | 97 | branches:
|
93 |
| - only: ['dev', 'feature/attachmentPermissions'] |
| 98 | + only: ['dev', 'dev-sts'] |
94 | 99 | - deployProd:
|
| 100 | + context : org-global |
95 | 101 | requires:
|
96 | 102 | - test
|
97 | 103 | filters:
|
98 | 104 | branches:
|
99 |
| - only: 'master' |
| 105 | + only: ['master'] |
0 commit comments