forked from rilldata/rill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
118 lines (100 loc) · 3.07 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
language: node_js
node_js:
- 16
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: &python-setup
- echo "Installing python 3.7.0 needed during npm install"
- pyenv install 3.7.0
- pyenv global 3.7.0
install: &slow-npm-ci
- echo "NPM Install can take up to 15 mins"
- travis_wait 30 npm ci
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 docker"
if: tag IS NOT present AND branch = main
install: docker --version
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
- stage: publish
name: "Build & Publish mac os binary"
if: tag IS present
os: osx
install: *slow-npm-ci
script: &build-vercel-pkg
# build the entire application
- npm run build
- echo "Cleaning dev depandancies"
- npm prune --production
- echo "Building vercel/pkg binary"
- node build-tools/replace_package_type.cjs module commonjs && npm run build-vercel-pkg
deploy: &deploy-vercel-pkg
provider: releases
api_key: ${GITHUB_TOKEN}
# explicitly mention all types of binaries
# travis doesnt support folder upload as of now
file:
- rilldata/rill-macos-x64
- rilldata/rill-linux-x64
- rilldata/rill-win-x64.exe
skip_cleanup: true
on:
tags: true
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
- stage: publish
name: "Build & Publish linux binary"
if: tag IS present
before_install: *python-setup
install: *slow-npm-ci
script: *build-vercel-pkg
deploy: *deploy-vercel-pkg
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
- stage: publish
name: "Build & Publish windows binary"
if: tag IS present
os: windows
before_install:
- echo "Installing python 3"
- choco install python3
install: *slow-npm-ci
script: *build-vercel-pkg
deploy: *deploy-vercel-pkg
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true