Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIGOV-27569 - fix last tag variable name #88

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ variables:
# Blackduck
BLACKDUCK_PROJECT_NAME: "Amplify - APIC Kong Agents"

GIT_TAG_PREFIX: v

include:
- project: "apigov/gitlabci"
ref: master
Expand Down Expand Up @@ -42,9 +40,9 @@ include:

.get-latest-tag: &get-latest-tag |
if [ $(git --version | grep -Eo '2.*') ]; then
export LATEST_TAG=$(git tag -l --sort="version:refname" | grep -Eo '[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,3}$' | tail -1)
export LAST_TAG_VERSION=$(git tag -l --sort="version:refname" | grep -Eo '^v?[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,3}$' | tail -1)
else
export LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
export LAST_TAG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
fi

stages:
Expand Down Expand Up @@ -84,7 +82,7 @@ twistlock-discovery:on-schedule:
before_script:
- apk --no-cache update && apk add git
- *get-latest-tag
- export IMAGE_NAME=ghcr.io/axway/kong_discovery_agent:${GIT_TAG_PREFIX}${LATEST_TAG}
- export IMAGE_NAME=ghcr.io/axway/kong_discovery_agent:${LAST_TAG_VERSION}
- docker pull ${IMAGE_NAME}

twistlock-traceability:on-schedule:
Expand All @@ -95,7 +93,7 @@ twistlock-traceability:on-schedule:
before_script:
- apk --no-cache update && apk add git
- *get-latest-tag
- export IMAGE_NAME=ghcr.io/axway/kong_traceability_agent:${GIT_TAG_PREFIX}${LATEST_TAG}
- export IMAGE_NAME=ghcr.io/axway/kong_traceability_agent:${LAST_TAG_VERSION}
- docker pull ${IMAGE_NAME}

blackduck:on-schedule:
Expand All @@ -106,8 +104,8 @@ blackduck:on-schedule:
- git config --global url."ssh://[email protected]".insteadOf "https://git.ecd.axway.org"''
- git fetch
- *get-latest-tag
- echo "Checking out ${GIT_TAG_PREFIX}${LATEST_TAG}"
- git checkout ${GIT_TAG_PREFIX}${LATEST_TAG}
- echo "Checking out ${LAST_TAG_VERSION}"
- git checkout ${LAST_TAG_VERSION}

# overridden from csrjobs.yml because mirror repos like this one don't get merge events
fortify:
Expand Down