Skip to content

Commit

Permalink
Use build environment variables for easy reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
fjudith committed Nov 12, 2019
1 parent 4916a93 commit 60bbb81
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ jobs:
include:
- stage: Debian build
env:
- REPO=${REPO}
- VERSION=${VERSION}
- TAG=${TAG}
- BASE_IMAGE=debian
- HTTP_PORT=32733
- HTTPS_PORT=32734
script:
- docker build -f debian/Dockerfile -t ${REPO}:${VERSION} debian/
- docker run --name 'drawio' -d -p 32733:8080 -p 32734:8443 ${REPO}:${VERSION}
- docker build -f ${BASE_IMAGE}/Dockerfile -t ${REPO}:${VERSION} ${BASE_IMAGE}/
- docker run --name 'drawio' -d -p ${HTTP_PORT}:8080 -p ${HTTPS_PORT}:8443 ${REPO}:${VERSION}
- sleep 10
- docker logs drawio
- docker exec drawio /bin/bash -c "curl -i http://localhost:8080"
- stage: Alpine build
env:
- REPO=${REPO}
- ALPINE_VERSION=${VERSION}-alpine
- ALPINE_TAG=${ALPINE_TAG}
- BASE_IMAGE=alpine
- HTTP_PORT=32735
- HTTPS_PORT=32736
script:
- docker build -f alpine/Dockerfile -t ${REPO}:${ALPINE_VERSION} alpine/
- docker run --name 'drawio-alpine' -d -p 32735:8080 -p 32736:8443 ${REPO}:${ALPINE_VERSION}
- docker build -f ${BASE_IMAGE}/Dockerfile -t ${REPO}:${VERSION}-${BASE_IMAGE} ${BASE_IMAGE}/
- docker run --name "drawio-${BASE_IMAGE}" -d -p ${HTTP_PORT}:8080 -p ${HTTPS_PORT}:8443 ${REPO}:${VERSION}-${BASE_IMAGE}
- sleep 10
- docker logs drawio-alpine
- docker exec drawio-alpine /bin/bash -c "curl -i http://localhost:8080"
- docker logs drawio-${BASE_IMAGE}
- docker exec drawio-${BASE_IMAGE} /bin/bash -c "curl -i http://localhost:8080"

after_success:
- echo "${DOCKER_PASS}" | docker login -u "${DOCKER_USER}" --password-stdin
Expand Down

0 comments on commit 60bbb81

Please sign in to comment.