-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
45 lines (38 loc) · 1.49 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
40
41
42
43
44
45
language: java
if: tag is blank
services:
- 'docker'
before_install:
- "source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/get_config.sh)"
- "source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/get_version.sh)"
#build and test
install:
- docker build --pull -t $IMAGE:$IMAGE_VERSION .
- export CONTAINER_COMMAND="docker run $IMAGE:$IMAGE_VERSION $TEST_COMMAND"
- echo CONTAINER_COMMAND=$CONTAINER_COMMAND
- export CONTAINER_OUTPUT=$(eval $CONTAINER_COMMAND)
- echo CONTAINER_OUTPUT=$CONTAINER_OUTPUT
- if [[ ! ${CONTAINER_OUTPUT} =~ ${TEST_COMMAND_VERIFY} ]]; then travis_terminate 1; fi
- docker images
#test
script:
- echo "LOGIN TO HUB.DOCKER"
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- echo "PUSH HUB.DOCKER"
- docker push $IMAGE:$IMAGE_VERSION
- if [[ $TRAVIS_BRANCH == "master" ]]; then docker tag $IMAGE:$IMAGE_VERSION $IMAGE:latest && docker push $IMAGE:latest; fi
- echo "UPDATE README IN HUB.DOCKER"
- if [[ $TRAVIS_BRANCH == "master" ]]; then docker run --rm -v $(pwd):/data/ aemdesign/dockerhub-description "$DOCKER_USERNAME" "$DOCKER_PASSWORD" "$IMAGE"; fi
## Get the project version
before_deploy:
- if [[ $TRAVIS_BRANCH == "master" ]]; then git tag $TRAVIS_TAG; fi
## Create release in GitHub
deploy:
provider: releases
tag_name: $TRAVIS_TAG
name: $TRAVIS_TAG
target_commitish: $TRAVIS_COMMIT
api_key: $GITHUB_TOKEN
skip_cleanup: true
on:
branch: master