This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from tamedia-pmd/develop
Merge changes from develop to master for prod release
- Loading branch information
Showing
27 changed files
with
13,122 additions
and
1,066 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
build: | ||
docker: | ||
# circleci node image version | ||
- image: circleci/node:12 | ||
|
||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package-lock.json" }} | ||
|
||
- run: | ||
name: Install Dependencies | ||
command: npm install | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package-lock.json" }} | ||
|
||
- run: | ||
name: Build floors | ||
command: npm run build | ||
|
||
- run: | ||
name: Run tests | ||
command: npm test | ||
|
||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
- node_modules/ | ||
- config/ | ||
- package.json | ||
deploy: | ||
docker: | ||
# circleci node image version | ||
- image: circleci/node:12 | ||
|
||
environment: | ||
BASH_ENV: bash_env | ||
|
||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: ~/project | ||
|
||
- run: | ||
name: Export Stage name into BASH_ENV | ||
command: | | ||
chmod u+x ~/project/.circleci/helpers/setStageName.sh | ||
echo "export STAGE=`~/project/.circleci/helpers/setStageName.sh`" >> $BASH_ENV | ||
- run: | ||
name: Prepare deployment file | ||
command: | | ||
echo "deploying to $STAGE" | ||
chmod u+x ~/project/.circleci/helpers/setEnvironmentVariables.sh | ||
./.circleci/helpers/setEnvironmentVariables.sh | ||
- run: | ||
name: Set AWS credentials based on stage | ||
command: | | ||
echo "Setting $STAGE-credentials" | ||
chmod u+x ~/project/.circleci/helpers/setAwsCredentials.sh | ||
./.circleci/helpers/setAwsCredentials.sh | ||
- run: | ||
name: Deploy to AWS Lambda | ||
command: | | ||
if [ $STAGE == 'prod' ] | ||
then | ||
npm run deploy-prod | ||
else | ||
npm run deploy | ||
fi | ||
workflows: | ||
version: 2 | ||
staging-build: | ||
jobs: | ||
- build: | ||
name: build stage | ||
filters: | ||
branches: | ||
only: /(^develop$)/ | ||
- deploy: | ||
name: deploy stage | ||
requires: | ||
- build stage | ||
|
||
un-tagged-build: | ||
jobs: | ||
- build: | ||
filters: | ||
tags: | ||
ignore: /(^v.*)/ | ||
branches: | ||
ignore: /(^develop$)/ | ||
tagged-build: | ||
jobs: | ||
- build: | ||
name: build tag | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v.*/ | ||
- deploy: | ||
name: deploy prod | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
requires: | ||
- build tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
case "$STAGE" in | ||
"dev" ) ./node_modules/.bin/sls config credentials --provider aws --key $AWS_ACCESS_KEY_ID_DEV --secret $AWS_SECRET_ACCESS_KEY_DEV --overwrite && exit 0;; | ||
"prod" ) ./node_modules/.bin/sls config credentials --provider aws --key $AWS_ACCESS_KEY_ID_PROD --secret $AWS_SECRET_ACCESS_KEY_PROD --overwrite && exit 0;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
cd ~/project/config | ||
|
||
sed -i "s~###SLACK_SIGNING_SECRET###~${SLACK_SIGNING_SECRET_DEV}~" config.dev.json | ||
sed -i "s~###SLACK_VERIFICATION_TOKEN###~${SLACK_VERIFICATION_TOKEN_DEV}~" config.dev.json | ||
sed -i "s~###SLACK_BOT_USER_OAUTH_ACCESS_TOKEN###~${SLACK_BOT_USER_OAUTH_ACCESS_TOKEN_DEV}~" config.dev.json | ||
|
||
|
||
sed -i "s~###SLACK_SIGNING_SECRET###~${SLACK_SIGNING_SECRET_PROD}~" config.prod.json | ||
sed -i "s~###SLACK_VERIFICATION_TOKEN###~${SLACK_VERIFICATION_TOKEN_PROD}~" config.prod.json | ||
sed -i "s~###SLACK_BOT_USER_OAUTH_ACCESS_TOKEN###~${SLACK_BOT_USER_OAUTH_ACCESS_TOKEN_PROD}~" config.prod.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
STAGE="" | ||
|
||
case "$CIRCLE_BRANCH" in | ||
"master" ) echo "prod" && exit 0;; | ||
"develop" ) echo "dev" && exit 0;; | ||
esac | ||
case "$CIRCLE_TAG" in | ||
v* ) echo "prod" && exit 0;; | ||
* ) echo "setStageNameError" && exit 1;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,4 @@ jspm_packages | |
|
||
coverage | ||
|
||
config | ||
|
||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.