Patch workflow

This commit is contained in:
lowlighter
2021-03-14 17:57:01 +01:00
parent f5f87fa6bf
commit d91cbce9dc
3 changed files with 25 additions and 31 deletions

View File

@@ -119,7 +119,7 @@ jobs:
dryrun: yes
use_mocked_data: yes
verify: yes
use_prebuilt_image: master
use_prebuilt_image: no
# Build docker image from master and publish it to GitHub registry with release tag
docker-release:

View File

@@ -959,24 +959,21 @@ runs:
# Image name
# Official action
if [[ $METRICS_SOURCE == "lowlighter" ]]; then
# Use registry with pre-built images
if [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then
# Is released version
set +e
METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0)
set -e
echo "Is released version: $METRICS_IS_RELEASED"
# Use registry for released version
if [[ "$METRICS_IS_RELEASED" -gt "0" ]]; then
echo "Using released version $METRICS_TAG, will pull docker image from GitHub registry"
METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG
docker image pull $METRICS_IMAGE
# Use registry for unreleased version with pre-built images
elif [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then
if [[ "$METRICS_IS_RELEASED" -eq "0" ]]; then
METRICS_TAG="$METRICS_TAG-beta"
echo "Image tag (updated): $METRICS_TAG"
echo "Using pre-built version $METRICS_TAG, will pull docker image from GitHub registry"
fi
METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG
echo "Using pre-built version $METRICS_TAG, will pull docker image from GitHub registry"
docker image pull $METRICS_IMAGE
# Rebuild image for unreleased version
# Rebuild image
else
echo "Using an unreleased version ($METRICS_VERSION)"
METRICS_IMAGE=metrics:$METRICS_VERSION

View File

@@ -56,24 +56,21 @@ runs:
# Image name
# Official action
if [[ $METRICS_SOURCE == "lowlighter" ]]; then
# Use registry with pre-built images
if [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then
# Is released version
set +e
METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0)
set -e
echo "Is released version: $METRICS_IS_RELEASED"
# Use registry for released version
if [[ "$METRICS_IS_RELEASED" -gt "0" ]]; then
echo "Using released version $METRICS_TAG, will pull docker image from GitHub registry"
METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG
docker image pull $METRICS_IMAGE
# Use registry for unreleased version with pre-built images
elif [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then
if [[ "$METRICS_IS_RELEASED" -eq "0" ]]; then
METRICS_TAG="$METRICS_TAG-beta"
echo "Image tag (updated): $METRICS_TAG"
echo "Using pre-built version $METRICS_TAG, will pull docker image from GitHub registry"
fi
METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG
echo "Using pre-built version $METRICS_TAG, will pull docker image from GitHub registry"
docker image pull $METRICS_IMAGE
# Rebuild image for unreleased version
# Rebuild image
else
echo "Using an unreleased version ($METRICS_VERSION)"
METRICS_IMAGE=metrics:$METRICS_VERSION