Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 81c9f2d

Browse files
authoredFeb 3, 2022
Merge pull request #87 from topcoder-platform/develop
Self-service prod release
2 parents 8fb7032 + 40544e3 commit 81c9f2d

File tree

70 files changed

+11222
-3077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+11222
-3077
lines changed
 

‎.circleci/config.yml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
version: 2
1+
version: 2.1
2+
parameters:
3+
run_automatedtesting:
4+
default: false
5+
type: boolean
6+
run_basedeployment:
7+
default: true
8+
type: boolean
29
defaults: &defaults
310
docker:
411
- image: circleci/python:2.7-stretch-browsers
512
install_dependency: &install_dependency
613
name: Installation of build and deployment dependencies.
714
command: |
8-
sudo apt install jq
9-
sudo pip install awscli --upgrade
10-
sudo pip install docker-compose
15+
sudo apt install jq python3-pip
16+
sudo pip3 install awscli --upgrade
17+
# sudo pip install docker-compose
1118
install_deploysuite: &install_deploysuite
1219
name: Installation of install_deploysuite.
1320
command: |
@@ -39,6 +46,16 @@ builddeploy_steps: &builddeploy_steps
3946
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
4047
source buildenvvar
4148
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
49+
#testing code changes
50+
if [[ true ]]; then
51+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-qa-v1-appvar
52+
source buildenvvar
53+
curl --request POST \
54+
--url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
55+
--header "Circle-Token: ${QA_USER_TOKEN}" \
56+
--header 'content-type: application/json' \
57+
--data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_automatedtesting":true , "run_basedeployment": false}}'
58+
fi
4259
4360
4461
jobs:
@@ -62,6 +79,10 @@ jobs:
6279
"Run-Newman-Test":
6380
docker:
6481
- image: circleci/node:12
82+
environment:
83+
DEPLOY_ENV: "DEV"
84+
LOGICAL_ENV: "dev"
85+
APPNAME: "resources-api"
6586
- image: tray/dynamodb-local
6687
command: "-inMemory -port 7777"
6788
- image: elasticsearch:6.8.13
@@ -70,21 +91,29 @@ jobs:
7091
steps:
7192
- checkout
7293
- setup_remote_docker
94+
- run: *install_dependency
95+
- run: *install_deploysuite
7396
- run:
7497
name: 'newman test'
7598
command: |
99+
./awsconfiguration.sh $DEPLOY_ENV
100+
source awsenvconf
101+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-qa-appvar
102+
source buildenvvar
76103
npm i
77-
cd local
78-
cd ..
79-
npm run create-tables:test
80104
cd mock
81105
(npm run mock-challenge-api&)
82106
(NODE_ENV=test npm start&)
83-
npm run test:newman
107+
npm run test:newman:clear
108+
npm run test:newman
109+
npm run test:newman:clear
110+
- store_artifacts:
111+
path: ./newman
84112

85113
workflows:
86114
version: 2
87115
build:
116+
when: << pipeline.parameters.run_basedeployment >>
88117
jobs:
89118
# Development builds are executed on "develop" branch only.
90119
- "build-dev":
@@ -93,22 +122,27 @@ workflows:
93122
branches:
94123
only:
95124
- develop
125+
- dev-circleci
96126

97-
# Production builds are exectuted only on tagged commits to the
127+
# Production builds are exectuted only on tagged commits to the testing
98128
# master branch.
99129
- "build-prod":
100130
context : org-global
101131
filters:
102132
branches:
103133
only: master
104134

135+
testingflow:
136+
when: << pipeline.parameters.run_automatedtesting >>
137+
jobs:
138+
- Hold [Performance-Testing]:
139+
type: approval
105140
- "Run-Newman-Test":
106-
context : org-global
141+
context : org-global
107142
requires:
108-
- build-dev
109-
- build-prod
143+
- Hold [Performance-Testing]
110144
filters:
111145
branches:
112146
only:
113-
- automated-postman-testing
114-
- develop
147+
- develop
148+
- dev-circleci

‎.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ lib-cov
1717
# Coverage directory used by tools like istanbul
1818
coverage
1919

20+
# Newman tests
21+
newman
22+
2023
# nyc test coverage
2124
.nyc_output
2225

0 commit comments

Comments
 (0)
Please sign in to comment.