Skip to content
Snippets Groups Projects
Commit f2a29f53 authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Refactoring: remove RELEASE_NAME from deploy targets

Append it to the configured target at the deploy class level instead.
This removes the need for eval'ing the variables before usage.
RELEASE_NAME can be used directly at the class level because it is known
from build-version.env.

This makes the deploy behavior identical to the Azure stage.
parent e136e5e2
No related branches found
No related tags found
1 merge request!334Refactoring: remove RELEASE_NAME from deploy targets
Pipeline #79060 passed with stage
in 20 minutes and 48 seconds
...@@ -153,16 +153,16 @@ deploy-{{ machine }}: ...@@ -153,16 +153,16 @@ deploy-{{ machine }}:
stage: Deploy SoftwareStore stage: Deploy SoftwareStore
variables: variables:
MACHINE: {{ machine }} MACHINE: {{ machine }}
DEPLOY_SOURCE: $${RELEASE_NAME} DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_RELEASE_TARGET} DEPLOY_TARGET: ${DEPLOY_RELEASE_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_RELEASE_TARGET_LINK} DEPLOY_TARGET_LINK: ${DEPLOY_RELEASE_TARGET_LINK}/${RELEASE_NAME}
{% else %} {% else %}
stage: Deploy SoftwareStore Internal stage: Deploy SoftwareStore Internal
variables: variables:
MACHINE: {{ machine }} MACHINE: {{ machine }}
DEPLOY_SOURCE: $${RELEASE_NAME} DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_INTERNAL_RELEASE_TARGET} DEPLOY_TARGET: ${DEPLOY_INTERNAL_RELEASE_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_INTERNAL_RELEASE_TARGET_LINK} DEPLOY_TARGET_LINK: ${DEPLOY_INTERNAL_RELEASE_TARGET_LINK}/${RELEASE_NAME}
{% endif %} {% endif %}
ASSOCIATED_PACKAGE_JOB: package-{{ machine }} ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs: needs:
...@@ -206,9 +206,9 @@ ftp-{{ machine }}: ...@@ -206,9 +206,9 @@ ftp-{{ machine }}:
- ftp - ftp
variables: variables:
MACHINE: {{ machine }} MACHINE: {{ machine }}
DEPLOY_SOURCE: $${RELEASE_NAME} DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${DEPLOY_FTP_TARGET} DEPLOY_TARGET: ${DEPLOY_FTP_TARGET}/${RELEASE_NAME}
DEPLOY_TARGET_LINK: ${DEPLOY_FTP_TARGET_LINK} DEPLOY_TARGET_LINK: ${DEPLOY_FTP_TARGET_LINK}/${RELEASE_NAME}
ASSOCIATED_PACKAGE_JOB: package-{{ machine }} ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs: needs:
- job: package-{{ machine }} - job: package-{{ machine }}
...@@ -235,8 +235,8 @@ azure-{{ machine }}: ...@@ -235,8 +235,8 @@ azure-{{ machine }}:
allow_failure: true allow_failure: true
variables: variables:
MACHINE: {{ machine }} MACHINE: {{ machine }}
DEPLOY_SOURCE: $${RELEASE_NAME} DEPLOY_SOURCE: ${RELEASE_NAME}
DEPLOY_TARGET: ${AZURE_TARGET_FOLDER}/$${RELEASE_NAME} DEPLOY_TARGET: ${AZURE_TARGET_FOLDER}/${RELEASE_NAME}
CONTAINER_NAME: ${AZURE_CONTAINER_NAME} CONTAINER_NAME: ${AZURE_CONTAINER_NAME}
ASSOCIATED_PACKAGE_JOB: package-{{ machine }} ASSOCIATED_PACKAGE_JOB: package-{{ machine }}
needs: needs:
......
...@@ -373,15 +373,6 @@ workflow: ...@@ -373,15 +373,6 @@ workflow:
# Save MACHINE for confluence stage. This variable cannot be passed directly on the # Save MACHINE for confluence stage. This variable cannot be passed directly on the
# job definition level because the confluence stage is machine-independent. # job definition level because the confluence stage is machine-independent.
- echo "MACHINE=${MACHINE}" > deploy.env - echo "MACHINE=${MACHINE}" > deploy.env
# Expand eventual nested variables contained within the DEPLOY_* variables
# FIXME: For now we need a double 'eval' here due to a GitLab bug:
# https://gitlab.com/gitlab-org/gitlab/-/issues/273409
# Escaped variables are not correctly passed to child pipelines. Proposed workaround
# is to use raw variables, but we need at least GitLab 15.6 for that. As soon as we
# update our GitLab, we can use the former mechanism using a single 'eval'.
- DEPLOY_SOURCE=$(eval eval echo "${DEPLOY_SOURCE}")
- DEPLOY_TARGET=$(eval eval echo "${DEPLOY_TARGET}")
- DEPLOY_TARGET_LINK=$(eval eval echo "${DEPLOY_TARGET_LINK}")
timeout: 60m timeout: 60m
cache: cache:
# Get the packaged artifacts from the cache # Get the packaged artifacts from the cache
......
...@@ -32,20 +32,12 @@ variables: ...@@ -32,20 +32,12 @@ variables:
.yocto-deploy: .yocto-deploy:
variables: variables:
# FIXME: For now we need a quoted dollar sign here due to a GitLab bug: DEPLOY_RELEASE_TARGET: /artifacts-yocto/Test
# https://gitlab.com/gitlab-org/gitlab/-/issues/273409 DEPLOY_RELEASE_TARGET_LINK: Z:/Development/SoftwareStore/Linux-Yocto/Test
# Escaped variables are not correctly passed to child pipelines. Proposed workaround DEPLOY_INTERNAL_RELEASE_TARGET: /artifacts-yocto/Test
# is to use raw variables, but we need at least GitLab 15.6 for that. As soon as we DEPLOY_INTERNAL_RELEASE_TARGET_LINK: Z:/Development/SoftwareStore/Linux-Yocto/Test
# update our GitLab, we can use the former mechanism using '$$RELEASE_NAME'. DEPLOY_FTP_TARGET: /artifacts-ftp-yocto/Test
DEPLOY_RELEASE_TARGET: /artifacts-yocto/Test/"$"{RELEASE_NAME} DEPLOY_FTP_TARGET_LINK: http://support.garz-fricke.com/projects/Linux-Yocto/Test
DEPLOY_RELEASE_TARGET_LINK: >-
Z:/Development/SoftwareStore/Linux-Yocto/Test/"$"{RELEASE_NAME}
DEPLOY_INTERNAL_RELEASE_TARGET: /artifacts-yocto/Test/"$"{RELEASE_NAME}
DEPLOY_INTERNAL_RELEASE_TARGET_LINK: >-
Z:/Development/SoftwareStore/Linux-Yocto/Test/"$"{RELEASE_NAME}
DEPLOY_FTP_TARGET: /artifacts-ftp-yocto/Test/"$"{RELEASE_NAME}
DEPLOY_FTP_TARGET_LINK: >-
http://support.garz-fricke.com/projects/Linux-Yocto/Test/"$"{RELEASE_NAME}
AZURE_TARGET_FOLDER: HMI/Linux-Yocto/Test AZURE_TARGET_FOLDER: HMI/Linux-Yocto/Test
AZURE_CONTAINER_NAME: seco-ne-public AZURE_CONTAINER_NAME: seco-ne-public
......
...@@ -28,34 +28,26 @@ variables: ...@@ -28,34 +28,26 @@ variables:
.yocto-deploy: .yocto-deploy:
variables: variables:
# FIXME: For now we need a quoted dollar sign here due to a GitLab bug: DEPLOY_RELEASE_TARGET: /artifacts-yocto/Releases
# https://gitlab.com/gitlab-org/gitlab/-/issues/273409 DEPLOY_RELEASE_TARGET_LINK: Z:/Development/SoftwareStore/Linux-Yocto/Releases
# Escaped variables are not correctly passed to child pipelines. Proposed workaround DEPLOY_INTERNAL_RELEASE_TARGET: /artifacts-yocto/Interne_Releases
# is to use raw variables, but we need at least GitLab 15.6 for that. As soon as we
# update our GitLab, we can use the former mechanism using '$$RELEASE_NAME'.
DEPLOY_RELEASE_TARGET: /artifacts-yocto/Releases/"$"{RELEASE_NAME}
DEPLOY_RELEASE_TARGET_LINK: >-
Z:/Development/SoftwareStore/Linux-Yocto/Releases/"$"{RELEASE_NAME}
DEPLOY_INTERNAL_RELEASE_TARGET: /artifacts-yocto/Interne_Releases/"$"{RELEASE_NAME}
DEPLOY_INTERNAL_RELEASE_TARGET_LINK: >- DEPLOY_INTERNAL_RELEASE_TARGET_LINK: >-
Z:/Development/SoftwareStore/Linux-Yocto/Interne_Releases/"$"{RELEASE_NAME} Z:/Development/SoftwareStore/Linux-Yocto/Interne_Releases
DEPLOY_FTP_TARGET: /artifacts-ftp-yocto/Releases/"$"{RELEASE_NAME} DEPLOY_FTP_TARGET: /artifacts-ftp-yocto/Releases/
DEPLOY_FTP_TARGET_LINK: >- DEPLOY_FTP_TARGET_LINK: >-
http://support.garz-fricke.com/projects/Linux-Yocto/Releases/"$"{RELEASE_NAME} http://support.garz-fricke.com/projects/Linux-Yocto/Releases/
AZURE_TARGET_FOLDER: HMI/Linux-Yocto/Releases AZURE_TARGET_FOLDER: HMI/Linux-Yocto/Releases
AZURE_CONTAINER_NAME: seco-ne-public AZURE_CONTAINER_NAME: seco-ne-public
.fngsystem-deploy: .fngsystem-deploy:
variables: variables:
DEPLOY_RELEASE_TARGET: /artifacts-fngsystem/"$"{RELEASE_NAME} DEPLOY_RELEASE_TARGET: /artifacts-fngsystem
DEPLOY_RELEASE_TARGET_LINK: >- DEPLOY_RELEASE_TARGET_LINK: Z:/Development/SoftwareStore/Flash-N-Go/FNGSystem
Z:/Development/SoftwareStore/Flash-N-Go/FNGSystem/"$"{RELEASE_NAME} DEPLOY_INTERNAL_RELEASE_TARGET: /artifacts-fngsystem/CI_Builds
DEPLOY_INTERNAL_RELEASE_TARGET: /artifacts-fngsystem/CI_Builds/"$"{RELEASE_NAME}
DEPLOY_INTERNAL_RELEASE_TARGET_LINK: >- DEPLOY_INTERNAL_RELEASE_TARGET_LINK: >-
Z:/Development/SoftwareStore/Flash-N-Go/FNGSystem/CI_Builds/"$"{RELEASE_NAME} Z:/Development/SoftwareStore/Flash-N-Go/FNGSystem/CI_Builds
DEPLOY_FTP_TARGET: /artifacts-ftp-fngsystem/"$"{RELEASE_NAME} DEPLOY_FTP_TARGET: /artifacts-ftp-fngsystem
DEPLOY_FTP_TARGET_LINK: >- DEPLOY_FTP_TARGET_LINK: http://support.garz-fricke.com/projects/Flash-N-Go/FNGSystem
http://support.garz-fricke.com/projects/Flash-N-Go/FNGSystem/"$"{RELEASE_NAME}
AZURE_TARGET_FOLDER: HMI/Flash-N-Go/FNGSystem AZURE_TARGET_FOLDER: HMI/Flash-N-Go/FNGSystem
AZURE_CONTAINER_NAME: seco-ne-public AZURE_CONTAINER_NAME: seco-ne-public
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment