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

Move reusable parts from CI-Test to common

parent 3d3b4d09
No related branches found
No related tags found
1 merge request!230Add new deploy pipeline to yocto
......@@ -55,6 +55,7 @@ workflow:
# Stage: build
# --------------------------------------------------------------------------------------
.buildbase:
stage: Build
tags:
- builds
timeout: 8h
......@@ -72,6 +73,31 @@ workflow:
- "--id=118:998"
artifacts:
expire_in: 4 weeks
reports:
dotenv: build.env
.build_image:
artifacts:
paths: &build_image_artifacts_paths
- build-*/tmp/deploy/images/**/*
- build-*/tmp/deploy/licenses/**/license.manifest
- build.env
cache:
# Cache the build artifacts for subsequent stages in the same pipeline
- key: ${CI_PIPELINE_ID}-${CI_JOB_NAME}
policy: push
paths: *build_image_artifacts_paths
.build_sdk:
artifacts:
paths: &build_sdk_artifacts_paths
- build-*/tmp/deploy/sdk/*
- build.env
cache:
# Cache the build artifacts for subsequent stages in the same pipeline
- key: ${CI_PIPELINE_ID}-${CI_JOB_NAME}
policy: push
paths: *build_sdk_artifacts_paths
# --------------------------------------------------------------------------------------
# Stage: test
......@@ -130,6 +156,7 @@ workflow:
.package:
extends:
- .infrastructure
stage: Package
tags:
# Using misc runner because it runs on the same machine as the build runner. This
# is the only way of being able to use the cache between build and package jobs.
......@@ -144,7 +171,18 @@ workflow:
# We do this manually since we do not use GitLab's default artifact downloader
- source build.env
.package-release:
.pull_build_cache: &pull_build_cache
key: ${CI_PIPELINE_ID}-${ASSOCIATED_BUILD_JOB}
policy: pull
.push_package_cache: &push_package_cache
key: ${CI_PIPELINE_ID}-${CI_JOB_NAME}
policy: push
paths:
- release
- package.env
.package_release:
extends:
- .package
script:
......@@ -155,8 +193,12 @@ workflow:
--doc-dir=.
--output-dir=release
--release-suffix="${RELEASE_SUFFIX}"
cache:
- <<: *pull_build_cache
paths: *build_image_artifacts_paths
- *push_package_cache
.package-sdk:
.package_sdk:
extends:
- .package
script:
......@@ -165,6 +207,10 @@ workflow:
--sdk-dir="${BUILD_PATH_SDK}"
--output-dir=release
--release-suffix="${RELEASE_SUFFIX}"
cache:
- <<: *pull_build_cache
paths: *build_sdk_artifacts_paths
- *push_package_cache
# --------------------------------------------------------------------------------------
# Stage: deploy
......@@ -194,6 +240,12 @@ workflow:
sed -e "s#^#${DEPLOY_TARGET_LINK}/#" | tee files.txt
- printf "Successfully deployed to:\n%s\n" "${DEPLOY_TARGET_LINK}"
timeout: 60m
cache:
# Get the packaged artifacts from the cache
- key: ${CI_PIPELINE_ID}-${ASSOCIATED_PACKAGE_JOB}
policy: pull
paths:
- release
artifacts:
paths:
- files.txt
......@@ -204,9 +256,10 @@ workflow:
# --------------------------------------------------------------------------------------
# Stage: Alphaplan
# --------------------------------------------------------------------------------------
.generate-alphaplan-data:
.generate_alphaplan_data:
extends:
- .infrastructure
stage: Alphaplan
script:
# MACHINE and RELEASE_NAME are available from deploy.env
- .gitlab-ci/scripts/generate_alphaplan_fwr_file.py
......@@ -218,9 +271,10 @@ workflow:
paths:
- alphaplan-import*.json
.import-alphaplan-data:
.import_alphaplan_data:
extends:
- .infrastructure
stage: Alphaplan
rules:
- when: manual
variables:
......
......@@ -86,16 +86,12 @@ build:check-foo-branch:
exit 1
fi
.simulate-build:
stage: Build
.simulate_build:
extends:
- .buildbase
tags:
- misc
timeout: 60m
rules:
- when: manual
allow_failure: true
variables:
BUILD_ARTIFACTS:
script:
......@@ -103,41 +99,36 @@ build:check-foo-branch:
- echo "Getting Yocto build artifacts"
- wget -O artifacts.zip ${BUILD_ARTIFACTS}
- unzip artifacts.zip
artifacts:
reports:
dotenv: build.env
simulate-build-seco-mx6:
extends:
- .simulate-build
- .simulate_build
- .build_image
variables:
# We have to specify a tag here instead of getting the artifacts from a master
# branch, because we don't always execute the full pipeline on the master branches.
# In those cases the actual build job does not exist, which results in a 404 error.
BUILD_ARTIFACTS: https://git.seco.com/seco-ne/yocto/manifest/-/jobs/artifacts/kirkstone/3.0/download?job=build-seco-mx6
artifacts:
paths: &build_artifacts_paths
- build-*/tmp/deploy/images/**/*
- build-*/tmp/deploy/licenses/**/license.manifest
- build.env
cache:
# Cache the build artifacts for re-runs of the job in other pipelines
- !reference [.build_image, cache]
# Additionally cache the build artifacts for re-runs of this job in other pipelines
- key: ${CI_JOB_NAME}-${BUILD_ARTIFACTS}
paths: *build_artifacts_paths
# Cache the build artifacts for subsequent stages in the same pipeline
- key: ${CI_PIPELINE_ID}-build-seco-mx6
policy: push
paths: *build_artifacts_paths
paths: !reference [.build_image, artifacts, paths]
simulate-buildsdk-seco-mx6:
extends:
- .simulate-build
- .simulate_build
- .build_sdk
rules:
- when: manual
allow_failure: true
variables:
BUILD_ARTIFACTS: https://git.seco.com/seco-ne/yocto/manifest/-/jobs/artifacts/kirkstone/3.0/download?job=buildsdk-seco-mx6
artifacts:
paths:
- build-*/tmp/deploy/sdk/*
- build.env
cache:
- !reference [.build_sdk, cache]
# Additionally cache the build artifacts for re-runs of this job in other pipelines
- key: ${CI_JOB_NAME}-${BUILD_ARTIFACTS}
paths: !reference [.build_sdk, artifacts, paths]
# --------------------------------------------------------------------------------------
# Stage: Test
......@@ -181,33 +172,25 @@ smoketest:seco-mx6:
# Stage: Package
# --------------------------------------------------------------------------------------
package-seco-mx6:
extends: .package-release
stage: Package
extends: .package_release
variables:
ASSOCIATED_BUILD_JOB: simulate-build-seco-mx6
needs:
- job: simulate-build-seco-mx6
artifacts: false
cache:
# Get the build artifacts from the cache
- key: ${CI_PIPELINE_ID}-build-seco-mx6
policy: pull
paths: *build_artifacts_paths
# Push the packaged artifacts to the cache
- key: ${CI_PIPELINE_ID}-package-seco-mx6
policy: push
paths:
- release
- package.env
package-sdk-seco-mx6:
extends: .package-sdk
stage: Package
extends: .package_sdk
variables:
ASSOCIATED_BUILD_JOB: simulate-buildsdk-seco-mx6
needs:
- simulate-buildsdk-seco-mx6
- job: simulate-buildsdk-seco-mx6
artifacts: false
# --------------------------------------------------------------------------------------
# Stage: Deploy SoftwareStore
# --------------------------------------------------------------------------------------
.deploy-software-store:
.deploy_software_store:
extends: .deploy
stage: Deploy SoftwareStore
variables:
......@@ -223,7 +206,7 @@ package-sdk-seco-mx6:
DEPLOY_TARGET_LINK: Z:/Development/SoftwareStore/Linux-Yocto/Test/$${RELEASE_NAME}
deploy-files:
extends: .deploy-software-store
extends: .deploy_software_store
variables:
GIT_STRATEGY: none
DEPLOY_SOURCE: .
......@@ -233,26 +216,25 @@ deploy-files:
- build:files
deploy-seco-mx6:
extends: .deploy-software-store
extends: .deploy_software_store
variables:
ASSOCIATED_PACKAGE_JOB: package-seco-mx6
needs:
- job: package-seco-mx6
artifacts: false
cache:
# Get the packaged artifacts from the cache
- key: ${CI_PIPELINE_ID}-package-seco-mx6
policy: pull
paths:
- release
deploy-sdk-seco-mx6:
extends: .deploy-software-store
extends: .deploy_software_store
variables:
ASSOCIATED_PACKAGE_JOB: package-sdk-seco-mx6
needs:
- package-sdk-seco-mx6
- job: package-sdk-seco-mx6
artifacts: false
# --------------------------------------------------------------------------------------
# Stage: Deploy FTP
# --------------------------------------------------------------------------------------
.deploy-ftp:
.deploy_ftp:
extends: .deploy
stage: Deploy FTP
variables:
......@@ -262,7 +244,7 @@ deploy-sdk-seco-mx6:
DEPLOY_TARGET_LINK: http://support.garz-fricke.com/projects/Linux-Yocto/Test/${RELEASE_NAME}
ftp-files:
extends: .deploy-ftp
extends: .deploy_ftp
variables:
GIT_STRATEGY: none
DEPLOY_SOURCE: .
......@@ -272,33 +254,31 @@ ftp-files:
- build:files
ftp-seco-mx6:
extends: .deploy-ftp
extends: .deploy_ftp
variables:
ASSOCIATED_PACKAGE_JOB: package-seco-mx6
needs:
- job: package-seco-mx6
artifacts: false
cache:
- key: ${CI_PIPELINE_ID}-package-seco-mx6
policy: pull
paths:
- release
ftp-sdk-seco-mx6:
extends: .deploy-ftp
extends: .deploy_ftp
variables:
ASSOCIATED_PACKAGE_JOB: package-sdk-seco-mx6
needs:
- package-sdk-seco-mx6
- job: package-sdk-seco-mx6
artifacts: false
# --------------------------------------------------------------------------------------
# Stage: Alphaplan
# --------------------------------------------------------------------------------------
generate-alphaplan-data-seco-mx6:
extends: .generate-alphaplan-data
stage: Alphaplan
extends: .generate_alphaplan_data
needs:
- deploy-seco-mx6
import-alphaplan-data-seco-mx6:
extends: .import-alphaplan-data
stage: Alphaplan
extends: .import_alphaplan_data
variables:
AP_WEBSERVICE_URL: https://SRV06.hamburg.garz-fricke.de/Test/Alphaplan-API/Artikel/CreateFirmware
needs:
......
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