-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(circleci): add new checks attempt 2 #486
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,23 @@ | ||
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-2004:202010-01 | ||
image: ubuntu-2004:202101-01 | ||
steps: | ||
- checkout | ||
- run: docker run --name postgres -e POSTGRES_PASSWORD='5ecr3t' -p 5432:5432 -d postgres:13 | ||
- run: docker run --name postgres -e POSTGRES_PASSWORD='5ecr3t' -p 5432:5432 -d postgres:10.15 | ||
- run: | ||
name: Install Node | ||
command: | | ||
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - | ||
sudo apt-get install -y nodejs | ||
echo 'export PATH=/usr/bin:$PATH' >> $BASH_ENV | ||
which node && node -v | ||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV | ||
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV | ||
nvm install v14.15.1 | ||
nvm alias default v14.15.1 | ||
- node/install-packages | ||
- run: mkdir -p ~/reports/jest | ||
- run: | ||
|
@@ -28,15 +30,15 @@ jobs: | |
path: ~/reports | ||
build: | ||
docker: | ||
- image: cimg/base:2020.11 | ||
- image: cimg/base:2021.02 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
version: 20.10.2 | ||
- run: docker-compose -f docker/docker-compose.yml -f docker/docker-compose.dev.yml build --no-cache statutory | ||
eslint: | ||
docker: | ||
- image: cimg/node:14.15 | ||
- image: cimg/node:14.15.4 | ||
steps: | ||
- checkout | ||
- node/install-packages | ||
|
@@ -48,18 +50,34 @@ jobs: | |
path: ~/reports | ||
yamllint: | ||
docker: | ||
- image: cimg/python:3.9.0 | ||
- image: cimg/python:3.9.1 | ||
steps: | ||
- checkout | ||
- run: pip install yamllint | ||
- run: yamllint -d .yamllint.yml . | ||
shellcheck: | ||
docker: | ||
- image: cimg/base:2021.02 | ||
steps: | ||
- checkout | ||
- shellcheck/install | ||
- shellcheck/check | ||
audit: | ||
docker: | ||
- image: cimg/node:14.15.4 | ||
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: | ||
docker: | ||
- image: cimg/node:14.15 | ||
- image: cimg/node:14.15.4 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
version: 20.10.2 | ||
- node/install-packages | ||
- run: npx semantic-release | ||
- run: docker build --tag aegee/statutory:$(node -p "require('./package.json').version") --tag aegee/statutory:latest -f docker/statutory/Dockerfile . | ||
|
@@ -72,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 @@ | ||
_ |
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
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,28 +1,31 @@ | ||
# FIXME use alpine | ||
FROM node:14.16.0 | ||
|
||
RUN mkdir -p /usr/app/src \ | ||
&& mkdir -p /usr/app/media \ | ||
&& mkdir -p /usr/app/scripts | ||
|
||
RUN apt-get update | ||
RUN apt-get install netcat -y | ||
WORKDIR /usr/app/src | ||
|
||
COPY ./docker/statutory/bootstrap.sh /usr/app/scripts/bootstrap.sh | ||
COPY ./docker/statutory/wait.sh /usr/app/scripts/wait.sh | ||
COPY . /usr/app/src | ||
COPY package.json /usr/app/src | ||
|
||
RUN chown -R node:node /usr/app | ||
|
||
WORKDIR /usr/app/src | ||
|
||
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 install | ||
|
||
COPY --chown=node:node ./docker/statutory/bootstrap.sh /usr/app/scripts/bootstrap.sh | ||
COPY --chown=node:node . /usr/app/src | ||
RUN mkdir /usr/app/src/state | ||
|
||
CMD sh /usr/app/scripts/bootstrap.sh && nodemon -e "js,json" lib/run.js | ||
CMD ["sh", "-c", "/usr/app/scripts/bootstrap.sh && nodemon -e 'js,json' lib/run.js"] | ||
|
||
EXPOSE 8084 |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if it will work that way, can you double check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I rebuild statutory locally, that should be enough for testing right? Or is there a better way to test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebuilding + starting (which is more important IMO, as we should validate it's indeed starting the app) should be fine I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course the starting. It's running fine locally after rebuilding. But if you could test it out as well that would be nice