Skip to content
Snippets Groups Projects
Commit 354c26bb authored by Toby Griffiths's avatar Toby Griffiths
Browse files

Add job_name_prefix as per full-pipeline template

Similar to !153 this adds support for job name prefixes when using these templates.
parent 72675b76
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,9 @@ spec: ...@@ -70,6 +70,9 @@ spec:
description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.' description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
# Configuration # Configuration
job_name_prefix:
default: ''
description: 'Prefix for all job names. Jobs will be hidden if leading with a dot `.`.'
root_dir: root_dir:
default: ${CI_PROJECT_DIR} default: ${CI_PROJECT_DIR}
description: 'Root directory for the OpenTofu project.' description: 'Root directory for the OpenTofu project.'
...@@ -89,7 +92,7 @@ spec: ...@@ -89,7 +92,7 @@ spec:
include: include:
- local: '/templates/fmt.yml' - local: '/templates/fmt.yml'
inputs: inputs:
as: 'fmt' as: '$[[ inputs.job_name_prefix ]]fmt'
stage: $[[ inputs.stage_validate ]] stage: $[[ inputs.stage_validate ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -100,7 +103,7 @@ include: ...@@ -100,7 +103,7 @@ include:
root_dir: $[[ inputs.root_dir ]] root_dir: $[[ inputs.root_dir ]]
- local: '/templates/validate.yml' - local: '/templates/validate.yml'
inputs: inputs:
as: 'validate' as: '$[[ inputs.job_name_prefix ]]validate'
stage: $[[ inputs.stage_validate ]] stage: $[[ inputs.stage_validate ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -112,7 +115,7 @@ include: ...@@ -112,7 +115,7 @@ include:
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
- local: '/templates/plan.yml' - local: '/templates/plan.yml'
inputs: inputs:
as: 'plan' as: '$[[ inputs.job_name_prefix ]]plan'
stage: $[[ inputs.stage_build ]] stage: $[[ inputs.stage_build ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -125,7 +128,7 @@ include: ...@@ -125,7 +128,7 @@ include:
artifacts_access: $[[ inputs.plan_artifacts_access ]] artifacts_access: $[[ inputs.plan_artifacts_access ]]
- local: '/templates/apply.yml' - local: '/templates/apply.yml'
inputs: inputs:
as: 'apply' as: '$[[ inputs.job_name_prefix ]]apply'
stage: $[[ inputs.stage_deploy ]] stage: $[[ inputs.stage_deploy ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
......
...@@ -70,6 +70,9 @@ spec: ...@@ -70,6 +70,9 @@ spec:
description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.' description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
# Configuration # Configuration
job_name_prefix:
default: ''
description: 'Prefix for all job names. Jobs will be hidden if leading with a dot `.`.'
root_dir: root_dir:
default: ${CI_PROJECT_DIR} default: ${CI_PROJECT_DIR}
description: 'Root directory for the OpenTofu project.' description: 'Root directory for the OpenTofu project.'
...@@ -92,7 +95,7 @@ spec: ...@@ -92,7 +95,7 @@ spec:
include: include:
- local: '/templates/fmt.yml' - local: '/templates/fmt.yml'
inputs: inputs:
as: 'fmt' as: '$[[ inputs.job_name_prefix ]]fmt'
stage: $[[ inputs.stage_validate ]] stage: $[[ inputs.stage_validate ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -103,7 +106,7 @@ include: ...@@ -103,7 +106,7 @@ include:
root_dir: $[[ inputs.root_dir ]] root_dir: $[[ inputs.root_dir ]]
- local: '/templates/validate.yml' - local: '/templates/validate.yml'
inputs: inputs:
as: 'validate' as: '$[[ inputs.job_name_prefix ]]validate'
stage: $[[ inputs.stage_validate ]] stage: $[[ inputs.stage_validate ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -115,7 +118,7 @@ include: ...@@ -115,7 +118,7 @@ include:
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
- local: '/templates/plan.yml' - local: '/templates/plan.yml'
inputs: inputs:
as: 'plan' as: '$[[ inputs.job_name_prefix ]]plan'
stage: $[[ inputs.stage_build ]] stage: $[[ inputs.stage_build ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -130,7 +133,7 @@ include: ...@@ -130,7 +133,7 @@ include:
destroy: true destroy: true
- local: '/templates/destroy.yml' - local: '/templates/destroy.yml'
inputs: inputs:
as: 'destroy' as: '$[[ inputs.job_name_prefix ]]destroy'
stage: $[[ inputs.stage_cleanup ]] stage: $[[ inputs.stage_cleanup ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -145,7 +148,7 @@ include: ...@@ -145,7 +148,7 @@ include:
auto_destroy: $[[ inputs.auto_destroy ]] auto_destroy: $[[ inputs.auto_destroy ]]
- local: '/templates/delete-state.yml' - local: '/templates/delete-state.yml'
inputs: inputs:
as: 'delete-state' as: '$[[ inputs.job_name_prefix ]]delete-state'
stage: $[[ inputs.stage_cleanup ]] stage: $[[ inputs.stage_cleanup ]]
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
......
...@@ -67,6 +67,9 @@ spec: ...@@ -67,6 +67,9 @@ spec:
description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.' description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
# Configuration # Configuration
job_name_prefix:
default: ''
description: 'Prefix for all job names. Jobs will be hidden if leading with a dot `.`.'
root_dir: root_dir:
default: ${CI_PROJECT_DIR} default: ${CI_PROJECT_DIR}
description: 'Root directory for the OpenTofu project.' description: 'Root directory for the OpenTofu project.'
...@@ -82,7 +85,7 @@ spec: ...@@ -82,7 +85,7 @@ spec:
include: include:
- local: '/templates/fmt.yml' - local: '/templates/fmt.yml'
inputs: inputs:
as: 'fmt' as: '$[[ inputs.job_name_prefix ]]fmt'
stage: $[[ inputs.stage_validate ]] stage: $[[ inputs.stage_validate ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -93,7 +96,7 @@ include: ...@@ -93,7 +96,7 @@ include:
root_dir: $[[ inputs.root_dir ]] root_dir: $[[ inputs.root_dir ]]
- local: '/templates/validate.yml' - local: '/templates/validate.yml'
inputs: inputs:
as: 'validate' as: '$[[ inputs.job_name_prefix ]]validate'
stage: $[[ inputs.stage_validate ]] stage: $[[ inputs.stage_validate ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
...@@ -105,7 +108,7 @@ include: ...@@ -105,7 +108,7 @@ include:
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
- local: '/templates/plan.yml' - local: '/templates/plan.yml'
inputs: inputs:
as: 'plan' as: '$[[ inputs.job_name_prefix ]]plan'
stage: $[[ inputs.stage_build ]] stage: $[[ inputs.stage_build ]]
version: $[[ inputs.version ]] version: $[[ inputs.version ]]
base_os: $[[ inputs.base_os ]] base_os: $[[ inputs.base_os ]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment