-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(circleci): update ci * chore(db): update password test db * chore(deps): update husky * chore(deps): update deps
- Loading branch information
Showing
11 changed files
with
3,365 additions
and
9,957 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,21 +1,24 @@ | ||
orbs: | ||
slack: circleci/[email protected] | ||
slack: circleci/[email protected] # FIXME update to v4 | ||
node: circleci/[email protected] | ||
shellcheck: circleci/[email protected] | ||
docker: circleci/[email protected] | ||
version: 2.1 | ||
jobs: | ||
test: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
image: ubuntu-2004:202101-01 | ||
steps: | ||
- checkout | ||
- run: docker run --name postgres -p 5432:5432 -d postgres:10.6 | ||
- run: docker run --name postgres -e POSTGRES_PASSWORD='5ecr3t' -p 5432:5432 -d postgres:10.16 | ||
- run: | ||
name: Install Node | ||
command: | | ||
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | ||
sudo apt-get install -y nodejs | ||
echo 'export PATH=/usr/bin:$PATH' >> $BASH_ENV | ||
which node && node -v | ||
- run: npm install | ||
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 | ||
|
@@ -26,52 +29,58 @@ jobs: | |
- store_artifacts: | ||
path: ~/reports | ||
build: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
docker: | ||
- image: cimg/base:2021.03 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 20.10.2 | ||
- run: docker-compose -f docker/docker-compose.yml -f docker/docker-compose.dev.yml build --no-cache discounts | ||
eslint: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
docker: | ||
- image: cimg/node:14.16.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Node | ||
command: | | ||
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | ||
sudo apt-get install -y nodejs | ||
echo 'export PATH=/usr/bin:$PATH' >> $BASH_ENV | ||
which node && node -v | ||
- run: npm install | ||
- node/install-packages | ||
- run: mkdir -p ~/reports | ||
- run: npm run lint -- --format junit --output-file ~/reports/eslint.xml | ||
- store_test_results: | ||
path: ~/reports | ||
- store_artifacts: | ||
path: ~/reports | ||
yamllint: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
docker: | ||
- image: cimg/python:3.9.2 | ||
steps: | ||
- checkout | ||
- run: pip install yamllint | ||
- run: yamllint -d .yamllint.yml . | ||
shellcheck: | ||
docker: | ||
- image: cimg/base:2021.03 | ||
steps: | ||
- checkout | ||
- shellcheck/install | ||
- shellcheck/check | ||
audit: | ||
docker: | ||
- image: cimg/node:14.16.0 | ||
steps: | ||
- checkout | ||
- run: npm audit --production | ||
- slack/status: | ||
fail_only: true | ||
failure_message: The audit check for \`$CIRCLE_PROJECT_REPONAME\` has failed. | ||
docker-build-and-push: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
docker: | ||
- image: cimg/node:14.16.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Node | ||
command: | | ||
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | ||
sudo apt-get install -y nodejs | ||
echo 'export PATH=/usr/bin:$PATH' >> $BASH_ENV | ||
which node && node -v | ||
- run: npm install | ||
- setup_remote_docker: | ||
version: 20.10.2 | ||
- node/install-packages | ||
- run: npx semantic-release | ||
- run: docker build --tag aegee/discounts:$(node -p "require('./package.json').version") --tag aegee/discounts:latest -f ./docker/discounts/Dockerfile . | ||
- run: docker build --tag aegee/discounts:$(node -p "require('./package.json').version") --tag aegee/discounts:latest -f docker/discounts/Dockerfile . | ||
- run: docker login --username $DOCKER_LOGIN --password $DOCKER_PASSWORD | ||
- run: docker push aegee/discounts:$(node -p "require('./package.json').version") | ||
- run: docker push aegee/discounts:latest | ||
|
@@ -81,24 +90,34 @@ jobs: | |
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- test | ||
eslint: | ||
linters: | ||
jobs: | ||
- eslint | ||
yamllint: | ||
jobs: | ||
- yamllint | ||
- shellcheck | ||
- docker/hadolint: | ||
dockerfiles: $(find . -name '*Dockerfile*') | ||
build: | ||
jobs: | ||
- build: | ||
filters: | ||
branches: | ||
ignore: master | ||
test: | ||
jobs: | ||
- test | ||
docker-build-and-push: | ||
jobs: | ||
- docker-build-and-push: | ||
filters: | ||
branches: | ||
only: master | ||
audit: | ||
triggers: | ||
- schedule: | ||
cron: "0 0 * * 5" | ||
filters: | ||
branches: | ||
only: master | ||
jobs: | ||
- audit |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignored: | ||
- DL3025 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit $1 |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint-staged |
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 |
---|---|---|
|
@@ -8,5 +8,3 @@ ignore: | | |
rules: | ||
document-start: disable | ||
line-length: disable | ||
truthy: disable | ||
comments-indentation: disable |
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,11 +1,12 @@ | ||
FROM node:12 | ||
# FIXME use alpine | ||
FROM node:14.16.1 | ||
|
||
RUN mkdir -p /usr/app/src \ | ||
&& mkdir -p /usr/app/media \ | ||
&& mkdir -p /usr/app/scripts | ||
|
||
COPY ./docker/discounts/bootstrap.sh /usr/app/scripts/bootstrap.sh | ||
COPY ./ /usr/app/src | ||
COPY . /usr/app/src | ||
|
||
RUN chown -R node:node /usr/app | ||
|
||
|
@@ -16,9 +17,12 @@ USER node | |
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global | ||
ENV PATH="/home/node/.npm-global/bin:${PATH}" | ||
|
||
RUN npm install -g --loglevel warn nodemon bunyan && npm cache clean --force | ||
RUN npm install --loglevel warn | ||
# FIXME remove nodemon for production | ||
RUN npm install -g [email protected] | ||
RUN npm install -g [email protected] | ||
RUN npm cache clean --force | ||
RUN npm ci | ||
|
||
CMD sh /usr/app/scripts/bootstrap.sh && npm start | ||
CMD sh /usr/app/scripts/bootstrap.sh && nodemon -e "js,json" lib/run.js | ||
|
||
EXPOSE 8084 |
Oops, something went wrong.