Skip to content

Commit

Permalink
CI/CD - Resolved Deployment Issue (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
dealako authored Jun 29, 2023
1 parent ba80d0e commit 047822d
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 209 deletions.
9 changes: 6 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ aliases:

defaults: &defaults
docker:
- image: circleci/node:14.18.0-browsers
- image: cimg/node:16.20.1-browsers
working_directory: /tmp/workspace

jobs:
Expand Down Expand Up @@ -176,8 +176,9 @@ jobs:
- run:
name: Invalidate Cache
command: |
echo "Running: yarn sls cloudfrontInvalidate --stage=\"${STAGE}\" --region=\"${AWS_REGION}\" "
SLS_DEBUG=* yarn sls cloudfrontInvalidate --stage="${STAGE}" --region="${AWS_REGION}" --verbose
# echo "Running: yarn sls cloudfrontInvalidate --stage=\"${STAGE}\" --region=\"${AWS_REGION}\" "
# SLS_DEBUG=* yarn sls cloudfrontInvalidate --stage="${STAGE}" --region="${AWS_REGION}" --verbose
aws --region ${AWS_REGION} --profile ${AWS_PROFILE} cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths "/*"
deployContributorConsoleDev:
<<: *deployFrontendAnchor
Expand All @@ -189,6 +190,7 @@ jobs:
STAGE: dev
ROOT_DOMAIN: dev.communitybridge.org
PRODUCT_DOMAIN: easycla.dev.communitybridge.org
DISTRIBUTION_ID: E4CMSMNLN6Y7T

deployContributorConsoleProd:
<<: *deployFrontendAnchor
Expand All @@ -200,6 +202,7 @@ jobs:
STAGE: prod
ROOT_DOMAIN: communitybridge.org
PRODUCT_DOMAIN: easycla.communitybridge.org
DISTRIBUTION_ID: E2IOYBQJKK668Q

workflows:
build_and_deploy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk-scan-edge-npm-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
- name: Yarn Version
run: yarn --version
- name: Yarn Install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk-scan-npm-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
- name: Yarn Version
run: yarn --version
- name: Yarn Install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yarn-scan-edge-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
- name: Setup
run: yarn install
- name: Yarn Audit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yarn-scan-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
- name: Setup
run: yarn install
- name: Yarn Audit
Expand Down
5 changes: 5 additions & 0 deletions edge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"lint": "./node_modules/.bin/eslint \"src/*.js\"",
"test": "./node_modules/.bin/jasmine --config=jasmine.json"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"dependencies": {
"eslint": "^7.1.0",
"graceful-fs": "^4.2.2",
Expand Down Expand Up @@ -37,6 +41,7 @@
"normalize-url": "^6.0.1",
"pac-resolver": "^5.0.0",
"path-parse": "^1.0.7",
"semver": "^7.5.3",
"set-getter": "^0.1.1",
"socket.io-parser": "^4.2.1",
"tar": "^6.1.9",
Expand Down
15 changes: 6 additions & 9 deletions edge/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2994,15 +2994,12 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"

semver@^5.5.0, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==

semver@^7.2.1:
version "7.3.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==
semver@^5.5.0, semver@^5.6.0, semver@^7.2.1, semver@^7.5.3:
version "7.5.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e"
integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==
dependencies:
lru-cache "^6.0.0"

serialize-javascript@^3.1.0:
version "3.1.0"
Expand Down
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"email": "support@linuxfoundation.org",
"url": "https://www.linuxfoundation.org/"
},
"version": "0.1.0",
"engines": {
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"version": "1.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand All @@ -24,17 +28,14 @@
"sls": "./node_modules/serverless/bin/serverless.js",
"eslint": "eslint \"./src/**/*.ts\"",
"eslint-fix": "eslint \"./src/**/*.ts\" --fix",
"deploy:cloudfront:dev": "SLS_DEBUG=* ROOT_DOMAIN=dev.communitybridge.org PRODUCT_DOMAIN=easycla.dev.communitybridge.org yarn sls deploy --stage='dev' --cloudfront=true --verbose",
"deploy:frontend:dev": "SLS_DEBUG=* ROOT_DOMAIN=dev.communitybridge.org PRODUCT_DOMAIN=easycla.dev.communitybridge.org yarn sls client deploy --stage='dev' --cloudfront=true --no-confirm --no-policy-change --no-config-change --verbose",
"deploy:invalidate:dev": "SLS_DEBUG=* ROOT_DOMAIN=dev.communitybridge.org PRODUCT_DOMAIN=easycla.dev.communitybridge.org yarn sls cloudfrontInvalidate --stage='dev' --region='us-east-1' --cloudfront='true' --verbose",
"deploy:cloudfront:dev": "SLS_DEBUG=* ROOT_DOMAIN=dev.communitybridge.org PRODUCT_DOMAIN=easycla.dev.communitybridge.org yarn sls deploy --stage='dev' --verbose",
"deploy:frontend:dev": "SLS_DEBUG=* ROOT_DOMAIN=dev.communitybridge.org PRODUCT_DOMAIN=easycla.dev.communitybridge.org yarn sls client deploy --stage='dev' --no-confirm --no-policy-change --no-config-change --verbose",
"remove:dev": "SLS_DEBUG=* yarn sls remove --stage='dev' --region='us-east-1' --verbose",
"deploy:cloudfront:staging": "SLS_DEBUG=* ROOT_DOMAIN=staging.communitybridge.org PRODUCT_DOMAIN=easycla.staging.communitybridge.org yarn sls deploy --stage='staging' --cloudfront=true --verbose",
"deploy:frontend:staging": "SLS_DEBUG=* ROOT_DOMAIN=staging.communitybridge.org PRODUCT_DOMAIN=easycla.staging.communitybridge.org yarn sls client deploy --stage='staging' --cloudfront=true --no-confirm --no-policy-change --no-config-change --verbose",
"deploy:invalidate:staging": "SLS_DEBUG=* ROOT_DOMAIN=staging.communitybridge.org PRODUCT_DOMAIN=easycla.staging.communitybridge.org yarn sls cloudfrontInvalidate --stage='staging' --region='us-east-1' --cloudfront='true' --verbose",
"deploy:cloudfront:staging": "SLS_DEBUG=* ROOT_DOMAIN=staging.communitybridge.org PRODUCT_DOMAIN=easycla.staging.communitybridge.org yarn sls deploy --stage='staging' --verbose",
"deploy:frontend:staging": "SLS_DEBUG=* ROOT_DOMAIN=staging.communitybridge.org PRODUCT_DOMAIN=easycla.staging.communitybridge.org yarn sls client deploy --stage='staging' --no-confirm --no-policy-change --no-config-change --verbose",
"remove:staging": "SLS_DEBUG=* yarn sls remove --stage='staging' --region='us-east-1' --verbose",
"deploy:cloudfront:prod": "SLS_DEBUG=* ROOT_DOMAIN=communitybridge.org PRODUCT_DOMAIN=easycla.communitybridge.org yarn sls deploy --stage='prod' --cloudfront=true --verbose",
"deploy:frontend:prod": "SLS_DEBUG=* ROOT_DOMAIN=communitybridge.org PRODUCT_DOMAIN=easycla.communitybridge.org yarn sls client deploy --stage='prod' --cloudfront=true --no-confirm --no-policy-change --no-config-change --verbose",
"deploy:invalidate:prod": "SLS_DEBUG=* ROOT_DOMAIN=communitybridge.org PRODUCT_DOMAIN=easycla.communitybridge.org yarn sls cloudfrontInvalidate --stage='prod' --region='us-east-1' --cloudfront='true' --verbose",
"deploy:cloudfront:prod": "SLS_DEBUG=* ROOT_DOMAIN=communitybridge.org PRODUCT_DOMAIN=easycla.communitybridge.org yarn sls deploy --stage='prod' --verbose",
"deploy:frontend:prod": "SLS_DEBUG=* ROOT_DOMAIN=communitybridge.org PRODUCT_DOMAIN=easycla.communitybridge.org yarn sls client deploy --stage='prod' --no-confirm --no-policy-change --no-config-change --verbose",
"remove:prod": "SLS_DEBUG=* yarn sls remove --stage='prod' --region='us-east-1' --verbose",
"prebuild:dev": "STAGE_ENV=dev node ./src/app/config/scripts/prefetch-ssm.js",
"prebuild:staging": "STAGE_ENV=staging node ./src/app/config/scripts/prefetch-ssm.js",
Expand Down Expand Up @@ -88,13 +89,12 @@
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"serverless": "^3.25.1",
"serverless-cloudfront-invalidate": "^1.4.0",
"serverless-finch": "^4.0.0",
"serverless": "^3.33.0",
"serverless-finch": "^4.0.3",
"serverless-lambda-version": "^0.1.2",
"serverless-layers": "^1.4.3",
"serverless-layers": "^2.6.1",
"serverless-plugin-tracing": "^2.0.0",
"serverless-prune-plugin": "^2.0.1",
"serverless-prune-plugin": "^2.0.2",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.1.6"
Expand Down Expand Up @@ -128,6 +128,7 @@
"netmask": "^2.0.1",
"node-forge": "^1.0.0",
"pac-resolver": "^5.0.0",
"semver": "^7.5.3",
"semver-regex": "^3.1.4",
"set-value": "^4.0.2",
"simple-git": "^3.16.0",
Expand Down
14 changes: 7 additions & 7 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MIT

service: easycla-contributor-console-ui
frameworkVersion: '^3.25.1'
frameworkVersion: '^3.33.0'
configValidationMode: warn

package:
Expand Down Expand Up @@ -56,7 +56,7 @@ plugins:
# Automatically versions and updates the lambda@edge function
#- serverless-lambda-version
# Automatically invalidates cloudfront after frontend bucket is deployed
- serverless-cloudfront-invalidate
#- serverless-cloudfront-invalidate
- serverless-plugin-tracing
- serverless-prune-plugin
- '@silvermine/serverless-plugin-cloudfront-lambda-edge'
Expand Down Expand Up @@ -93,11 +93,11 @@ custom:
other: 'invalid - value'

# CloudFront invalidation plugin configuration
cloudfrontInvalidate:
# Grab the distribution ID key from the output section
distributionIdKey: 'CloudFrontDistributionId'
items: # one or more paths required
- '/*'
#cloudfrontInvalidate:
# # Grab the distribution ID key from the output section
# distributionIdKey: 'CloudFrontDistributionId'
# items: # one or more paths required
# - '/*'

prune:
automatic: true
Expand Down
Loading

0 comments on commit 047822d

Please sign in to comment.