Merge pull request #5 from akloeckner/feat-arg

feat(RELEASE): allow overriding build.sh
This commit is contained in:
Florian Brinker 2021-06-04 20:43:50 +02:00 committed by GitHub
commit e89748164b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -7,7 +7,8 @@ RUN apk update \
&& update-ca-certificates && update-ca-certificates
# Download TileBoard # Download TileBoard
RUN wget -q -O release.zip "%RELEASE_URL%" \ ARG RELEASE_URL
RUN wget -q -O release.zip "${RELEASE_URL:-%RELEASE_URL%}" \
&& unzip release.zip -d /tileboard/ \ && unzip release.zip -d /tileboard/ \
&& rm release.zip && rm release.zip

View File

@ -33,11 +33,6 @@ echo "Docker repository: $docker_repo."
LATEST_RELEASE=`getVersionFromLatestRelease $source_repo` LATEST_RELEASE=`getVersionFromLatestRelease $source_repo`
echo "Latest release is: $LATEST_RELEASE." echo "Latest release is: $LATEST_RELEASE."
if docker_tag_exists $docker_repo $LATEST_RELEASE; then
echo "Nothing to do. Latest release tag already exists."
exit 78 # drone.io exit code to stop but success the pipeline
fi
SEMVER=( ${LATEST_RELEASE//./ } ) SEMVER=( ${LATEST_RELEASE//./ } )
MAJOR=${SEMVER[0]} MAJOR=${SEMVER[0]}
MINOR=${SEMVER[0]}.${SEMVER[1]} MINOR=${SEMVER[0]}.${SEMVER[1]}
@ -47,6 +42,12 @@ echo "latest,$MAJOR,$MINOR,$PATCH" > .tags
RELEASE_URL=`getDownloadUrl` RELEASE_URL=`getDownloadUrl`
echo "URL of release is: $RELEASE_URL." echo "URL of release is: $RELEASE_URL."
echo "::set-output name=release_url::$RELEASE_URL"
if docker_tag_exists $docker_repo $LATEST_RELEASE; then
echo "Nothing to do. Latest release tag already exists."
exit 78 # drone.io exit code to stop but success the pipeline
fi
echo "Writing release URL into Dockerfile..." echo "Writing release URL into Dockerfile..."
sed -i "s|%RELEASE_URL%|$RELEASE_URL|g" ./Dockerfile sed -i "s|%RELEASE_URL%|$RELEASE_URL|g" ./Dockerfile