This repository was archived by the owner on May 27, 2020. It is now read-only.
File tree 3 files changed +61
-7
lines changed
3 files changed +61
-7
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,19 @@ services:
8
8
env :
9
9
global :
10
10
- COMPOSE_FILE="doc/docker-compose/base-dev.yml:doc/docker-compose/selenium.yml"
11
+ - INSTALL_EZ_INSTALL_TYPE=demo
11
12
# list of behat arguments to test
12
13
matrix :
13
- - ARGS="--profile=rest --suite=fullJson" COMPOSE_FILE="doc/docker-compose/base-prod.yml:doc/docker-compose/selenium.yml"
14
+ - ARGS="--profile=rest --suite=fullJson" COMPOSE_FILE="doc/docker-compose/base-prod.yml:doc/docker-compose/selenium.yml" REMOTE_IMAGE="ezsystems/ezplatform-demo" APP_PROD_IMAGE="ezplatform-demo"
14
15
- ARGS="--profile=rest --suite=fullXml" SYMFONY_ENV=behat SYMFONY_DEBUG=1
15
16
- ARGS="--profile=core" SYMFONY_ENV=behat SYMFONY_DEBUG=1
16
17
17
18
# test only master (+ Pull requests)
18
19
branches :
19
20
only :
20
21
- master
21
- - " 1.3"
22
+ - /^\d.\d$/
23
+ - /^v\d.\d.\d$/
22
24
23
25
# Update Docker and Docker Compose
24
26
before_install : ./bin/.travis/trusty/update_docker.sh
@@ -37,6 +39,9 @@ before_script:
37
39
# using behat.yml which is a copy of behat.yml.dist with hostnames update by docker-compose.behat.yml
38
40
script : docker-compose exec --user www-data app sh -c "php /scripts/wait_for_db.php; php bin/behat -vv $ARGS --tags=~@broken"
39
41
42
+ # Push prod image to docker hub on sucess (on tags)
43
+ after_success : if [ "$REMOTE_IMAGE" != "" ] && [ "$TRAVIS_TAG" != "" ]; then bin/.ci/docker_hub_push.sh ${APP_PROD_IMAGE} ${REMOTE_IMAGE}; fi
44
+
40
45
# disable mail notifications
41
46
notifications :
42
47
email : false
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ set -e
4
+
5
+ # See .travis.yml for example use
6
+
7
+ validateEnvironment ()
8
+ {
9
+ if [ " $DOCKER_EMAIL " = " " ]; then
10
+ echo " Environment variable DOCKER_EMAIL is not set. Bailing out !"
11
+ exit 1
12
+ fi
13
+ if [ " $DOCKER_USERNAME " = " " ]; then
14
+ echo " Environment variable DOCKER_USERNAME is not set. Bailing out !"
15
+ exit 1
16
+ fi
17
+ if [ " $DOCKER_PASSWORD " = " " ]; then
18
+ echo " Environment variable DOCKER_PASSWORD is not set. Bailing out !"
19
+ exit 1
20
+ fi
21
+ }
22
+
23
+ validateEnvironment
24
+
25
+ if [ " $1 " = " " ]; then
26
+ echo " Argument 1 variable APP_PROD_IMAGE is not set, format: ezplatform-demo. Bailing out !"
27
+ exit 1
28
+ fi
29
+
30
+
31
+ if [ " $2 " = " " ]; then
32
+ echo " Argument 2 variable REMOTE_IMAGE is not set, format: ezsystems/ezplatform-demo. Bailing out !"
33
+ exit 1
34
+ fi
35
+
36
+ APP_PROD_IMAGE=" $1 "
37
+ REMOTE_IMAGE=" $2 "
38
+
39
+ # Debug
40
+ docker images
41
+
42
+ # Login
43
+ docker login -e=" $DOCKER_EMAIL " -u=" $DOCKER_USERNAME " -p=" $DOCKER_PASSWORD "
44
+
45
+ # # TAG
46
+ docker tag " ${APP_PROD_IMAGE} " " ${REMOTE_IMAGE} :latest"
47
+
48
+ echo " Pushing docker image with all tags : ${REMOTE_IMAGE} "
49
+ docker push " ${REMOTE_IMAGE} "
You can’t perform that action at this time.
0 commit comments