Skip to content

Commit 90e770e

Browse files
authored
Merge pull request #11660 from IQSS/11659-fix-ct-release
Fix ct image releasing
2 parents 808d68f + 6fd470e commit 90e770e

File tree

9 files changed

+219
-23
lines changed

9 files changed

+219
-23
lines changed

.github/workflows/container_maintenance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,6 @@ jobs:
272272
with:
273273
username: ${{ secrets.DOCKERHUB_USERNAME }}
274274
password: ${{ secrets.DOCKERHUB_TOKEN }}
275-
repository: gdcc/base
275+
repository: gdcc/configbaker
276276
short-description: "Dataverse Config Baker Container Image providing setup tooling and more"
277277
readme-filepath: ./modules/container-configbaker/README.md

.github/workflows/scripts/containers/maintain-application.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ for BRANCH in "$@"; do
126126
# 6. Let's put together what tags we want added to this build run
127127
TAG_OPTIONS=""
128128
if ! (( IS_DEV )); then
129-
TAG_OPTIONS="-Dapp.image=$APP_IMAGE_REF -Ddocker.tags.revision=$NEXT_REV_TAG"
129+
TAG_OPTIONS="-Dapp.image=$APP_IMAGE_REF -Dapp.image.tag.1=$NEXT_REV_TAG"
130130
# In case of the current release, add the "latest" tag as well.
131131
if (( IS_CURRENT_RELEASE )); then
132-
TAG_OPTIONS="$TAG_OPTIONS -Ddocker.tags.latest=latest"
132+
TAG_OPTIONS="$TAG_OPTIONS -Dapp.image.tag.2=latest"
133133
fi
134134
else
135135
# shellcheck disable=SC2016
136136
UPCOMING_TAG=$( mvn initialize help:evaluate -Pct -f . -Dexpression=app.image.tag -Dapp.image.tag='${app.image.version}-${base.image.flavor}' -q -DforceStdout )
137-
TAG_OPTIONS="-Ddocker.tags.upcoming=$UPCOMING_TAG"
137+
TAG_OPTIONS="-Dapp.image.tag.1=$UPCOMING_TAG"
138138

139139
# For the dev branch we only have rolling tags and can add them now already
140140
SUPPORTED_ROLLING_TAGS+=("[\"unstable\", \"$UPCOMING_TAG\"]")
@@ -148,9 +148,8 @@ for BRANCH in "$@"; do
148148
# Build the application image, but skip the configbaker image (that's a different job)!
149149
# shellcheck disable=SC2046
150150
mvn -Pct -f . deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \
151-
-Dconf.skipBuild -Dbase.image="${BASE_IMAGE_REF}" \
152-
-Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \
153-
$( if (( DAMP_RUN )); then echo "-Ddocker.skip.push -Ddocker.skip.tag"; fi )
151+
-Dconf.skipBuild -Dbase.image="${BASE_IMAGE_REF}" $TAG_OPTIONS \
152+
$( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi )
154153
else
155154
echo "Skipping Maven build as requested by DRY_RUN=1"
156155
fi

.github/workflows/scripts/containers/maintain-base.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ for BRANCH in "$@"; do
120120
CURRENT_REV_TAG="${BASE_IMAGE_REF#*:}-r$REV"
121121
NEXT_REV_TAG="${BASE_IMAGE_REF#*:}-r$(( REV + 1 ))"
122122

123+
# 6a. Determine if we must newly release an "r0" because a rolling tag from development is now released.
124+
IS_NEW_RELEASE=0
125+
if ! (( IS_DEV )) && [ "$REV" = "-1" ]; then
126+
echo "This is a newly released version of Dataverse - forcing build, as no r0 image is present on Docker Hub"
127+
IS_NEW_RELEASE=1
128+
fi
129+
123130
# 7. Let's put together what tags we want added to this build run
124131
TAG_OPTIONS=""
125132
if ! (( IS_DEV )); then
@@ -139,12 +146,12 @@ for BRANCH in "$@"; do
139146

140147
# 8. Let's build the base image if necessary
141148
NEWER_IMAGE=0
142-
if (( NEWER_JAVA_IMAGE + NEWER_PKGS + FORCE_BUILD > 0 )); then
149+
if (( NEWER_JAVA_IMAGE + NEWER_PKGS + IS_NEW_RELEASE + FORCE_BUILD > 0 )); then
143150
if ! (( DRY_RUN )); then
144151
# shellcheck disable=SC2046
145152
mvn -Pct -f modules/container-base deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \
146153
-Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \
147-
$( if (( DAMP_RUN )); then echo "-Ddocker.skip.push -Ddocker.skip.tag"; fi )
154+
$( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi )
148155
else
149156
echo "Skipping Maven build as requested by DRY_RUN=1"
150157
fi

.github/workflows/scripts/containers/maintain-configbaker.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ for BRANCH in "$@"; do
122122
# 6. Let's put together what tags we want added to this build run
123123
TAG_OPTIONS=""
124124
if ! (( IS_DEV )); then
125-
TAG_OPTIONS="-Dconf.image=$CONFIG_IMAGE_REF -Ddocker.tags.revision=$NEXT_REV_TAG"
125+
TAG_OPTIONS="-Dconf.image=$CONFIG_IMAGE_REF -Dconf.image.tag.1=$NEXT_REV_TAG"
126126
# In case of the current release, add the "latest" tag as well.
127127
if (( IS_CURRENT_RELEASE )); then
128-
TAG_OPTIONS="$TAG_OPTIONS -Ddocker.tags.latest=latest"
128+
TAG_OPTIONS="$TAG_OPTIONS -Dconf.image.tag.2=latest"
129129
fi
130130
else
131131
# shellcheck disable=SC2016
132132
UPCOMING_TAG=$( mvn initialize help:evaluate -Pct -f . -Dexpression=conf.image.tag -Dconf.image.tag='${app.image.version}-${conf.image.flavor}' -q -DforceStdout )
133-
TAG_OPTIONS="-Ddocker.tags.upcoming=$UPCOMING_TAG"
133+
TAG_OPTIONS="-Dconf.image.tag.1=$UPCOMING_TAG"
134134

135135
# For the dev branch we only have rolling tags and can add them now already
136136
SUPPORTED_ROLLING_TAGS+=("[\"unstable\", \"$UPCOMING_TAG\"]")
@@ -145,9 +145,8 @@ for BRANCH in "$@"; do
145145
# shellcheck disable=SC2046
146146
mvn -Pct -f . deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \
147147
-Dapp.skipBuild -Dconf.image.base="${BASE_IMAGE_REF}" \
148-
-Dmaven.main.skip -Dmaven.test.skip -Dmaven.war.skip \
149-
-Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \
150-
$( if (( DAMP_RUN )); then echo "-Ddocker.skip.push -Ddocker.skip.tag"; fi )
148+
-Dmaven.main.skip -Dmaven.test.skip -Dmaven.war.skip $TAG_OPTIONS \
149+
$( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi )
151150
else
152151
echo "Skipping Maven build as requested by DRY_RUN=1"
153152
fi

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,9 @@
11281128
Note: During maintenance we will use the app.image.version setting from the DV parent POM.
11291129
-->
11301130
<app.image.tag>unstable</app.image.tag>
1131+
<!-- Additional tags. Ignored by default (empty), used by maintenance action. -->
1132+
<app.image.tag.1></app.image.tag.1>
1133+
<app.image.tag.2></app.image.tag.2>
11311134
<app.skipBuild>false</app.skipBuild>
11321135
<app.skipDeploy>false</app.skipDeploy>
11331136

@@ -1142,6 +1145,9 @@
11421145
<conf.image>gdcc/configbaker:${conf.image.tag}</conf.image>
11431146
<!-- By default, we use the same tag as the app image for development purposes. Same rules as for app.image.tag apply! -->
11441147
<conf.image.tag>${app.image.tag}</conf.image.tag>
1148+
<!-- Additional tags. Ignored by default (empty), used by maintenance action. -->
1149+
<conf.image.tag.1></conf.image.tag.1>
1150+
<conf.image.tag.2></conf.image.tag.2>
11451151
<conf.image.flavor>noble</conf.image.flavor>
11461152
<conf.image.base>ubuntu:${conf.image.flavor}</conf.image.base>
11471153
<conf.skipBuild>false</conf.skipBuild>
@@ -1200,6 +1206,10 @@
12001206
<!-- Workaround for fabric8io/docker-maven-plugin#1865 -->
12011207
<APP_IMAGE_VERSION>${app.image.version}</APP_IMAGE_VERSION>
12021208
</args>
1209+
<tags>
1210+
<tag>${app.image.tag.1}</tag>
1211+
<tag>${app.image.tag.2}</tag>
1212+
</tags>
12031213
<filter>@</filter>
12041214
<assembly>
12051215
<descriptor>assembly.xml</descriptor>
@@ -1235,6 +1245,10 @@
12351245
<!-- Workaround for fabric8io/docker-maven-plugin#1865 -->
12361246
<APP_IMAGE_VERSION>${app.image.version}</APP_IMAGE_VERSION>
12371247
</args>
1248+
<tags>
1249+
<tag>${conf.image.tag.1}</tag>
1250+
<tag>${conf.image.tag.2}</tag>
1251+
</tags>
12381252
<filter>@</filter>
12391253
<assembly>
12401254
<descriptor>${project.basedir}/modules/container-configbaker/assembly.xml</descriptor>
Lines changed: 95 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
--- a/pom.xml (revision 906f874f9fd56241c41e6c2c2f6989c4406f5909)
2-
+++ b/pom.xml (date 1746655334773)
3-
@@ -997,14 +997,18 @@
1+
--- a/pom.xml
2+
+++ b/pom.xml
3+
@@ -1069,18 +1069,38 @@
4+
<postgresql.server.version>17</postgresql.server.version>
45

56
<app.image>gdcc/dataverse:${app.image.tag}</app.image>
7+
+ <!--
8+
+ Note: We are still using the unstable tag here, as we need it most for development purposes.
9+
+ It will be overridden by the maintenance CI for released app versions.
10+
+ Note: During maintenance we will use the app.image.version setting from the DV parent POM.
11+
+ -->
612
<app.image.tag>unstable</app.image.tag>
13+
+ <!-- Additional tags. Ignored by default (empty), used by maintenance action. -->
14+
+ <app.image.tag.1></app.image.tag.1>
15+
+ <app.image.tag.2></app.image.tag.2>
716
+ <app.skipBuild>false</app.skipBuild>
817
<app.skipDeploy>false</app.skipDeploy>
18+
+
919
<base.image>gdcc/base:${base.image.tag}</base.image>
1020
<!-- Flavor is a release from a Linux distro, such as Ubuntu -->
1121
<base.image.flavor>noble</base.image.flavor>
@@ -14,13 +24,43 @@
1424
+ <base.image.tag>${base.image.version}-${base.image.flavor}${base.image.tag.suffix}</base.image.tag>
1525
+ <!-- Suffix is defaulting to use the image with a specific Payara and Java version for development purpose -->
1626
+ <base.image.tag.suffix>-p${payara.version}-j${target.java.version}</base.image.tag.suffix>
27+
+
1728
<conf.image>gdcc/configbaker:${conf.image.tag}</conf.image>
29+
+ <!-- By default, we use the same tag as the app image for development purposes. Same rules as for app.image.tag apply! -->
1830
<conf.image.tag>${app.image.tag}</conf.image.tag>
31+
-
32+
+ <!-- Additional tags. Ignored by default (empty), used by maintenance action. -->
33+
+ <conf.image.tag.1></conf.image.tag.1>
34+
+ <conf.image.tag.2></conf.image.tag.2>
35+
+ <conf.image.flavor>alpine</conf.image.flavor>
36+
+ <conf.image.base>alpine:3.18</conf.image.base>
1937
+ <conf.skipBuild>false</conf.skipBuild>
20-
38+
+
2139
<docker.platforms></docker.platforms>
22-
23-
@@ -1046,6 +1050,9 @@
40+
-
41+
+
42+
<!-- Variables as used in docker-compose.yml -->
43+
<APP_IMAGE>${app.image}</APP_IMAGE>
44+
<POSTGRES_VERSION>${postgresql.server.version}</POSTGRES_VERSION>
45+
@@ -1088,7 +1108,7 @@
46+
<DATAVERSE_DB_USER>dataverse</DATAVERSE_DB_USER>
47+
<SKIP_DEPLOY>${app.skipDeploy}</SKIP_DEPLOY>
48+
</properties>
49+
-
50+
+
51+
<build>
52+
<plugins>
53+
<!-- Build the exploded WAR target directory -->
54+
@@ -1106,7 +1126,7 @@
55+
<configuration>
56+
</configuration>
57+
</plugin>
58+
-
59+
+
60+
<!-- Build image via Docker Maven Plugin -->
61+
<plugin>
62+
<groupId>io.fabric8</groupId>
63+
@@ -1119,6 +1139,9 @@
2464
<alias>dev_dataverse</alias>
2565
<name>${app.image}</name>
2666
<build>
@@ -30,7 +70,34 @@
3070
<buildx>
3171
<platforms>
3272
<platform>${docker.platforms}</platform>
33-
@@ -1075,6 +1082,9 @@
73+
@@ -1128,26 +1151,33 @@
74+
<args>
75+
<BASE_IMAGE>${base.image}</BASE_IMAGE>
76+
</args>
77+
+ <tags>
78+
+ <tag>${app.image.tag.1}</tag>
79+
+ <tag>${app.image.tag.2}</tag>
80+
+ </tags>
81+
<filter>@</filter>
82+
<assembly>
83+
<descriptor>assembly.xml</descriptor>
84+
</assembly>
85+
</build>
86+
-
87+
+
88+
<run>
89+
</run>
90+
-
91+
+
92+
<external>
93+
<type>compose</type>
94+
<basedir>${project.basedir}</basedir>
95+
<composeFile>docker-compose-dev.yml</composeFile>
96+
</external>
97+
</image>
98+
-
99+
+
100+
<image>
34101
<alias>dev_bootstrap</alias>
35102
<name>${conf.image}</name>
36103
<build>
@@ -40,3 +107,24 @@
40107
<buildx>
41108
<platforms>
42109
<platform>${docker.platforms}</platform>
110+
@@ -1155,14 +1185,19 @@
111+
</buildx>
112+
<dockerFile>${project.basedir}/modules/container-configbaker/Dockerfile</dockerFile>
113+
<args>
114+
+ <BASE_IMAGE>${conf.image.base}</BASE_IMAGE>
115+
<SOLR_VERSION>${SOLR_VERSION}</SOLR_VERSION>
116+
</args>
117+
+ <tags>
118+
+ <tag>${conf.image.tag.1}</tag>
119+
+ <tag>${conf.image.tag.2}</tag>
120+
+ </tags>
121+
<filter>@</filter>
122+
<assembly>
123+
<descriptor>${project.basedir}/modules/container-configbaker/assembly.xml</descriptor>
124+
</assembly>
125+
</build>
126+
-
127+
+
128+
<!--
129+
We skip the run here as it is already included in the external run config
130+
above for the main image via the docker-compose file. Even if using
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--- a/pom.xml
2+
+++ b/pom.xml
3+
@@ -1119,6 +1119,9 @@
4+
Note: During maintenance we will use the app.image.version setting from the DV parent POM.
5+
-->
6+
<app.image.tag>unstable</app.image.tag>
7+
+ <!-- Additional tags. Ignored by default (empty), used by maintenance action. -->
8+
+ <app.image.tag.1></app.image.tag.1>
9+
+ <app.image.tag.2></app.image.tag.2>
10+
<app.skipBuild>false</app.skipBuild>
11+
<app.skipDeploy>false</app.skipDeploy>
12+
13+
@@ -1133,6 +1136,9 @@
14+
<conf.image>gdcc/configbaker:${conf.image.tag}</conf.image>
15+
<!-- By default, we use the same tag as the app image for development purposes. Same rules as for app.image.tag apply! -->
16+
<conf.image.tag>${app.image.tag}</conf.image.tag>
17+
+ <!-- Additional tags. Ignored by default (empty), used by maintenance action. -->
18+
+ <conf.image.tag.1></conf.image.tag.1>
19+
+ <conf.image.tag.2></conf.image.tag.2>
20+
<conf.image.flavor>noble</conf.image.flavor>
21+
<conf.image.base>ubuntu:${conf.image.flavor}</conf.image.base>
22+
<conf.skipBuild>false</conf.skipBuild>
23+
@@ -1191,6 +1197,10 @@
24+
<!-- Workaround for fabric8io/docker-maven-plugin#1865 -->
25+
<APP_IMAGE_VERSION>${app.image.version}</APP_IMAGE_VERSION>
26+
</args>
27+
+ <tags>
28+
+ <tag>${app.image.tag.1}</tag>
29+
+ <tag>${app.image.tag.2}</tag>
30+
+ </tags>
31+
<filter>@</filter>
32+
<assembly>
33+
<descriptor>assembly.xml</descriptor>
34+
@@ -1226,6 +1236,10 @@
35+
<!-- Workaround for fabric8io/docker-maven-plugin#1865 -->
36+
<APP_IMAGE_VERSION>${app.image.version}</APP_IMAGE_VERSION>
37+
</args>
38+
+ <tags>
39+
+ <tag>${conf.image.tag.1}</tag>
40+
+ <tag>${conf.image.tag.2}</tag>
41+
+ </tags>
42+
<filter>@</filter>
43+
<assembly>
44+
<descriptor>${project.basedir}/modules/container-configbaker/assembly.xml</descriptor>

0 commit comments

Comments
 (0)