Skip to content
36 changes: 29 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: 2
version: 2.1
parameters:
run_automatedtesting:
default: false
type: boolean
run_basedeployment:
default: true
type: boolean
defaults: &defaults
docker:
- image: circleci/python:2.7-stretch-browsers
Expand Down Expand Up @@ -39,6 +46,16 @@ builddeploy_steps: &builddeploy_steps
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
#testing code changes
if [[ true ]]; then
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-qa-v1-appvar
source buildenvvar
curl --request POST \
--url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
--header "Circle-Token: ${QA_USER_TOKEN}" \
--header 'content-type: application/json' \
--data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_automatedtesting":true , "run_basedeployment": false}}'
fi


jobs:
Expand Down Expand Up @@ -85,6 +102,7 @@ jobs:
workflows:
version: 2
build:
when: << pipeline.parameters.run_basedeployment >>
jobs:
# Development builds are executed on "develop" branch only.
- "build-dev":
Expand All @@ -93,22 +111,26 @@ workflows:
branches:
only:
- develop
- dev-circleci

# Production builds are exectuted only on tagged commits to the
# Production builds are exectuted only on tagged commits to the testing
# master branch.
- "build-prod":
context : org-global
filters:
branches:
only: master

testingflow:
when: << pipeline.parameters.run_automatedtesting >>
jobs:
- Hold [Performance-Testing]:
type: approval
- "Run-Newman-Test":
context : org-global
context : org-global
requires:
- build-dev
- build-prod
- Hold [Performance-Testing]
filters:
branches:
only:
- automated-postman-testing
- develop
- dev-circleci