forked from rilldata/rill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
62 lines (50 loc) · 1.42 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
dist: xenial
language: python
python:
- "3.7"
cache:
directories:
- "$HOME/.npm"
- "$TRAVIS_BUILD_DIR/data"
- "node_modules"
env:
global:
- DOCKER_IMAGE=rilldata/rill-developer
jobs:
include:
- stage: test
name: "Verify build"
before_install:
- nvm install 16
- node --version
- echo "NPM Install can take up to 6-8 mins"
script:
- npm install
# check that prettier has been applied
- npx prettier --check "**/*"
# install browser for UI tests
- npx playwright install
# build the entire application
- npm run build
# verify lint of the repo
- npm run lint
# run all tests
- npm run test
- stage: test
name: "Verify docker build"
install: docker --version
script:
- docker build -t ${DOCKER_IMAGE} .
- stage: publish
name: "Build & Publish"
if: tag IS NOT present AND branch = main
script:
- SHORT_SHA=$(git rev-parse --short HEAD)
- echo ${DOCKERHUB_CRED} | docker login --username ${DOCKERHUB_USER} --password-stdin
- docker-compose pull
- echo "Publish docker image with tag ${SHORT_SHA}"
- TAG=${SHORT_SHA} docker-compose build
- TAG=${SHORT_SHA} docker-compose push
- echo "Publish docker image with tag latest"
- docker-compose build
- docker-compose push