-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): update to Node 16 and upgrade deps and CI config (#625)
* fix(deps): update to Node 16 and upgrade deps and CI config * chore(circleci): correctly name events * chore(docker-compose): revert docker-compose version
- Loading branch information
Showing
6 changed files
with
19,847 additions
and
2,019 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 |
---|---|---|
@@ -1,44 +1,43 @@ | ||
orbs: | ||
slack: circleci/[email protected] # FIXME update to v4 | ||
node: circleci/[email protected] | ||
shellcheck: circleci/[email protected] | ||
docker: circleci/[email protected] | ||
codecov: codecov/[email protected] | ||
docker: circleci/[email protected] | ||
node: circleci/[email protected] | ||
shellcheck: circleci/[email protected] | ||
slack: circleci/[email protected] | ||
version: 2.1 | ||
jobs: | ||
test: | ||
machine: | ||
image: ubuntu-2004:202101-01 | ||
docker: | ||
- image: cimg/node:16.13.0 | ||
- image: circleci/postgres:10.18 | ||
environment: | ||
POSTGRES_PASSWORD: config.test.postgres.password | ||
parallelism: 4 | ||
steps: | ||
- checkout | ||
- run: docker run --name postgres -e POSTGRES_PASSWORD='5ecr3t' -p 5432:5432 -d postgres:10.16 | ||
- run: | ||
name: Install Node | ||
command: | | ||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV | ||
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV | ||
nvm install v14.16.0 | ||
nvm alias default v14.16.0 | ||
- node/install-packages | ||
- run: mkdir -p ~/reports/jest | ||
- run: | ||
name: Run tests | ||
command: JEST_JUNIT_OUTPUT_DIR=$HOME/reports/jest npm test -- --reporters=default --reporters=jest-junit | ||
- run: ./node_modules/.bin/codecov | ||
command: | | ||
TEST=$(circleci tests glob test/**/*.js | circleci tests split --split-by=timings) | ||
JEST_JUNIT_OUTPUT_DIR=$HOME/reports/jest npm run test:ci $TEST -- --reporters=default --reporters=jest-junit | ||
- codecov/upload | ||
- store_test_results: | ||
path: ~/reports | ||
- store_artifacts: | ||
path: ~/reports | ||
build: | ||
docker: | ||
- image: cimg/base:2021.03 | ||
- image: cimg/base:2021.10 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 20.10.2 | ||
version: 20.10.7 | ||
- run: docker-compose -f docker/docker-compose.yml -f docker/docker-compose.dev.yml build --no-cache events | ||
eslint: | ||
docker: | ||
- image: cimg/node:14.16.0 | ||
- image: cimg/node:16.13.0 | ||
steps: | ||
- checkout | ||
- node/install-packages | ||
|
@@ -50,43 +49,158 @@ jobs: | |
path: ~/reports | ||
yamllint: | ||
docker: | ||
- image: cimg/python:3.9.2 | ||
- image: cimg/python:3.10.0 | ||
steps: | ||
- checkout | ||
- run: pip install yamllint | ||
- run: yamllint -d .yamllint.yml . | ||
shellcheck: | ||
docker: | ||
- image: cimg/base:2021.03 | ||
- image: cimg/base:2021.10 | ||
steps: | ||
- checkout | ||
- shellcheck/install | ||
- shellcheck/check | ||
audit: | ||
docker: | ||
- image: cimg/node:14.16.0 | ||
- image: cimg/node:16.13.0 | ||
steps: | ||
- checkout | ||
- run: npm audit --production | ||
- slack/status: | ||
fail_only: true | ||
failure_message: The audit check for \`$CIRCLE_PROJECT_REPONAME\` has failed. | ||
- slack/notify: | ||
event: fail | ||
custom: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":x: The audit check for `$CIRCLE_PROJECT_REPONAME` has failed." | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project*\n$CIRCLE_PROJECT_REPONAME" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Job Number*\n$CIRCLE_BUILD_NUM" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "actions", | ||
"elements": [ | ||
{ | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Visit Job" | ||
}, | ||
"url": "${CIRCLE_BUILD_URL}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
docker-build-and-push: | ||
docker: | ||
- image: cimg/node:14.16.0 | ||
- image: cimg/node:16.13.0 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 20.10.2 | ||
version: 20.10.7 | ||
- node/install-packages | ||
- run: npx semantic-release | ||
- run: docker build --tag aegee/events:$(node -p "require('./package.json').version") --tag aegee/events:latest -f docker/events/Dockerfile . | ||
- run: echo export PACKAGE_VERSION=$(node -p "require('./package.json').version") >> $BASH_ENV | ||
- run: docker build --tag aegee/events:$PACKAGE_VERSION --tag aegee/events:latest -f docker/events/Dockerfile . | ||
- run: docker login --username $DOCKER_LOGIN --password $DOCKER_PASSWORD | ||
- run: docker push aegee/events:$(node -p "require('./package.json').version") | ||
- run: docker push aegee/events:$PACKAGE_VERSION | ||
- run: docker push aegee/events:latest | ||
- slack/status: | ||
success_message: The Docker image for \`$CIRCLE_PROJECT_REPONAME\` with tags \`$(node -p "require('./package.json').version")\` and \`latest\` has been pushed to Dockerhub. | ||
failure_message: The Docker image for \`$CIRCLE_PROJECT_REPONAME\` build and push has failed. | ||
- slack/notify: | ||
event: pass | ||
custom: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":white_check_mark: The Docker image for `$CIRCLE_PROJECT_REPONAME` with tags `$PACKAGE_VERSION` and `latest` has been pushed to Dockerhub." | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project*\n$CIRCLE_PROJECT_REPONAME" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Job Number*\n$CIRCLE_BUILD_NUM" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "actions", | ||
"elements": [ | ||
{ | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Visit Job" | ||
}, | ||
"url": "${CIRCLE_BUILD_URL}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
- slack/notify: | ||
event: fail | ||
custom: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":octagonal_sign: The Docker image for `$CIRCLE_PROJECT_REPONAME` build and push has failed." | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project*\n$CIRCLE_PROJECT_REPONAME" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Job Number*\n$CIRCLE_BUILD_NUM" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "actions", | ||
"elements": [ | ||
{ | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Visit Job" | ||
}, | ||
"url": "${CIRCLE_BUILD_URL}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
workflows: | ||
version: 2 | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'header-max-length': [0, 'always', 72], | ||
'header-max-length': [0], | ||
} | ||
}; |
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# FIXME use alpine | ||
FROM node:14.18.1 | ||
FROM node:16.13.0 | ||
|
||
RUN mkdir -p /usr/app/src \ | ||
&& mkdir -p /usr/app/media \ | ||
|
@@ -18,7 +18,7 @@ ENV NPM_CONFIG_PREFIX=/home/node/.npm-global | |
ENV PATH="/home/node/.npm-global/bin:${PATH}" | ||
|
||
# FIXME remove nodemon for production | ||
RUN npm install -g [email protected].7 \ | ||
RUN npm install -g [email protected].14 \ | ||
&& npm install -g [email protected] \ | ||
&& npm cache clean --force \ | ||
&& npm install | ||
|
Oops, something went wrong.