-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
34 lines (28 loc) · 1.01 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
language: minimal
services:
- docker
env:
global:
- DOCKER_ORG_NAME=jesusvasquez333
- DOCKER_REPO=smurf-pyrogue-control-server
stages:
- name: deploy_docker
if: tag IS present
jobs:
include:
- stage: deploy_docker
name: "Deploy Docker Image"
before_script:
# Use the git tag to tag tag docker image
- export DOCKER_TAG=`git describe --tags --always`
# Login to docker
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_ORG_NAME}" --password-stdin;
script:
# Build the docker image
- docker build -t ${DOCKER_ORG_NAME}/${DOCKER_REPO} .
after_success:
# Upload docker image (as tagged and latest version)
- docker push ${DOCKER_ORG_NAME}/${DOCKER_REPO};
- docker tag ${DOCKER_ORG_NAME}/${DOCKER_REPO} ${DOCKER_ORG_NAME}/${DOCKER_REPO}:${DOCKER_TAG};
- docker push ${DOCKER_ORG_NAME}/${DOCKER_REPO}:${DOCKER_TAG};
- echo "Docker image '${DOCKER_ORG_NAME}/${DOCKER_REPO}:${DOCKER_TAG}' pushed"