-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
39 lines (33 loc) · 1.05 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
sudo: required
# Used for semver and parsing package.json
language: node_js
node_js:
- "node"
services:
- docker
env:
global:
# Docker Hub cannot handle uppercase characters in repository names. Fix it
# with a bashism as Travis CI cannot handle quoting within command
# substitution.
- LOWERCASE_REPO_SLUG="${TRAVIS_REPO_SLUG,,}"
- DOCKER_LOCAL="${LOWERCASE_REPO_SLUG}:${TRAVIS_COMMIT}"
- DOCKER_MASTER="${LOWERCASE_REPO_SLUG}:latest"
before_install:
- docker --version
- echo "ENV GIT_COMMIT ${TRAVIS_COMMIT}" >> Dockerfile
- docker build --tag "${DOCKER_LOCAL}" .
script:
- sh ./.travis/check_semver
- docker run --rm "${DOCKER_LOCAL}" yarn eslint
- docker run --rm "${DOCKER_LOCAL}" yarn test
deploy:
- provider: script
script: sh ./.travis/docker_login_tag_push "${DOCKER_LOCAL}" "${DOCKER_MASTER}"
on:
branch: master
- provider: script
script: sh ./.travis/docker_login_tag_semver_push "${DOCKER_LOCAL}" "${LOWERCASE_REPO_SLUG}" "${TRAVIS_TAG}"
on:
tags: true
all_branches: true