|
|
|
@ -630,17 +630,17 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') { |
|
|
|
|
name: 'prepare-updater-config', |
|
|
|
|
image: 'alpine', |
|
|
|
|
environment: { |
|
|
|
|
RELEASE_BRANCH_REGEXP: '^release-([0-9\\.x]+)$', |
|
|
|
|
MAJOR_MINOR_VERSION_REGEXP: '([0-9]+\\.[0-9]+)', |
|
|
|
|
RELEASE_TAG_REGEXP: '^([0-9]+\\.[0-9]+\\.[0-9]+)$', |
|
|
|
|
}, |
|
|
|
|
commands: [ |
|
|
|
|
'apk add --no-cache bash git', |
|
|
|
|
'git fetch origin --tags', |
|
|
|
|
'echo $(./tools/image-tag)', |
|
|
|
|
'echo $(./tools/image-tag) > .tag', |
|
|
|
|
// if the branch name matches the pattern `release-D.D.x` then RELEASE_NAME="D-D-x", otherwise RELEASE_NAME="next" |
|
|
|
|
'export RELEASE_NAME=$([[ $DRONE_SOURCE_BRANCH =~ $RELEASE_BRANCH_REGEXP ]] && echo $DRONE_SOURCE_BRANCH | grep -oE "([0-9\\.x]+)" | sed "s/\\./-/g" || echo "next")', |
|
|
|
|
'export RELEASE_TAG=$(cat .tag)', |
|
|
|
|
// if the tag matches the pattern `D.D.D` then RELEASE_NAME="D-D-x", otherwise RELEASE_NAME="next" |
|
|
|
|
'export RELEASE_NAME=$([[ $RELEASE_TAG =~ $RELEASE_TAG_REGEXP ]] && echo $RELEASE_TAG | grep -oE $MAJOR_MINOR_VERSION_REGEXP | sed "s/\\./-/g" | sed "s/$/-x/" || echo "next")', |
|
|
|
|
'echo $RELEASE_NAME', |
|
|
|
|
'export RELEASE_TAG=$(cat .tag) && echo $RELEASE_TAG', |
|
|
|
|
'echo $PLUGIN_CONFIG_TEMPLATE > %s' % configFileName, |
|
|
|
|
// replace placeholders with RELEASE_NAME and RELEASE TAG |
|
|
|
|
'sed -i "s/\\"{{release}}\\"/\\"$RELEASE_NAME\\"/g" %s' % configFileName, |
|
|
|
|