Skip to content

Commit

Permalink
Merge pull request #119 from topcoder-platform/feature/scroll-search
Browse files Browse the repository at this point in the history
feat: implement scroll search
  • Loading branch information
rakibansary committed Apr 14, 2023
2 parents d322cfd + bd5bc82 commit 7adb853
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 7,272 deletions.
164 changes: 74 additions & 90 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ parameters:
default: true
type: boolean
defaults: &defaults
docker:
- image: circleci/python:2.7-stretch-browsers
docker:
- image: circleci/python:2.7-stretch-browsers
install_dependency: &install_dependency
name: Installation of build and deployment dependencies.
command: |
Expand All @@ -28,120 +28,104 @@ restore_cache_settings_for_build: &restore_cache_settings_for_build
save_cache_settings: &save_cache_settings
key: docker-node-modules-{{ checksum "package-lock.json" }}
paths:
- node_modules
- node_modules

builddeploy_steps: &builddeploy_steps
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- restore_cache: *restore_cache_settings_for_build
- run: ./build.sh ${APPNAME}
- save_cache: *save_cache_settings
- deploy:
name: Running MasterScript.
command: |
./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./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
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- restore_cache: *restore_cache_settings_for_build
- run: ./build.sh ${APPNAME}
- save_cache: *save_cache_settings
- deploy:
name: Running MasterScript.
command: "./awsconfiguration.sh $DEPLOY_ENV\nsource awsenvconf\n./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar\nsource buildenvvar\n./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}\n#testing code changes\nif [[ true ]]; then\n ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-qa-v1-appvar\n source buildenvvar \n curl --request POST \\\n --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \\\n --header \"Circle-Token: ${QA_USER_TOKEN}\" \\\n --header 'content-type: application/json' \\\n --data '{\"branch\":\"'\"$CIRCLE_BRANCH\"'\",\"parameters\":{\"run_automatedtesting\":true , \"run_basedeployment\": false}}'\nfi \n #magic___^_^___line\n #magic___^_^___line\n"
jobs:
# Build & Deploy against development backend
"build-dev":
<<: *defaults
!!merge <<: *defaults
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "resources-api"
APPNAME: "resources-api"
steps: *builddeploy_steps

"build-prod":
<<: *defaults
!!merge <<: *defaults
environment:
DEPLOY_ENV: "PROD"
LOGICAL_ENV: "prod"
APPNAME: "resources-api"
LOGICAL_ENV: "prod"
APPNAME: "resources-api"
steps: *builddeploy_steps

"Run-Newman-Test":
docker:
- image: circleci/node:12
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "resources-api"
- image: tray/dynamodb-local
command: "-inMemory -port 7777"
- image: elasticsearch:6.8.13
environment:
discovery.type: "single-node"
- image: circleci/node:12
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "resources-api"
- image: tray/dynamodb-local
command: "-inMemory -port 7777"
- image: elasticsearch:6.8.13
environment:
discovery.type: "single-node"
steps:
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- run:
name: 'newman test'
command: |
./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-qa-appvar
source buildenvvar
npm i
cd mock
(npm run mock-challenge-api&)
(NODE_ENV=test npm start&)
npm run test:newman:clear
npm run test:newman
npm run test:newman:clear
- store_artifacts:
path: ./newman
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- run:
name: 'newman test'
command: |
./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-qa-appvar
source buildenvvar
npm i
cd mock
(npm run mock-challenge-api&)
(NODE_ENV=test npm start&)
npm run test:newman:clear
npm run test:newman
npm run test:newman:clear
- store_artifacts:
path: ./newman

workflows:
version: 2
build:
when: << pipeline.parameters.run_basedeployment >>
jobs:
# Development builds are executed on "develop" branch only.
- "build-dev":
context : org-global
filters:
branches:
only:
- develop
# Development builds are executed on "develop" branch only.
- "build-dev":
context: org-global
filters:
branches:
only:
- develop
- feature/scroll-search

# Production builds are exectuted only on tagged commits to the testing
# master branch.
- "build-prod":
context : org-global
filters:
branches:
only: master
# 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
requires:
- Hold [Performance-Testing]
filters:
branches:
only:
- develop
- dev-circleci
- Hold [Performance-Testing]:
type: approval
- "Run-Newman-Test":
context: org-global
requires:
- Hold [Performance-Testing]
filters:
branches:
only:
- develop
- dev-circleci
Loading

0 comments on commit 7adb853

Please sign in to comment.