Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: 2.1
orbs:
snyk: snyk/snyk@0.0.8
jobs:
build:
working_directory: ~/leopold
Expand All @@ -19,12 +21,38 @@ jobs:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- snyk/scan
- run:
name: lint
command: npm run lint
- run:
name: test
command: npm run test
- run:
name: Build and Scan Docker image
command: |
echo 'export PATH=~$PATH:~/.local/bin' >> $BASH_ENV
echo 'export TAG=${CIRCLE_SHA1}' >> $BASH_ENV
echo 'export IMAGE_NAME=leopold' >> $BASH_ENV && source $BASH_ENV
npm install
docker build -t $DOCKER_USER/$IMAGE_NAME -t $DOCKER_USER/$IMAGE_NAME:$TAG .
- snyk/scan:
fail-on-issues: true
monitor-on-build: true
docker-image-name: $DOCKER_USER/$IMAGE_NAME:$TAG
target-file: "Dockerfile"
project: ${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}-app
organization: ${SNYK_CICD_ORGANIZATION}
- run:
name: Build and Push Docker image to Docker Hub
command: |
echo 'export PATH=~$PATH:~/.local/bin' >> $BASH_ENV
echo 'export TAG=${CIRCLE_SHA1}' >> $BASH_ENV
echo 'export IMAGE_NAME=leopold' >> $BASH_ENV && source $BASH_ENV
npm install
docker build -t $DOCKER_USER/$IMAGE_NAME -t $DOCKER_USER/$IMAGE_NAME:$TAG .
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKER_USER --password-stdin
docker push $DOCKER_USER/$IMAGE_NAME
- run:
name: balena-login
command: npm run ci-login -- --token $BALENA_CLI_TOKEN
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ This project will answer the following questions:
- Where and when should I be playing the violin?
- Have I been paid for playing the violin?

### Security
Monitored with Snyk

[![Known Vulnerabilities](https://snyk.io/test/github/FiddlersCode/leopold/badge.svg?targetFile=package.json)](https://snyk.io/test/github/FiddlersCode/leopold?targetFile=package.json)

### Local Dev:

- Run the Docker stack: `docker-compose up`
Expand Down