Skip to content

Commit 8c47dc2

Browse files
alanbchristieAlan Christie
andauthored
Poster now supports build-time IMAGE_TAG (#46)
* - Supports TRAVIS_TAG - Poster image '1.0.0' now sets Image-Tag header to '1.0.0' - Removed concept of 'stable' images - not it's just 'latest' and '<tag>' * - Poster now echos some stuff (importantly the IMAGE_TAG) Co-authored-by: Alan Christie <[email protected]>
1 parent 2f9ee9d commit 8c47dc2

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

.travis.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ stages:
3131
if: |
3232
tag IS present \
3333
AND env(PUBLISH_IMAGES) = yes
34-
- name: publish stable
35-
if: |
36-
tag IS present \
37-
AND tag =~ ^([0-9]+\.){1,2}[0-9]+$ \
38-
AND env(PUBLISH_IMAGES) = yes
3934
4035
jobs:
4136
include:
@@ -64,26 +59,12 @@ jobs:
6459
- stage: publish tag
6560
name: Publish Tagged Image
6661
script:
67-
# Build and push the pipelines-rdkit image and its sd-poster
62+
# Build and push the pipelines-rdkit image and its sd-poster.
63+
# The poster will have its IMAGE_TAG set to TRAVIS_TAG
6864
- docker build -t informaticsmatters/rdkit_pipelines:${TRAVIS_TAG} -f Dockerfile-rdkit .
69-
- docker build -t squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG} -f Dockerfile-sdposter .
65+
- docker build -t squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG} -f Dockerfile-sdposter --build-arg image_tag=${TRAVIS_TAG} .
7066
- if [ -n "$DOCKER_PASSWORD" ]; then
7167
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
7268
docker push informaticsmatters/rdkit_pipelines:${TRAVIS_TAG};
7369
docker push squonk/rdkit-pipelines-sdposter:${TRAVIS_TAG};
7470
fi
75-
76-
- stage: publish stable
77-
name: Publish Stable Image
78-
script:
79-
# Pull the corresponding pipelines-rdkit image tag
80-
# and push it again as '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

Dockerfile-sdposter

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
FROM centos:7
22
MAINTAINER Tim Dudgeon <[email protected]>
33

4+
# The image tag for the pipelines we're expected to post.
5+
# By default this is 'latest' but the build environment can
6+
# use a built-arg to over-ride this.
7+
# So, a poster container image built for Git tag '1.0.0' would be expected
8+
# to have its IMAGE_TAG environment variable set to '1.0.0' and therefore
9+
# running poster:1.0.0 would inject pipelines for container image '1.0.0'
10+
ARG image_tag=latest
11+
ENV IMAGE_TAG=$image_tag
12+
413
# An image to populate the Core with the contents of the
514
# Service Descriptors located in SD_SRC.
615

post-service-descriptors.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77
set -e
88

99
POST=${1:-http://coreservices:8080/coreservices/rest/v1/services}
10-
BASE_D='docker://github.com/InformaticsMatters/pipelines'
11-
BASE_N='nextflow://github.com/InformaticsMatters/pipelines'
10+
BASE_D=docker://github.com/InformaticsMatters/pipelines
11+
BASE_N=nextflow://github.com/InformaticsMatters/pipelines
12+
IMAGE_TAG=${IMAGE_TAG:-}
1213
CT_DJ="application/x-squonk-service-descriptor-docker+json"
1314
CT_DY="application/x-squonk-service-descriptor-docker+yaml"
1415
CT_MM="multipart/mixed"
1516

17+
echo BASE_D="${BASE_D}"
18+
echo BASE_N="${BASE_N}"
19+
echo IMAGE_TAG="${IMAGE_TAG}"
1620

17-
for d in 'src/python/pipelines/dmpk' 'src/python/pipelines/docking' 'src/python/pipelines/rdkit' 'src/python/pipelines/dimorphite'
21+
for d in 'src/python/pipelines/dmpk' \
22+
'src/python/pipelines/docking' \
23+
'src/python/pipelines/rdkit' \
24+
'src/python/pipelines/dimorphite'
1825
do
1926
for file in $d/*.dsd.yml
2027
do
@@ -23,12 +30,14 @@ do
2330
-T $file\
2431
-H "Content-Type: $CT_DY"\
2532
-H "Base-URL: $BASE_D"\
33+
-H "Image-Tag: $IMAGE_TAG"\
2634
$POST
2735
echo ""
2836
done
2937
done
3038

31-
for d in 'src/nextflow/docking' 'src/nextflow/rdkit'
39+
for d in 'src/nextflow/docking' \
40+
'src/nextflow/rdkit'
3241
do
3342
for file in $d/*.nsd.yml
3443
do

0 commit comments

Comments
 (0)