Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7e67e9e
edit: disabled docker build and k8s deploy
shudarshon-deriv Jan 29, 2020
67b1331
edit: testing artifact storing configuration
shudarshon-deriv Jan 29, 2020
a1382b8
edit: edited project build command
shudarshon-deriv Jan 29, 2020
b55291b
edit: edited artifact path
shudarshon-deriv Jan 29, 2020
57c200e
using artifact path as compressed static content
shudarshon-deriv Jan 30, 2020
083d00b
edit: added artifact compression step
shudarshon-deriv Jan 30, 2020
e67bc1f
edit: added artifact moving step
shudarshon-deriv Jan 30, 2020
eddee1c
edit: edited artifact name and desitnation configuration
shudarshon-deriv Jan 30, 2020
2bd2fd0
add: added artifact upload to s3 step
shudarshon-deriv Jan 30, 2020
7fe1283
edit: added circle ci project name in s3 upload url
shudarshon-deriv Jan 30, 2020
c5df571
test: testing environment variable integration
shudarshon-deriv Jan 30, 2020
63ac8cb
testing circle ci variable
shudarshon-deriv Jan 30, 2020
ed15ef4
edit: edited orb alias and removed unwanted artifact configuration
shudarshon-deriv Jan 30, 2020
f7e514c
add: added commit-id/checksum as an added information regarding artficat
shudarshon-deriv Jan 30, 2020
dab9041
edit: testing circle ci config with singel step artifact upload
shudarshon-deriv Jan 30, 2020
5cddd6b
fix: fix s3 copy error in pipeline script
shudarshon-deriv Jan 30, 2020
e396bea
disabled checksum calculation and enabled commit id as artifact id
shudarshon-deriv Jan 30, 2020
a301d60
edit: enabled commit id upload as a jobs step
shudarshon-deriv Jan 30, 2020
3baa4fa
edit: uploading checksum instead of commit id
shudarshon-deriv Jan 30, 2020
29e49d7
add: add cron script for deployment
shudarshon-deriv Jan 30, 2020
f7f9823
changed access settings in aws
shudarshon-deriv Jan 30, 2020
d3d4bf2
edit: enabled all job steps to execute
shudarshon-deriv Feb 4, 2020
308d640
remove: removed unnecesary deployment script
shudarshon-deriv Feb 5, 2020
b308cc8
edit: using circle ci context variable instead of project based envva…
shudarshon-deriv Feb 5, 2020
4a2eced
test: testing s3 upload with metadata integration
shudarshon-deriv Feb 7, 2020
6b84fc0
test: testing s3 orb metadata
shudarshon-deriv Feb 7, 2020
2a89ddc
test: testing circleci orb metadata integration
shudarshon-deriv Feb 7, 2020
eb81cf7
test: testing circleci orb metadata integration
shudarshon-deriv Feb 7, 2020
7c68a91
test: testing bash variable integration with s3 orb metadata
shudarshon-deriv Feb 7, 2020
80a413d
test: using BASH_ENV to retrieve bash environment value in pipeline
shudarshon-deriv Feb 7, 2020
b38b8e5
test: using to retrieve bash environment value in pipeline
shudarshon-deriv Feb 7, 2020
b3c722a
test: testing with commit id as artifact id
shudarshon-deriv Feb 7, 2020
474404d
add: tagging commit id as artifact identifier
shudarshon-deriv Feb 7, 2020
3305c0a
edit: edited context name
shudarshon-deriv Feb 7, 2020
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
58 changes: 48 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2.1
orbs:
k8s: circleci/kubernetes@0.7.0
s3: circleci/aws-s3@1.0.13
commands:
git_checkout_from_cache:
description: "Git checkout and save cache"
Expand All @@ -11,8 +12,8 @@ commands:
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{ .Branch }}-
- source-v1-
- run:
name: Fetch git tags
- run:
name: Fetch git tags
command: |
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ' >> ~/.ssh/known_hosts
Expand All @@ -23,7 +24,7 @@ commands:
fi
- checkout
- run:
name: Compress git objects
name: Compress git objects
command: git gc
- save_cache:
name: Git save cache
Expand Down Expand Up @@ -52,18 +53,52 @@ commands:
description: "Build"
steps:
- run:
name: "Grunt deploy"
command: npm run deploy-ci
name: "Compile project"
command: npm run build

compress:
description: "Compress"
steps:
- run:
name: "Compress"
command: |
pushd dist/compressed/
tar -cvf artifact.tar *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we compress the tar file? it needs z for zip.

mv artifact.tar ${OLDPWD}/
- run:
name: "Tag commit id as artifact identifer"
command: echo "${CIRCLE_SHA1}" > artifact-info.txt

upload_artifact:
description: "upload build artifact to s3 bucket"
steps:
- s3/copy:
from: artifact.tar
to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/'
aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID
aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY
aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION
arguments: '--metadata "{\"x-amz-artifact-id\": \"${CIRCLE_SHA1}\" }"'

upload_checksum:
description: "upload artifact checksum to s3"
steps:
- s3/copy:
from: artifact-info.txt
to: 's3://${CONTEXT_ARTIFACT_S3_BUCKET}/${CIRCLE_PROJECT_REPONAME}/'
aws-access-key-id: env_CONTEXT_ARTIFACT_S3_AWS_ACCESS_KEY_ID
aws-secret-access-key: env_CONTEXT_ARTIFACT_S3_AWS_SECRET_ACCESS_KEY
aws-region: env_CONTEXT_ARTIFACT_S3_AWS_REGION

docker:
description: "Build and Push image to docker hub"
steps:
- setup_remote_docker
- run:
- run:
name: Building docker image
command: |
docker build -t ${DOCKHUB_ORGANISATION}/binary-static-webtrader:${CIRCLE_SHA1} .
- run:
- run:
name: Pushing Image to docker hub
command: |
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
Expand All @@ -73,7 +108,7 @@ commands:
description: "Deploy to k8s cluster"
steps:
- k8s/install-kubectl
- run:
- run:
name: Deploying to k8s cluster for service binary-webtrader
command: |
echo $CA_CRT | base64 --decode > ca.crt
Expand All @@ -87,14 +122,17 @@ jobs:
- git_checkout_from_cache
- npm_install
- build
- compress
- upload_artifact # uploading the built code to s3 to create a backup of key services separate from Kubernetes deployment
- upload_checksum # uploading compressed artifact checksum to cross match artifact fingerprint before actual deployment
- docker
- k8s_deploy

workflows:
release:
jobs:
- release:
filters:
branches:
only: /^master$/

context: binary-frontend-artifact-upload # using context to retrieve shared secret from circle ci