-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
74 lines (71 loc) · 2.52 KB
/
.travis.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
language: node_js
node_js:
- lts/*
cache:
yarn: true
directories:
- node_modules
stages:
- name: "Check code formatting with Prettier"
if: tag is blank
- name: "Build test image non-pr"
if: tag is blank AND branch != main AND type != pull_request
- name: "Build test image pr"
if: tag is blank AND branch != main AND type = pull_request
- name: "Build production image"
if: branch = main AND type != pull_request AND tag is blank
- name: "Build platform image"
if: tag is present
before_install:
# Install the buildx plugin
- mkdir -vp ~/.docker/cli-plugins/
- curl --silent -L "https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
- chmod a+x ~/.docker/cli-plugins/docker-buildx
# Enable experimental features
- export DOCKER_CLI_EXPERIMENTAL=enabled
- export DOCKER_BUILD_KIT=1
# Change buildx output style
- export BUILDKIT_PROGRESS=plain
- set -e
after_success:
- curl -H "Authorization:Bearer $ARTIFACTORY_TOKEN" $TWISTLOCK_DL_ENDPOINT --output tt_latest.zip
- unzip tt_latest.zip
- cd tt_*/linux_x86_64
- chmod +x tt
- ./tt image pull-and-scan --imagetype prod --user $TT_USER:$TT_API_KEY --url $TWISTLOCK_ENDPOINT --control-group $TT_CONTROL_GROUP --output-format json $FULL_IMAGE_ID || travis_terminate 1
jobs:
include:
- stage: "Check code formatting with Prettier"
os: linux
script:
- npm install prettier && npx prettier src --check || travis_terminate 1
after_success:
- echo "Done!"
- stage: "Build test image non-pr"
os: linux
services:
- docker
script:
- export FULL_IMAGE_ID=${DOCKER_REGISTRY}/st4sd-registry-ui:$TRAVIS_BRANCH
- ./build_and_push.sh $FULL_IMAGE_ID || travis_terminate 1
- stage: "Build test image pr"
os: linux
services:
- docker
script:
- export FULL_IMAGE_ID=${DOCKER_REGISTRY}/st4sd-registry-ui:$TRAVIS_PULL_REQUEST_BRANCH
- ./build_and_push.sh $FULL_IMAGE_ID || travis_terminate 1
- stage: "Build production image"
os: linux
services:
- docker
script:
- export FULL_IMAGE_ID=${DOCKER_REGISTRY}/st4sd-registry-ui
- ./build_and_push.sh $FULL_IMAGE_ID || travis_terminate 1
- stage: "Build platform image"
os: linux
services:
- docker
script:
- export FULL_IMAGE_ID=${DOCKER_REGISTRY}/st4sd-registry-ui:release-candidate
- ./build_and_push.sh $FULL_IMAGE_ID || travis_terminate 1