-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
48 lines (48 loc) · 2.07 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
version: 0.2
phases:
install:
runtime-versions:
docker: 19
pre_build:
commands:
# Install Snyk
# - echo Install Snyk
# - curl -Lo ./snyk "https://github.com/snyk/snyk/releases/download/v1.210.0/snyk-linux"
# - chmod -R +x ./snyk
# Snyk auth
# - ./snyk config set api="$SNYK_AUTH_TOKEN"
# Build Docker image for testing
# - echo Building docker images for testing...
# - docker-compose -f docker-compose.dev.yml build
build:
commands:
- echo Build started on `date`
# Run tests with built Docker images
# - echo Run react tests...
# - docker run -e CI=true lukondefmwila/react-test
# - echo Run nodejs tests...
# - docker run -e CI=true lukondefmwila/nodejs-test
# Scan Docker image with Snyk
## Client
## Run test for security vulernabilities
# - ./snyk test --severity-threshold=medium --docker lukondefmwila/react-test:latest --file=./client/Dockerfile.dev
## Setup continuous monitoring
# - ./snyk monitor --docker lukondefmwila/react-test:latest --file=./client/Dockerfile.dev
## Backend
## Run test for security vulernabilities
# - ./snyk test --severity-threshold=medium --docker lukondefmwila/nodejs-test:latest --file=./backend/Dockerfile.dev
## Setup continuous monitoring
# - ./snyk monitor --docker lukondefmwila/nodejs-test:latest --file=./backend/Dockerfile.dev
# Build the Docker images
- echo Building the production Docker image...
- docker-compose build
# Log in to the Docker CLI
- echo "$dockerhub_password" | docker login -u "$dockerhub_username" --password-stdin
post_build:
commands:
# Take these images and push them to Docker hub
- echo Pushing the Docker images...
- docker-compose push
artifacts:
files:
- "**/*"