Skip to content

Commit

Permalink
Merge branch 'develop' into graceful-workers
Browse files Browse the repository at this point in the history
* develop:
  chore: replace local module with shared folder (#1144)
  1.24.0
  Backend tests for campaign middleware and sms campaign routes (#1146)
  chore: upgrade dependencies (#1180)
  • Loading branch information
lamkeewei committed May 27, 2021
2 parents b8a4df2 + 06439df commit cf5ad0d
Show file tree
Hide file tree
Showing 65 changed files with 1,270 additions and 19,233 deletions.
21 changes: 17 additions & 4 deletions .travis.yml
Expand Up @@ -17,8 +17,10 @@ jobs:
- cd $TRAVIS_BUILD_DIR/backend
- npx lockfile-lint --type npm --path package-lock.json -o "https:" -o "file:" --allowed-hosts npm
install:
- npm ci
- cd $TRAVIS_BUILD_DIR/shared && npm ci
- cd $TRAVIS_BUILD_DIR/backend && npm ci
script:
- npm run build
- npm run lint-no-fix
- npm run test
before_deploy:
Expand Down Expand Up @@ -73,8 +75,10 @@ jobs:
- cd $TRAVIS_BUILD_DIR/worker
- npx lockfile-lint --type npm --path package-lock.json -o "https:" -o "file:" --allowed-hosts npm
install:
- npm ci
- cd $TRAVIS_BUILD_DIR/shared && npm ci
- cd $TRAVIS_BUILD_DIR/worker && npm ci
script:
- npm run build
- npm run lint-no-fix
before_deploy:
- cd $TRAVIS_BUILD_DIR/worker && ./before-deploy.sh
Expand All @@ -93,15 +97,24 @@ jobs:
condition: "$DEPLOY_WORKER = true"
- name: frontend
before_install:
- cd $TRAVIS_BUILD_DIR/shared && npm install
- cd $TRAVIS_BUILD_DIR/frontend
install:
- npm install
script:
- CI=false npm run build
- npm run test
- npx lockfile-lint --type npm --path package-lock.json -o "https:" -o "file:" --allowed-hosts npm
- npm run compile
- npm run lint-no-fix
- CI=false npm run build
- name: shared
before_install:
- cd $TRAVIS_BUILD_DIR/shared
install:
- npm install
script:
- npm run build
- npm run test
- npx lockfile-lint --type npm --path package-lock.json -o "https:" -o "file:" --allowed-hosts npm
- name: serverless-unsubscribe-digest
before_install:
- cd $TRAVIS_BUILD_DIR/serverless/unsubscribe-digest
Expand Down
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -191,6 +191,10 @@ env:
$ git checkout develop
$ git checkout -b release-v1.7.0

# Bump shared module version
$ cd ../ && cd shared/
$ npm version minor

# Bump frontend version
$ cd frontend/
$ npm version minor
Expand Down
4 changes: 2 additions & 2 deletions amplify.yml
Expand Up @@ -23,8 +23,8 @@ frontend:
export REACT_APP_BACKEND_URL=${BACKEND_URL_STAGING} &&
export REACT_APP_SENTRY_ENVIRONMENT="staging";
fi
- cd frontend
- npm ci
- cd shared && npm ci && cd ..
- cd frontend && npm ci
- export REACT_APP_SENTRY_RELEASE=$(npm run --silent get-sentry-release)
build:
commands:
Expand Down
3 changes: 2 additions & 1 deletion backend/Dockerfile
Expand Up @@ -12,7 +12,8 @@ RUN aws configure set default.region ap-southeast-1

WORKDIR /usr/home/postmangovsg

COPY modules ../modules
COPY shared ../shared
RUN cd ../shared && npm ci && cd ../postmangovsg

COPY ./package* ./
RUN npm ci
Expand Down
2 changes: 1 addition & 1 deletion backend/before-deploy.sh
@@ -1,7 +1,7 @@
#!/bin/bash

# Copy local module
cp -R ../modules ./
cp -R ../shared ./
# Replace the secret id according to the right branch
# Using '#' as a delimiter for SED instead of '/'
# '/' will clash with secret id names, eg: 'staging/eb/postmangovsg-staging-40ffadb'
Expand Down
1 change: 1 addition & 0 deletions backend/jest.config.js
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'@email/(.*)': '<rootDir>/src/email/$1',
'@telegram/(.*)': '<rootDir>/src/telegram/$1',
'@test-utils/(.*)': '<rootDir>/src/test-utils/$1',
'@shared/(.*)': '<rootDir>/../shared/src/$1',
},
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
Expand Down

0 comments on commit cf5ad0d

Please sign in to comment.