8
8
#
9
9
# If you set PUBLISH_IMAGES you must also set the following: -
10
10
#
11
- # DOCKER_USERNAME If PUBLISH_IMAGES is 'yes'
12
- # DOCKER_PASSWORD If PUBLISH_IMAGES is 'yes'
11
+ # DOCKER_USERNAME
12
+ # DOCKER_PASSWORD
13
13
#
14
14
# -----------------
15
15
#
16
16
# NOTE: Pull requests from foreign repositories will not
17
- # result in encrupted variables being set.
17
+ # result in encrypted variables being set.
18
18
# So, regardless of the state of PUBLISH_IMAGES,
19
19
# images will only be published if DOCKER_PASSWORD is defined.
20
20
@@ -23,42 +23,26 @@ services:
23
23
- docker
24
24
25
25
stages :
26
- - name : test
27
26
- name : publish latest
28
27
if : |
29
28
branch = master \
30
- AND env(PUBLISH_IMAGES) = yes \
31
- AND env(DOCKER_PASSWORD) IS present \
32
- AND env(DOCKER_PASSWORD) =~ ^\S+$
29
+ AND env(PUBLISH_IMAGES) = yes
33
30
- name : publish tag
34
31
if : |
35
32
tag IS present \
36
- AND env(PUBLISH_IMAGES) = yes \
37
- AND env(DOCKER_PASSWORD) IS present \
38
- AND env(DOCKER_PASSWORD) =~ ^\S+$
33
+ AND env(PUBLISH_IMAGES) = yes
39
34
- name : publish stable
40
35
if : |
41
36
tag IS present \
42
37
AND tag =~ ^([0-9]+\.){1,2}[0-9]+$ \
43
- AND env(PUBLISH_IMAGES) = yes \
44
- AND env(DOCKER_PASSWORD) IS present \
45
- AND env(DOCKER_PASSWORD) =~ ^\S+$
38
+ AND env(PUBLISH_IMAGES) = yes
46
39
47
40
jobs :
48
41
include :
49
42
50
- - stage : test
51
- name : Test Local Image
52
- script :
53
- - docker build -t informaticsmatters/rdkit_pipelines:latest -f Dockerfile-rdkit .
54
- - docker build -t squonk/rdkit-pipelines-sdposter:latest -f Dockerfile-sdposter .
55
- - git clone https://github.com/InformaticsMatters/pipelines-utils.git
56
- - cd pipelines-utils/src/groovy
57
- - groovy PipelineTester.groovy -indocker
58
-
59
43
# Publish-stage jobs...
60
- # Every successful master build results in a latest image
61
- # and every tag results in a tagged image in Docker Hub.
44
+ # Every successful master build results in a build (and test)
45
+ # of the latest image and every tag results in a tagged image in Docker Hub.
62
46
# Tags that match a RegEx are considered 'official' tags
63
47
# and also result in a 'stable' image tag.
64
48
@@ -68,29 +52,38 @@ jobs:
68
52
# Build and push the pipelines-rdkit image and its sd-poster
69
53
- docker build -t informaticsmatters/rdkit_pipelines:latest -f Dockerfile-rdkit .
70
54
- docker build -t squonk/rdkit-pipelines-sdposter:latest -f Dockerfile-sdposter .
71
- - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
72
- - docker push informaticsmatters/rdkit_pipelines:latest
73
- - docker push squonk/rdkit-pipelines-sdposter:latest
55
+ - git clone https://github.com/InformaticsMatters/pipelines-utils.git
56
+ - cd pipelines-utils/src/groovy
57
+ - groovy PipelineTester.groovy -indocker
58
+ - if [ -n "$DOCKER_PASSWORD" ]; then
59
+ docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
60
+ docker push informaticsmatters/rdkit_pipelines:latest;
61
+ docker push squonk/rdkit-pipelines-sdposter:latest;
62
+ fi
74
63
75
64
- stage : publish tag
76
65
name : Publish Tagged Image
77
66
script :
78
67
# Build and push the pipelines-rdkit image and its sd-poster
79
68
- docker build -t informaticsmatters/rdkit_pipelines:${TRAVIS_TAG} -f Dockerfile-rdkit .
80
69
- docker build -t squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG} -f Dockerfile-sdposter .
81
- - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
82
- - docker push informaticsmatters/rdkit_pipelines:${TRAVIS_TAG}
83
- - docker push squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG}
70
+ - if [ -n "$DOCKER_PASSWORD" ]; then
71
+ docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
72
+ docker push informaticsmatters/rdkit_pipelines:${TRAVIS_TAG};
73
+ docker push squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG};
74
+ fi
84
75
85
76
- stage : publish stable
86
77
name : Publish Stable Image
87
78
script :
88
79
# Pull the corresponding pipelines-rdkit image tag
89
80
# and push it again as 'stable'
90
- - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
91
- - docker pull informaticsmatters/rdkit_pipelines:${TRAVIS_TAG}
92
- - docker pull squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG}
93
- - docker tag informaticsmatters/rdkit_pipelines:${TRAVIS_TAG} informaticsmatters/rdkit_pipelines:stable
94
- - docker tag squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG} squonk/rdkit-pipelines-sdposter:stable
95
- - docker push informaticsmatters/rdkit_pipelines:stable
96
- - docker push squonk/rdkit-pipelines-sdposter:stable
81
+ - if [ -n "$DOCKER_PASSWORD" ]; then
82
+ docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
83
+ docker pull informaticsmatters/rdkit_pipelines:${TRAVIS_TAG};
84
+ docker pull squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG};
85
+ docker tag informaticsmatters/rdkit_pipelines:${TRAVIS_TAG} informaticsmatters/rdkit_pipelines:stable;
86
+ docker tag squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG} squonk/rdkit-pipelines-sdposter:stable;
87
+ docker push informaticsmatters/rdkit_pipelines:stable;
88
+ docker push squonk/rdkit-pipelines-sdposter:stable;
89
+ fi
0 commit comments