From 963795301f8786085ffc3c6cd320670b37704895 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 20:43:04 +0800 Subject: [PATCH 01/29] cleanup and add comments for better documentation --- .travis.yml | 55 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 72f8365a..8b3cb7c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,41 @@ -sudo: required +# Variables needed for this script are: + +# Case 1: Stored on Travis Settings + # For all environments: + # - DOCKER_CI_REPO_NAME + # - DOCKER_USERNAME + # - DOCKER_PASSWORD + + #For dev environment: + # - AWS_ACCOUNT_USER_ID_DEV + # - AWS_ACCOUNT_SECRET_DEV + # - AWS_PROFILE_DEV + + #For Prod environment: + # - AWS_ACCOUNT_USER_ID_PROD + # - AWS_ACCOUNT_SECRET_PROD + # - AWS_PROFILE_PROD + + #For Demo environment: + # - AWS_ACCOUNT_USER_ID_DEMO + # - AWS_ACCOUNT_SECRET_DEMO + # - AWS_PROFILE_DEMO + +# Case 2: Created when Travis CI runs + # - IMAGE_TAG language: node_js + node_js: - lts/* +env: + global: + - COMMIT=${TRAVIS_COMMIT::7} + #Add IMAGE_TAG variable to build docker image + - IMAGE_TAG=${COMMIT} + before_install: - # Removed command as pyenv is no longer found during deploy - #- pyenv global 2.7.14 # For removing SNIMissingWarning warnings - curl https://install.meteor.com | /bin/sh - export PATH="$HOME/.meteor:$PATH" - pip install --user awscli @@ -27,24 +56,24 @@ script: matrix: include: - - env: DEPLOY=none + - env: DEPLOY=dev - env: DEPLOY=demo if: tag IS present deploy: provider: script - skip_cleanup: true - script: AWS_ACCESS_KEY_ID=$AWS_915001051872_ID AWS_SECRET_ACCESS_KEY=$AWS_915001051872_SECRET ./deploy.sh -d + script: TRAVIS_PROFILE=$AWS_PROFILE_DEMO AWS_ACCESS_KEY_ID=$AWS_ACCOUNT_USER_ID_DEMO AWS_SECRET_ACCESS_KEY=$AWS_ACCOUNT_SECRET_DEMO AWS_REGION=$AWS_DEFAULT_REGION ./deploy.sh -d on: + branch: master tags: true - env: DEPLOY=prod if: tag IS present deploy: provider: script - skip_cleanup: true - script: AWS_ACCESS_KEY_ID=$AWS_192458993663_ID AWS_SECRET_ACCESS_KEY=$AWS_192458993663_SECRET ./deploy.sh -p && AWS_ACCESS_KEY_ID=$AWS_192458993663_ID AWS_SECRET_ACCESS_KEY=$AWS_192458993663_SECRET aws cloudfront create-invalidation --distribution-id E173XT6X8V4A18 --paths '/*' + # TODO - Distribution-id uses a hardcoded value + # This will ONLY work for the main Unee-T installation but no other Unee-T Installation + # This is a problem we need to fix + script: TRAVIS_PROFILE=$AWS_PROFILE_PROD AWS_ACCESS_KEY_ID=$AWS_ACCOUNT_USER_ID_PROD AWS_SECRET_ACCESS_KEY=$AWS_ACCOUNT_SECRET_PROD AWS_REGION=$AWS_DEFAULT_REGION ./deploy.sh -p && AWS_ACCESS_KEY_ID=$AWS_ACCOUNT_USER_ID_PROD AWS_SECRET_ACCESS_KEY=$AWS_ACCOUNT_SECRET_PROD aws cloudfront create-invalidation --distribution-id E173XT6X8V4A18 --paths '/*' + # END - TODO - Distribution-id uses a hardcoded value on: - tags: true - -env: - global: - - COMMIT=${TRAVIS_COMMIT::7} + branch: master + tags: true \ No newline at end of file From 4bcfaf061e760142c7d566bafcdaaedccabb3162 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 21:11:38 +0800 Subject: [PATCH 02/29] force Travis CI to use Node js v8 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8b3cb7c3..d2a5b5f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,8 @@ language: node_js node_js: - - lts/* + #- lts/* + - '8' env: global: From a42702cd4d3480872d78ce4959a3f814544ee788 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 21:16:36 +0800 Subject: [PATCH 03/29] upgrade to node js 12 and bcrypt ^3.0.6 --- .travis.yml | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2a5b5f7..8b3cb7c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,7 @@ language: node_js node_js: - #- lts/* - - '8' + - lts/* env: global: diff --git a/package.json b/package.json index 91317c63..ca7345bd 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@babel/runtime": "^7.1.5", - "bcrypt": "^1.0.3", + "bcrypt": "^3.0.6", "body-parser": "^1.18.2", "classnames": "^2.2.5", "hammerjs": "^2.0.8", From 6965a0cf94be601e7a6c6657f5b1dd252cd73cfc Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 21:24:38 +0800 Subject: [PATCH 04/29] upgrade Dockerfile to use Node js 12 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d757b7c2..892ef491 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:8.15.1 AS builder +FROM node:12 AS builder ENV BUNDLE_DIR /home/node/bundle ENV SRC_DIR /home/node/src @@ -18,7 +18,7 @@ RUN meteor npm install --production RUN meteor build --server-only --directory $BUNDLE_DIR RUN cd ${BUNDLE_DIR}/bundle/programs/server && npm install -FROM node:8.15.1-slim +FROM node:12-slim ENV APP_DIR /home/node/app ENV BUNDLE_DIR /home/node/bundle From 5d2eeed56fc0494d1ced767b24d1d059f9f8e0b8 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 21:45:17 +0800 Subject: [PATCH 05/29] remove deprecated packages from `package-lock.json` --- Dockerfile | 2 -- package-lock.json | 45 --------------------------------------------- 2 files changed, 47 deletions(-) diff --git a/Dockerfile b/Dockerfile index 892ef491..896bc5a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,9 +28,7 @@ USER node:node COPY --from=builder $BUNDLE_DIR $APP_DIR WORKDIR $APP_DIR/bundle - ENV PORT 3000 EXPOSE 3000 - CMD ["node", "./main.js"] diff --git a/package-lock.json b/package-lock.json index b9553b1f..b5cae220 100644 --- a/package-lock.json +++ b/package-lock.json @@ -501,15 +501,6 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", "dev": true }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "dev": true, - "requires": { - "hoek": "2.x.x" - } - }, "bowser": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.8.1.tgz", @@ -797,15 +788,6 @@ "which": "^1.2.9" } }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", - "dev": true, - "requires": { - "boom": "2.x.x" - } - }, "css-in-js-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-2.0.0.tgz", @@ -1943,18 +1925,6 @@ "pinkie-promise": "^2.0.0" } }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", - "dev": true, - "requires": { - "boom": "2.x.x", - "cryptiles": "2.x.x", - "hoek": "2.x.x", - "sntp": "1.x.x" - } - }, "history": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/history/-/history-4.6.3.tgz", @@ -1967,12 +1937,6 @@ "warning": "^3.0.0" } }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true - }, "hoist-non-react-statics": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.2.2.tgz", @@ -4913,15 +4877,6 @@ } } }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "dev": true, - "requires": { - "hoek": "2.x.x" - } - }, "source-map": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", From 3ec636f9b452b6836da68836984ca33efbd3708d Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:02:12 +0800 Subject: [PATCH 06/29] list all the meteor package installed --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8b3cb7c3..0d085de2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,8 @@ install: - meteor npm install script: + # List all install package for easier debugging + - meteor npm ls - npm t matrix: From 05301e207b2b46d594c39ec056c403ec4769ef87 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:13:19 +0800 Subject: [PATCH 07/29] try to do automatic updates to flagged issues --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0d085de2..40b98b7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,10 +50,15 @@ cache: install: - meteor npm install + # update Meteor to the latest version + - meteor update + # fix Errors and vulnerabilities + - npm audit fix script: # List all install package for easier debugging - - meteor npm ls + #- meteor npm ls + # Test that our code is working as expected on that image. - npm t matrix: From ed9a14ed8562ad7afb33fc0d5347c0ea3642f4cd Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:23:14 +0800 Subject: [PATCH 08/29] force update of all packages --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40b98b7e..abd381f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,10 +50,10 @@ cache: install: - meteor npm install - # update Meteor to the latest version - - meteor update # fix Errors and vulnerabilities - npm audit fix + # update Meteor to the latest version + - meteor update --all-package script: # List all install package for easier debugging From 2c284cc3660fd17f9a30603e9c8aeefbed91a55f Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:27:04 +0800 Subject: [PATCH 09/29] fix typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index abd381f3..1033a00b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ install: # fix Errors and vulnerabilities - npm audit fix # update Meteor to the latest version - - meteor update --all-package + - meteor update --all-packages script: # List all install package for easier debugging From e98384d646ae25a58f01383377dc8eface82c8cc Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:35:20 +0800 Subject: [PATCH 10/29] add some missing modules --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1033a00b..5e73f011 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,8 +52,13 @@ install: - meteor npm install # fix Errors and vulnerabilities - npm audit fix - # update Meteor to the latest version + # Update Meteor and all packages - meteor update --all-packages + # update the Meteor packages (but NOT meteor) to the latest version + # - meteor update --packages-only + # Install missing packages + - meteor npm install --save @babel/runtime react + - meteor npm install --save @babel/runtime script: # List all install package for easier debugging From 76988e68435c79ae81e53298927784ab67498c51 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:37:45 +0800 Subject: [PATCH 11/29] only fire AWS code build if we are on the Master branch --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5e73f011..961a12b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,10 @@ script: matrix: include: + - env: DEPLOY=none - env: DEPLOY=dev + deploy: + branch: master - env: DEPLOY=demo if: tag IS present deploy: From 9ba7177463e82640983bd2091ff5d52b9571d6b0 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:43:44 +0800 Subject: [PATCH 12/29] install more missing dependencies --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 961a12b7..cd60fe6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,13 +52,14 @@ install: - meteor npm install # fix Errors and vulnerabilities - npm audit fix + # Install missing packages + - meteor npm install ajv + - meteor npm install --save @babel/runtime react + - meteor npm install --save @babel/runtime # Update Meteor and all packages - meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version # - meteor update --packages-only - # Install missing packages - - meteor npm install --save @babel/runtime react - - meteor npm install --save @babel/runtime script: # List all install package for easier debugging From a0a6d1aabca9f72e618f394e6f307b4c4ae0eb17 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:47:56 +0800 Subject: [PATCH 13/29] fix typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cd60fe6f..9416bd21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ install: # fix Errors and vulnerabilities - npm audit fix # Install missing packages - - meteor npm install ajv + - npm install ajv - meteor npm install --save @babel/runtime react - meteor npm install --save @babel/runtime # Update Meteor and all packages From 2102f2d18c1f0d1943cd84ec3181941dc8a99528 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:52:52 +0800 Subject: [PATCH 14/29] do not trigger 2 concurren Travis build --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9416bd21..82a993f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,10 +69,7 @@ script: matrix: include: - - env: DEPLOY=none - env: DEPLOY=dev - deploy: - branch: master - env: DEPLOY=demo if: tag IS present deploy: From c6f74c03c96a04a9892fba98acb8ebc6bed1ab86 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 22:57:29 +0800 Subject: [PATCH 15/29] add missing packages --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82a993f3..70e6893d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,16 +50,17 @@ cache: install: - meteor npm install - # fix Errors and vulnerabilities - - npm audit fix # Install missing packages - npm install ajv - meteor npm install --save @babel/runtime react - meteor npm install --save @babel/runtime + - meteor npm install jquery # Update Meteor and all packages - meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version # - meteor update --packages-only + # fix Errors and vulnerabilities + - npm audit fix script: # List all install package for easier debugging From d4204e8a6298951f284368158ca38f6b9b8fd99a Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 23:04:25 +0800 Subject: [PATCH 16/29] add missing packages --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 70e6893d..b36de588 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,7 @@ install: - meteor npm install --save @babel/runtime react - meteor npm install --save @babel/runtime - meteor npm install jquery + - meteor npm install --save react # Update Meteor and all packages - meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version From c5c61c89ce55a709b1436ef367abb52a15baf02e Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 23:12:18 +0800 Subject: [PATCH 17/29] make sure dependent packages are also updated --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b36de588..5b5d10c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,8 @@ install: - meteor npm install --save react # Update Meteor and all packages - meteor update --all-packages + # We are running this twice since there are chained dependencies + - meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version # - meteor update --packages-only # fix Errors and vulnerabilities From 5d8a70b37ce732b163408a86c0da4ec77379e673 Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 23:14:19 +0800 Subject: [PATCH 18/29] update modules but do NOT update Meteor --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b5d10c1..d3ad781d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,11 +57,13 @@ install: - meteor npm install jquery - meteor npm install --save react # Update Meteor and all packages - - meteor update --all-packages + #- meteor update --all-packages # We are running this twice since there are chained dependencies - - meteor update --all-packages + #- meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version - # - meteor update --packages-only + - meteor update --packages-only + # We are running this twice since there are chained dependencies + - meteor update --packages-only # fix Errors and vulnerabilities - npm audit fix From f553ae955679f7b911c714ba92a3abb5f1f63cbb Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 23:32:15 +0800 Subject: [PATCH 19/29] Dockerimage file forced to use node.js 8.15.1 --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 896bc5a9..d757b7c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12 AS builder +FROM node:8.15.1 AS builder ENV BUNDLE_DIR /home/node/bundle ENV SRC_DIR /home/node/src @@ -18,7 +18,7 @@ RUN meteor npm install --production RUN meteor build --server-only --directory $BUNDLE_DIR RUN cd ${BUNDLE_DIR}/bundle/programs/server && npm install -FROM node:12-slim +FROM node:8.15.1-slim ENV APP_DIR /home/node/app ENV BUNDLE_DIR /home/node/bundle @@ -28,7 +28,9 @@ USER node:node COPY --from=builder $BUNDLE_DIR $APP_DIR WORKDIR $APP_DIR/bundle + ENV PORT 3000 EXPOSE 3000 + CMD ["node", "./main.js"] From 1e32279f6a754b7d4261620b4282942e4c69932c Mon Sep 17 00:00:00 2001 From: franck Date: Mon, 10 Feb 2020 23:35:50 +0800 Subject: [PATCH 20/29] revert change from https://github.com/unee-t/frontend/pull/905/commits/5d2eeed56fc0494d1ced767b24d1d059f9f8e0b8 --- package-lock.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/package-lock.json b/package-lock.json index b5cae220..b9553b1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -501,6 +501,15 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", "dev": true }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, "bowser": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.8.1.tgz", @@ -788,6 +797,15 @@ "which": "^1.2.9" } }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.x.x" + } + }, "css-in-js-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-2.0.0.tgz", @@ -1925,6 +1943,18 @@ "pinkie-promise": "^2.0.0" } }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + } + }, "history": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/history/-/history-4.6.3.tgz", @@ -1937,6 +1967,12 @@ "warning": "^3.0.0" } }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, "hoist-non-react-statics": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.2.2.tgz", @@ -4877,6 +4913,15 @@ } } }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, "source-map": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", From e617551ad6e5a69c1b180cc7a098c31b4a781384 Mon Sep 17 00:00:00 2001 From: franck Date: Tue, 11 Feb 2020 09:50:31 +0800 Subject: [PATCH 21/29] comment out package upgrades to get Travic CI tests to pass --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3ad781d..e45b23f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,21 +51,21 @@ cache: install: - meteor npm install # Install missing packages - - npm install ajv - - meteor npm install --save @babel/runtime react - - meteor npm install --save @babel/runtime - - meteor npm install jquery - - meteor npm install --save react +# - npm install ajv +# - meteor npm install --save @babel/runtime react +# - meteor npm install --save @babel/runtime +# - meteor npm install jquery +# - meteor npm install --save react # Update Meteor and all packages #- meteor update --all-packages # We are running this twice since there are chained dependencies #- meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version - - meteor update --packages-only +# - meteor update --packages-only # We are running this twice since there are chained dependencies - - meteor update --packages-only +# - meteor update --packages-only # fix Errors and vulnerabilities - - npm audit fix +# - npm audit fix script: # List all install package for easier debugging From 9bd82d029275a3da83b8a7804a5991b9188c43bc Mon Sep 17 00:00:00 2001 From: franck Date: Tue, 11 Feb 2020 10:31:21 +0800 Subject: [PATCH 22/29] try to minimize erros in the build - See Issue #906 --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index e45b23f3..117e9b39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,11 +51,11 @@ cache: install: - meteor npm install # Install missing packages -# - npm install ajv -# - meteor npm install --save @babel/runtime react -# - meteor npm install --save @babel/runtime -# - meteor npm install jquery -# - meteor npm install --save react + - npm install ajv + - meteor npm install --save @babel/runtime react + - meteor npm install --save @babel/runtime + - meteor npm install jquery + - meteor npm install --save react # Update Meteor and all packages #- meteor update --all-packages # We are running this twice since there are chained dependencies @@ -63,9 +63,9 @@ install: # update the Meteor packages (but NOT meteor) to the latest version # - meteor update --packages-only # We are running this twice since there are chained dependencies -# - meteor update --packages-only + - meteor update --packages-only # fix Errors and vulnerabilities -# - npm audit fix + - npm audit fix script: # List all install package for easier debugging From 168e1563d52944bc3763f36be316e8b72e333b2b Mon Sep 17 00:00:00 2001 From: franck Date: Tue, 11 Feb 2020 11:15:02 +0800 Subject: [PATCH 23/29] try to reinstall all the packages without the cache --- .travis.yml | 7 ++++--- package-lock.json => package-lock.json.disable | 0 2 files changed, 4 insertions(+), 3 deletions(-) rename package-lock.json => package-lock.json.disable (100%) diff --git a/.travis.yml b/.travis.yml index 117e9b39..ae85f780 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,11 +44,12 @@ before_install: https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest && chmod +x $HOME/.local/bin/ecs-cli -cache: - directories: - - node_modules +#cache: +# directories: +# - node_modules install: + - npm cache verify - meteor npm install # Install missing packages - npm install ajv diff --git a/package-lock.json b/package-lock.json.disable similarity index 100% rename from package-lock.json rename to package-lock.json.disable From f5b4d2a9aa8866eec8066e9e0539963555542a99 Mon Sep 17 00:00:00 2001 From: franck Date: Wed, 12 Feb 2020 10:32:08 +0800 Subject: [PATCH 24/29] get Travis to build a standard ubuntu image (NOT node.js) --- .travis.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae85f780..5fd8adb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,10 +24,10 @@ # Case 2: Created when Travis CI runs # - IMAGE_TAG -language: node_js +#language: node_js -node_js: - - lts/* +#node_js: +# - lts/* env: global: @@ -49,14 +49,14 @@ before_install: # - node_modules install: - - npm cache verify + - meteor npm cache verify - meteor npm install # Install missing packages - - npm install ajv - - meteor npm install --save @babel/runtime react - - meteor npm install --save @babel/runtime - - meteor npm install jquery - - meteor npm install --save react +# - npm install ajv +# - meteor npm install --save @babel/runtime react +# - meteor npm install --save @babel/runtime +# - meteor npm install jquery +# - meteor npm install --save react # Update Meteor and all packages #- meteor update --all-packages # We are running this twice since there are chained dependencies @@ -64,9 +64,9 @@ install: # update the Meteor packages (but NOT meteor) to the latest version # - meteor update --packages-only # We are running this twice since there are chained dependencies - - meteor update --packages-only +# - meteor update --packages-only # fix Errors and vulnerabilities - - npm audit fix +# - meteor npm audit fix script: # List all install package for easier debugging From 633b2afc5af329382c6fac5220a1e79560b5a96f Mon Sep 17 00:00:00 2001 From: franck Date: Wed, 12 Feb 2020 10:40:05 +0800 Subject: [PATCH 25/29] tidy up and make sure we run the tests inside meteor --- .travis.yml | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5fd8adb4..59601b00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,11 +24,6 @@ # Case 2: Created when Travis CI runs # - IMAGE_TAG -#language: node_js - -#node_js: -# - lts/* - env: global: - COMMIT=${TRAVIS_COMMIT::7} @@ -44,35 +39,21 @@ before_install: https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest && chmod +x $HOME/.local/bin/ecs-cli -#cache: -# directories: -# - node_modules - install: - meteor npm cache verify - meteor npm install - # Install missing packages -# - npm install ajv -# - meteor npm install --save @babel/runtime react -# - meteor npm install --save @babel/runtime -# - meteor npm install jquery -# - meteor npm install --save react # Update Meteor and all packages #- meteor update --all-packages - # We are running this twice since there are chained dependencies - #- meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version -# - meteor update --packages-only + #- meteor update --packages-only # We are running this twice since there are chained dependencies -# - meteor update --packages-only + #- meteor update --packages-only # fix Errors and vulnerabilities -# - meteor npm audit fix + #- meteor npm audit fix script: - # List all install package for easier debugging - #- meteor npm ls # Test that our code is working as expected on that image. - - npm t + - meteor npm run test matrix: include: From 025907bd1d182301d535f7dc6b303569f406b494 Mon Sep 17 00:00:00 2001 From: franck Date: Wed, 12 Feb 2020 10:48:39 +0800 Subject: [PATCH 26/29] Try to fix issue with non native implementation of bcrypt --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 59601b00..10af680e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ before_install: install: - meteor npm cache verify - meteor npm install + - meteor npm install --save bcrypt # Update Meteor and all packages #- meteor update --all-packages # update the Meteor packages (but NOT meteor) to the latest version From d454c7224133180e0d24a14e0b0e8ba40d486d64 Mon Sep 17 00:00:00 2001 From: franck Date: Wed, 12 Feb 2020 11:32:04 +0800 Subject: [PATCH 27/29] tidy up - remove unnecessary lines --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10af680e..800ccc65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,15 +40,7 @@ before_install: chmod +x $HOME/.local/bin/ecs-cli install: - - meteor npm cache verify - meteor npm install - - meteor npm install --save bcrypt - # Update Meteor and all packages - #- meteor update --all-packages - # update the Meteor packages (but NOT meteor) to the latest version - #- meteor update --packages-only - # We are running this twice since there are chained dependencies - #- meteor update --packages-only # fix Errors and vulnerabilities #- meteor npm audit fix From cd6e1edfb6e9a4c6835fd3f630630fbf5cac13ee Mon Sep 17 00:00:00 2001 From: franck Date: Wed, 12 Feb 2020 16:44:11 +0800 Subject: [PATCH 28/29] WIP - explore Dockerfile syntax to build a simpler image --- Dockerfile_WIP.txt | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Dockerfile_WIP.txt diff --git a/Dockerfile_WIP.txt b/Dockerfile_WIP.txt new file mode 100644 index 00000000..894445d3 --- /dev/null +++ b/Dockerfile_WIP.txt @@ -0,0 +1,83 @@ +# We are using an Ubuntu image +FROM ubuntu:16.04 + +# We need several environment variables +# The folder where the built application will be stored +ENV APP_DIR /mefe + +# The port where the built application will be accessible +ENV PORT 3000 + +# We create a the user and group that we'll use use to do everything +USER meteor:meteor + +# We install several things so we can build the application +# Download Meteor +RUN curl https://install.meteor.com | /bin/sh +RUN export PATH="$HOME/.meteor:$PATH" +# Install Meteor +RUN meteor npm install +# Install pip +RUN sudo apt -y install python-pip +# Upgrade pip to the latest version +RUN pip install --upgrade pip +# Install AWS CLI +RUN pip install --user awscli +RUN export PATH=$PATH:$HOME/.local/bin +RUN curl -o $HOME/.local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest && chmod +x $HOME/.local/bin/ecs-cli + +# We create the folder where the app will be built +RUN mkdir -p $APP_DIR +# We copy the meteor `build` bundle into the $APP_DIR (make a few things easier) +# We also make sure that the permissions are correct +COPY bundle /app + +# We build the Application +RUN cd $APP_DIR/programs/server && npm install + +# We make sure the application is accessible +EXPOSE 3000 + +# We start the app +CMD ["node", "./main.js"] + + + + + + +ENV BUNDLE_DIR /home/node/bundle +ENV SRC_DIR /home/node/src +ENV TMP_DIR /home/node/tmp + +USER node:node + +RUN mkdir -p $SRC_DIR $BUNDLE_DIR $TMP_DIR +COPY --chown=node:node . $SRC_DIR + +RUN curl -o $TMP_DIR/meteor.sh 'https://install.meteor.com?release=1.8.1'; sh $TMP_DIR/meteor.sh + +ENV PATH="/home/node/.meteor:${PATH}" +WORKDIR $SRC_DIR +RUN npm i +RUN meteor npm install --production +# We build the application and put everything in a specific folder +RUN meteor build --server-only --directory $BUNDLE_DIR +RUN cd ${BUNDLE_DIR}/bundle/programs/server && npm install + +FROM node:8.15.1-slim + +ENV APP_DIR /home/node/app +ENV BUNDLE_DIR /home/node/bundle + +USER node:node + +COPY --from=builder $BUNDLE_DIR $APP_DIR +WORKDIR $APP_DIR/bundle + + +ENV PORT 3000 +EXPOSE 3000 + + +CMD ["node", "./main.js"] From 7ddfcbd811cd498b4dc3845ef78d925bd34658c0 Mon Sep 17 00:00:00 2001 From: franck Date: Fri, 14 Feb 2020 11:26:10 +0800 Subject: [PATCH 29/29] specify the Meteor version that we are using and should install --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 800ccc65..526e6cc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,11 @@ env: - COMMIT=${TRAVIS_COMMIT::7} #Add IMAGE_TAG variable to build docker image - IMAGE_TAG=${COMMIT} + # What is the meteor version we are using + - METEOR_VERSION=1.8.1 before_install: - - curl https://install.meteor.com | /bin/sh + - curl https://install.meteor.com?release=$METEOR_VERSION | /bin/sh - export PATH="$HOME/.meteor:$PATH" - pip install --user awscli - export PATH=$PATH:$HOME/.local/bin