|
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 | +
|
| 11 | +install_deploysuite: &install_deploysuite |
| 12 | + name: Installation of install_deploysuite. |
| 13 | + command: | |
| 14 | + git clone --branch v1.3 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript |
| 15 | + cp ./../buildscript/master_deploy.sh . |
| 16 | + cp ./../buildscript/buildenv.sh . |
| 17 | + cp ./../buildscript/awsconfiguration.sh . |
| 18 | + |
| 19 | +# Instructions of deployment |
| 20 | +deploy_steps: &deploy_steps |
| 21 | + - checkout |
| 22 | + - attach_workspace: |
| 23 | + at: ./workspace |
| 24 | + - run: *install_awscli |
| 25 | + - run: *install_deploysuite |
| 26 | + - setup_remote_docker |
| 27 | + - run: |
| 28 | + name: "configuring aws environment" |
| 29 | + command: | |
| 30 | + ./awsconfiguration.sh $DEPLOY_ENV |
| 31 | + - run: |
| 32 | + name: "Building image for deploy" |
| 33 | + command: | |
| 34 | + source awsenvconf |
| 35 | + ./build.sh $DEPLOY_ENV |
| 36 | + - deploy: |
| 37 | + name: "Deploying software" |
| 38 | + command: | |
| 39 | + source awsenvconf |
| 40 | + ./deploy.sh $DEPLOY_ENV |
| 41 | +
|
| 42 | + |
2 | 43 | jobs: |
3 | 44 | test: |
4 | 45 | docker: |
@@ -30,54 +71,34 @@ jobs: |
30 | 71 | root: . |
31 | 72 | paths: |
32 | 73 | - 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: ./build.sh DEV |
50 | | - - run: ./deploy.sh DEV |
| 74 | + |
| 75 | + |
51 | 76 | deployProd: |
52 | | - docker: |
53 | | - - image: docker:17.06.1-ce-git |
54 | | - steps: |
55 | | - - checkout |
56 | | - - setup_remote_docker |
57 | | - - run: |
58 | | - name: Installation of build dependencies. |
59 | | - command: apk add --no-cache bash |
60 | | - - attach_workspace: |
61 | | - at: ./workspace |
62 | | - - run: |
63 | | - name: Installing AWS client |
64 | | - command: | |
65 | | - apk add --no-cache jq py-pip sudo |
66 | | - sudo pip install awscli --upgrade |
67 | | - - run: ./build.sh PROD |
68 | | - - run: ./deploy.sh PROD |
| 77 | + <<: *python_env |
| 78 | + environment: |
| 79 | + DEPLOY_ENV: "PROD" |
| 80 | + steps: *deploy_steps |
| 81 | + |
| 82 | + deployDev: |
| 83 | + <<: *python_env |
| 84 | + environment: |
| 85 | + DEPLOY_ENV: "DEV" |
| 86 | + steps: *deploy_steps |
| 87 | + |
69 | 88 | workflows: |
70 | 89 | version: 2 |
71 | 90 | build: |
72 | 91 | jobs: |
73 | 92 | - test |
74 | 93 | - deployDev: |
| 94 | + context : org-global |
75 | 95 | requires: |
76 | 96 | - test |
77 | 97 | filters: |
78 | 98 | branches: |
79 | 99 | only: ['dev', 'feature/attachmentPermissions'] |
80 | 100 | - deployProd: |
| 101 | + context : org-global |
81 | 102 | requires: |
82 | 103 | - test |
83 | 104 | filters: |
|
0 commit comments