Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

circleci changes config.yml #1325

Merged
merged 1 commit into from
Mar 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 79 additions & 76 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,106 @@
version: 2

# Python image to run aws utilities
python_env: &python_env
# node image to run aws utilities
node_env: &node_env
docker:
- image: circleci/python:2.7-stretch-browsers
- image: circleci/node:8.16.0-jessie-browsers

# Instructions of installing aws utilities
install_awscli: &install_awscli
name: "Install awscli"
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
sudo pip install awscli awsebcli --upgrade
aws --version
eb --version

# Instructinos of deployment
deploy_steps: &deploy_steps
- attach_workspace:
at: .
- run: *install_awscli
git clone --branch v1.4.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
install_build_dependencies: &install_build_dependencies
name: Install g++-4.8 and Install node-5.12.0
command: |
sudo apt-get update -y
sudo apt-get install g++-4.8 -y
sudo apt-get install python-pip -y
sudo pip install awscli --upgrade
sudo apt install jq -y
sudo apt install phantomjs -y
aws --version

build_npm_steps: &build_npm_steps
name: "configuring environment building environment"
command: |
./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
source buildenvvar
npm rebuild node-sass
npm run lint && npm run build
#npm test
build_deploy_steps: &build_deploy_steps
- run: *install_build_dependencies
- checkout
- run: *install_deploysuite
- restore_cache:
key: node-modules-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
key: node-modules-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: *build_npm_steps
- setup_remote_docker
- run: ./deploy.sh $DEPLOY_ENV


- deploy:
name: Running MasterScript.
command: |
# ./deploy.sh $DEPLOY_ENV
# ./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
source buildenvvar
./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c true
jobs:
build:
machine: true

build_deploy_dev:
<<: *node_env
environment:
CXX: g++-4.8
steps:
- run:
name: Install g++-4.8
command: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install g++-4.8 -y
- run:
name: Install node-5.12.0
command: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | sudo bash
source ~/.bashrc
nvm install 5.12.0
node --version
npm --version
nvm --version

- checkout
- restore_cache:
key: node-modules-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
key: node-modules-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: ls node_modules/*
- run: npm run lint && npm run build
- run: npm test
- persist_to_workspace:
root: .
paths:
- ./
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "topcoder-app"
steps: *build_deploy_steps

deploy_prod:
<<: *python_env
build_deploy_prod:
<<: *node_env
environment:
CXX: g++-4.8
DEPLOY_ENV: "PROD"
steps: *deploy_steps
LOGICAL_ENV: "prod"
APPNAME: "topcoder-app"
steps: *build_deploy_steps

deploy_dev:
<<: *python_env
build_deploy_qa:
<<: *node_env
environment:
DEPLOY_ENV: "DEV"
steps: *deploy_steps

deploy_qa:
<<: *python_env
environemtn:
CXX: g++-4.8
DEPLOY_ENV: "QA"
steps: *deploy_steps
LOGICAL_ENV: "qa"
APPNAME: "topcoder-app"
steps: *build_deploy_steps


workflows:
version: 2
build-and-deploy:
jobs:
- build
- deploy_dev:
- build_deploy_dev:
context : org-global
filters:
branches:
only: [ dev, dev-circleci2 ]
requires:
- build
- deploy_prod:
- build_deploy_qa:
context : org-global
filters:
branches:
only: master
requires:
- build
- deploy_qa:
only: qa-integration
- build_deploy_prod:
context : org-global
filters:
branches:
only: qa-integration
requires:
- build
only: master