2018-07-20 23:07:54 +00:00
|
|
|
# Build steps need access to the Docker agent
|
2017-11-25 11:01:30 +00:00
|
|
|
sudo: required
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
2018-05-14 20:37:43 +00:00
|
|
|
jobs:
|
|
|
|
include:
|
2018-07-20 23:07:54 +00:00
|
|
|
|
|
|
|
# Run all the tests inside Docker
|
|
|
|
|
|
|
|
- stage: Test
|
|
|
|
script: docker build -f Dockerfile.test .
|
|
|
|
|
|
|
|
|
|
|
|
# If this is a tagged commit, publish the package to npm
|
|
|
|
|
|
|
|
- stage: Release npm
|
|
|
|
script: echo "Deploying to npm"
|
2018-05-14 20:37:43 +00:00
|
|
|
deploy:
|
|
|
|
provider: npm
|
|
|
|
email: asyncadventures@gmail.com
|
|
|
|
api_key: $NPM_TOKEN
|
|
|
|
on:
|
|
|
|
tags: true
|
2018-07-20 23:07:54 +00:00
|
|
|
condition: $TRAVIS_TAG =~ ^\d+\.\d+\.\d+$
|
|
|
|
|
|
|
|
# If this is a tagged commit, publish a new Docker image
|
|
|
|
|
|
|
|
- stage: Release Docker
|
|
|
|
script: echo "Deploying to DockerHub"
|
|
|
|
deploy:
|
|
|
|
provider: script
|
|
|
|
script:
|
|
|
|
- DOCKER_IMAGE="thumbsupgallery/thumbsup"
|
|
|
|
- docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
|
2018-07-24 06:35:22 +00:00
|
|
|
- docker build -f Dockerfile.release -t "${DOCKER_IMAGE}:${TRAVIS_TAG}" .
|
2018-07-20 23:07:54 +00:00
|
|
|
- docker tag "${DOCKER_IMAGE}:${TRAVIS_TAG}" "${DOCKER_IMAGE}:latest"
|
|
|
|
- docker push "${DOCKER_IMAGE}:${TRAVIS_TAG}"
|
|
|
|
- docker push "${DOCKER_IMAGE}:latest"
|
|
|
|
on:
|
|
|
|
tags: true
|
|
|
|
condition: $TRAVIS_TAG =~ ^\d+\.\d+\.\d+$
|