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

Confluence: add supported hardware information

parent 0ef32ce7
No related branches found
No related tags found
1 merge request!341Confluence: add supported hardware information
Pipeline #82887 passed with stage
in 26 minutes and 49 seconds
...@@ -69,6 +69,18 @@ build-{{ machine }}: ...@@ -69,6 +69,18 @@ build-{{ machine }}:
# branch, because we don't always execute the full pipeline on the master branches. # 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. # In those cases the actual build job does not exist, which results in a 404 error.
BUILD_ARTIFACTS: ${BUILD_ARTIFACTS_PREFIX}-{{ machine }} BUILD_ARTIFACTS: ${BUILD_ARTIFACTS_PREFIX}-{{ machine }}
after_script:
# FIXME: This is necessary because we're using an old build for the build simulation
# which does not export these variables, yet. Can be removed as soon as we switch to
# a newer release already containing these variables.
- source build.env
# yamllint disable-line rule:line-length
{%- if machine == "seco-mx6" %}
- export SUPPORTED_HARDWARE=" SANTARO, SANTOKA, SANTINO, SANTINO LT, SANTVEND, "
{%- elif machine == "seco-mx8mm" %}
- export SUPPORTED_HARDWARE=" TANARO, "
{%- endif %}
- !reference [.save_build_env]
{% endif %} {% endif %}
......
...@@ -127,6 +127,8 @@ workflow: ...@@ -127,6 +127,8 @@ workflow:
- echo "DISTRO_RELEASE_ARTEFACTS='${DISTRO_RELEASE_ARTEFACTS}'" >> build.env - echo "DISTRO_RELEASE_ARTEFACTS='${DISTRO_RELEASE_ARTEFACTS}'" >> build.env
# Install script location is needed in test job # Install script location is needed in test job
- echo "FNG_INSTALL_URL=${FNG_INSTALL_URL}" >> build.env - echo "FNG_INSTALL_URL=${FNG_INSTALL_URL}" >> build.env
# Supported hardware is needed for Confluence release page
- echo "SUPPORTED_HARDWARE='${SUPPORTED_HARDWARE}'" >> build.env
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
# Stage: Infrastructure # Stage: Infrastructure
...@@ -464,9 +466,13 @@ workflow: ...@@ -464,9 +466,13 @@ workflow:
- .gitlab-ci/scripts/render_jinja2_template.py - .gitlab-ci/scripts/render_jinja2_template.py
--template="${PAGE_TEMPLATE}" --template="${PAGE_TEMPLATE}"
> confluence-page.xml > confluence-page.xml
- .gitlab-ci/scripts/render_jinja2_template.py
--template=.gitlab-ci/confluence-labels.txt.jinja2
> confluence-labels.txt
artifacts: artifacts:
paths: paths:
- confluence-page.xml - confluence-page.xml
- confluence-labels.txt
.publish-confluence-page: .publish-confluence-page:
extends: extends:
...@@ -479,6 +485,10 @@ workflow: ...@@ -479,6 +485,10 @@ workflow:
- generate-confluence-page - generate-confluence-page
- build-version - build-version
script: script:
- LABEL_ARGS=""
- while IFS= read -r line; do
[ -n "$line" ] && LABEL_ARGS="${LABEL_ARGS} --label=$line";
done < confluence-labels.txt
- .gitlab-ci/scripts/confluence_create_or_update_page.py - .gitlab-ci/scripts/confluence_create_or_update_page.py
--username="${CONFLUENCE_USERNAME}" --username="${CONFLUENCE_USERNAME}"
--token="${CONFLUENCE_TOKEN}" --token="${CONFLUENCE_TOKEN}"
...@@ -487,6 +497,7 @@ workflow: ...@@ -487,6 +497,7 @@ workflow:
--page-name="${RELEASE_NAME}" --page-name="${RELEASE_NAME}"
--content-file=confluence-page.xml --content-file=confluence-page.xml
--label="os-release" --label="os-release"
${LABEL_ARGS}
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
......
{%- for hardware in SUPPORTED_HARDWARE.split(',') | sort %}
{%- if hardware | trim | length %}
{{ hardware | trim | lower | replace(" ", "-")}}
{%- endif %}
{%- endfor %}
...@@ -23,6 +23,16 @@ ...@@ -23,6 +23,16 @@
{%- endfor %} {%- endfor %}
</td> </td>
</tr> </tr>
<tr>
<th><b>Supported Hardware</b></th>
<td>
{%- for hardware in SUPPORTED_HARDWARE.split(',') | sort %}
{%- if hardware | trim | length %}
<p>{{ hardware | trim }}</p>
{%- endif %}
{%- endfor %}
</td>
</tr>
<tr> <tr>
<th><b>Documentation</b></th> <th><b>Documentation</b></th>
<td> <td>
......
...@@ -13,8 +13,8 @@ from download_job_artifacts import download_job_artifact ...@@ -13,8 +13,8 @@ from download_job_artifacts import download_job_artifact
from get_pipeline_jobs import get_pipeline_jobs from get_pipeline_jobs import get_pipeline_jobs
def get_deploy_variables( def get_job_env_variables(
gitlab: Gitlab, project: Project, deploy_jobs: list[ProjectPipelineJob] gitlab: Gitlab, project: Project, jobs: list[ProjectPipelineJob], env_file: str
): ):
"""Get a list of deploy variables from the deploy.env files from the given deploy """Get a list of deploy variables from the deploy.env files from the given deploy
jobs. If a variable is set to different values in different jobs, the values are jobs. If a variable is set to different values in different jobs, the values are
...@@ -30,9 +30,8 @@ def get_deploy_variables( ...@@ -30,9 +30,8 @@ def get_deploy_variables(
Dictionary of deploy variables with 'name' and 'value' fields Dictionary of deploy variables with 'name' and 'value' fields
""" """
variables = {} variables = {}
env_file = "deploy.env"
for job in deploy_jobs: for job in jobs:
with tempfile.NamedTemporaryFile() as target_file: with tempfile.NamedTemporaryFile() as target_file:
print(f"Downloading file {env_file} from job {job.name}", file=sys.stderr) print(f"Downloading file {env_file} from job {job.name}", file=sys.stderr)
...@@ -48,6 +47,7 @@ def get_deploy_variables( ...@@ -48,6 +47,7 @@ def get_deploy_variables(
for line in lines: for line in lines:
name, value = line.partition("=")[::2] name, value = line.partition("=")[::2]
value = value.strip("'")
variables[name] = ( variables[name] = (
f"{variables[name]}\n{value}" f"{variables[name]}\n{value}"
if name in variables and variables[name] != value if name in variables and variables[name] != value
...@@ -141,12 +141,15 @@ def main(): ...@@ -141,12 +141,15 @@ def main():
gitlab = Gitlab(args.gitlab_url, private_token=args.token) gitlab = Gitlab(args.gitlab_url, private_token=args.token)
project = common.get_project(gitlab, args.project) project = common.get_project(gitlab, args.project)
jobs = get_pipeline_jobs(gitlab, project, args.pipeline, stage="Build")
variables = get_job_env_variables(gitlab, project, jobs, "build.env")
jobs = get_pipeline_jobs(gitlab, project, args.pipeline, stage=args.deploy_stage) jobs = get_pipeline_jobs(gitlab, project, args.pipeline, stage=args.deploy_stage)
successful_jobs = [job for job in jobs if job.status == "success"] successful_jobs = [job for job in jobs if job.status == "success"]
if not successful_jobs: if not successful_jobs:
exit(f"ERROR: no successful jobs found in stage '{args.deploy_stage}'") exit(f"ERROR: no successful jobs found in stage '{args.deploy_stage}'")
variables = get_deploy_variables(gitlab, project, successful_jobs) variables |= get_job_env_variables(gitlab, project, successful_jobs, "deploy.env")
files = get_deployed_files(gitlab, project, successful_jobs) files = get_deployed_files(gitlab, project, successful_jobs)
......
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