Skip to content

Commit

Permalink
feat: AWS linux 2 migration of webapp environment (#14976)
Browse files Browse the repository at this point in the history
* feat: aws migration QA env(SQSERVICES-1965)

* feat: update nginx file

* fix: update env name to resolve application name issue

* fix: add Procfile

* refactor: delete old Profile

* feat: copy assets

* fix: delete fs.copysysnc

* fix: copy Procfile script

* fix: add Procfile inside zip.js

* feat: update qa env name

* Update .github/workflows/test_build_deploy.yml

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

* Update .github/workflows/test_build_deploy.yml

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

* Update .github/workflows/test_build_deploy.yml

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

* Update .github/workflows/test_build_deploy.yml

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

* Update .github/workflows/test_build_deploy.yml

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

* fix: make new Elastic Beanstalk configuration backward compatible

* fix: remove comma

* fix: create different namespace for new and old configuration

* feat: backward compaitable configuration

* feat: rename config file

* fix: delete old file

* fix: print PLATFORM_BRANCH

* fix: revert config change

* fix: delete unused code

* feat: migrate to new al2 staging env

* refactor: delete unused code

* feat: add new branch in the list

* feat: add new env to deploy

* fix: remove auto deploy of staging new env

* feat: dev env al2 migration

* feat: migrate edge to amazon al2

* feat: migrate prod env to amazon al2

* feat: migrate master and avs

* fix: remove al2 from auto deploy

* chore: small updates to prepare for merge

* chore: cleaning up things

---------

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>
Co-authored-by: Timothy Le Bon <tlebon@gmail.com>
  • Loading branch information
3 people authored Jun 20, 2023
1 parent b2b4075 commit d083926
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .elasticbeanstalk/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
branch-defaults:
dev:
environment: wire-webapp-dev
environment: wire-webapp-dev-al2
master:
environment: wire-webapp-master
environment: wire-webapp-master-al2
deploy:
artifact: server/dist/s3/ebs.zip
global:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-to-test-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
required: true
type: choice
options:
- wire-webapp-qa
- wire-webapp-edge
- wire-webapp-mls
- wire-webapp-qa-al2-migration
- wire-webapp-edge-al2
- wire-webapp-mls-al2

concurrency:
group: ci-${{ github.ref }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ jobs:
key: '${{github.ref}}'
map: |
{
"edge": { "dev_env": "wire-webapp-edge" },
"dev": { "dev_env": "wire-webapp-dev" },
"master": { "dev_env": "wire-webapp-master" }
"edge": { "dev_env": "wire-webapp-edge-al2" },
"dev": { "dev_env": "wire-webapp-dev-al2" },
"master": { "dev_env": "wire-webapp-master-al2" }
}
- uses: kanga333/variable-mapper@master
Expand All @@ -104,8 +104,8 @@ jobs:
key: '${{env.TAG}}'
map: |
{
"production": { "prod_env": "wire-webapp-prod" },
"staging": { "prod_env": "wire-webapp-staging" }
"production": { "prod_env": "wire-webapp-prod-al2" },
"staging": { "prod_env": "wire-webapp-staging-al2" }
}
- name: Build
Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: npm run start:prod
5 changes: 4 additions & 1 deletion bin/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ const S3_PATH = path.resolve(ROOT_PATH, 'server/dist/s3');

archive.file(path.join(SERVER_PATH, 'package.json'), {name: 'package.json'});
archive.file(path.join(ROOT_PATH, '.env.defaults'), {name: '.env.defaults'});
archive.file(path.join(ROOT_PATH, 'Procfile'), {name: 'Procfile'});
archive.directory(DIST_PATH, false);

fs.mkdirSync(S3_PATH);
if (!fs.existsSync(S3_PATH)) {
fs.mkdirSync(S3_PATH);
}
const output = fs.createWriteStream(path.join(S3_PATH, 'ebs.zip'));

archive.pipe(output);
Expand Down
6 changes: 2 additions & 4 deletions server/.ebextensions/00-environment.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
option_settings:
aws:elasticbeanstalk:container:nodejs:
GzipCompression: true
NodeCommand: "npm run start:prod"
ProxyServer: nginx
aws:elasticbeanstalk:environment:proxy:
ProxyServer: nginx
7 changes: 7 additions & 0 deletions server/.platform/nginx/conf.d/proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
large_client_header_buffers 4 32k;
fastcgi_buffers 16 32k;
fastcgi_buffer_size 32k;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
server_tokens off;

0 comments on commit d083926

Please sign in to comment.