mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-550 Disable Docker image push on Continuous Releases
This commit is contained in:
@@ -189,16 +189,15 @@
|
||||
</build>
|
||||
</image>
|
||||
<!-- DockerHub image -->
|
||||
<!-- todo enable when the dockerhub credentials are set on the project -->
|
||||
<!-- <image>-->
|
||||
<!-- <name>${image.name}:${image.tag}</name>-->
|
||||
<!-- <build>-->
|
||||
<!-- <dockerFileDir>${project.basedir}/</dockerFileDir>-->
|
||||
<!-- <buildOptions>-->
|
||||
<!-- <squash>true</squash>-->
|
||||
<!-- </buildOptions>-->
|
||||
<!-- </build>-->
|
||||
<!-- </image>-->
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
<buildOptions>
|
||||
<squash>true</squash>
|
||||
</buildOptions>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<executions>
|
||||
@@ -217,7 +216,7 @@
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<id>releaseImage</id>
|
||||
<!-- publishes "image:release_version" on Quay & DockerHub -->
|
||||
<build>
|
||||
<plugins>
|
||||
@@ -238,16 +237,15 @@
|
||||
</build>
|
||||
</image>
|
||||
<!-- DockerHub image -->
|
||||
<!-- todo enable when the dockerhub credentials are set on the project -->
|
||||
<!-- <image>-->
|
||||
<!-- <name>${image.name}:${project.version}</name>-->
|
||||
<!-- <build>-->
|
||||
<!-- <dockerFileDir>${project.basedir}/</dockerFileDir>-->
|
||||
<!-- <buildOptions>-->
|
||||
<!-- <squash>true</squash>-->
|
||||
<!-- </buildOptions>-->
|
||||
<!-- </build>-->
|
||||
<!-- </image>-->
|
||||
<image>
|
||||
<name>${image.name}:${project.version}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
<buildOptions>
|
||||
<squash>true</squash>
|
||||
</buildOptions>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<executions>
|
||||
@@ -256,7 +254,8 @@
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
<!-- Image push is DISABLED, so Continuous Releases don't pollute the repository -->
|
||||
<!--<goal>push</goal>-->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@@ -12,8 +12,8 @@ git config user.email "${GIT_EMAIL}"
|
||||
|
||||
# Run the release plugin - with "[skip ci]" in the release commit message
|
||||
mvn -B \
|
||||
-Prelease,fullBuild,all-tas-tests \
|
||||
"-Darguments=-Prelease,fullBuild,all-tas-tests -DskipTests -Dbuild-number=${TRAVIS_BUILD_NUMBER}" \
|
||||
-PfullBuild,all-tas-tests \
|
||||
"-Darguments=-PfullBuild,all-tas-tests -DskipTests -Dbuild-number=${TRAVIS_BUILD_NUMBER}" \
|
||||
release:clean release:prepare release:perform \
|
||||
-DscmCommentPrefix="[maven-release-plugin][skip ci] " \
|
||||
-Dusername="${GIT_USERNAME}" \
|
||||
|
@@ -5,47 +5,19 @@ set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
|
||||
|
||||
#
|
||||
# Check that the version to be released does not already have a docker tag.
|
||||
# Check that the version to be released does not already have a git tag.
|
||||
#
|
||||
|
||||
POM_VERSION=$(mvn -B -q help:evaluate -Dexpression=project.version -DforceStdout)
|
||||
printf "POM version: %s\n" "${POM_VERSION}"
|
||||
|
||||
IMAGE_TAG="${POM_VERSION%-SNAPSHOT}"
|
||||
TAG="${POM_VERSION%-SNAPSHOT}"
|
||||
|
||||
if git rev-parse "${IMAGE_TAG}^{tag}" &>/dev/null ; then
|
||||
echo "The next tag \"${IMAGE_TAG}\" already exists in the git project"
|
||||
if git rev-parse "${TAG}^{tag}" &>/dev/null ; then
|
||||
echo "The next tag \"${TAG}\" already exists in the git project"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# get the image name from the pom file
|
||||
ALFRESCO_DOCKER_IMAGE="$(mvn -B -q help:evaluate -f ./packaging/docker-alfresco/pom.xml -Dexpression=image.name -DforceStdout)"
|
||||
DOCKER_IMAGE_FULL_NAME="${ALFRESCO_DOCKER_IMAGE}:${IMAGE_TAG}"
|
||||
|
||||
function docker_image_exists() {
|
||||
local IMAGE_FULL_NAME="${1}"; shift
|
||||
local WAIT_TIME="${1:-5}"
|
||||
local SEARCH_TERM='Pulling|is up to date|not found'
|
||||
|
||||
echo "Looking to see if ${IMAGE_FULL_NAME} already exists..."
|
||||
local RESULT=$( (timeout --preserve-status "${WAIT_TIME}" docker 2>&1 pull "${IMAGE_FULL_NAME}" &) | grep -v 'Pulling repository' | grep -E -o "${SEARCH_TERM}")
|
||||
|
||||
test "${RESULT}" || { echo "Timed out too soon. Try using a wait_time greater than ${WAIT_TIME}..."; return 1 ;}
|
||||
if echo "${RESULT}" | grep -vq 'not found'; then
|
||||
true
|
||||
else
|
||||
false
|
||||
fi
|
||||
}
|
||||
|
||||
if docker_image_exists "${DOCKER_IMAGE_FULL_NAME}" ; then
|
||||
echo "Tag ${RELEASE_VERSION} already pushed, release process will interrupt."
|
||||
exit 1
|
||||
else
|
||||
echo "The ${RELEASE_VERSION} tag was not found"
|
||||
fi
|
||||
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing Verify Release Tag Script =========================="
|
||||
|
Reference in New Issue
Block a user