Skip to content

Commit

Permalink
Add travis setup file
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusvasquez333 committed May 3, 2020
1 parent e67ff05 commit a4fd1a0
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
language: minimal

services:
- docker

env:
global:
- DOCKER_ORG_NAME=jesusvasquez333
- DOCKER_REPO=epics-web-client

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"

0 comments on commit a4fd1a0

Please sign in to comment.