Skip to content
Open
Show file tree
Hide file tree
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
36 changes: 14 additions & 22 deletions pipelines/integration-test/ansible-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,23 @@ spec:
- name: prepare-molecule-tests
runAfter:
- clone-source-code
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: eli/dupeCode
- name: pathInRepo
value: tasks/integration-test/prepare-molecule-tests.yaml
params:
- name: container-image
value: $(tasks.parse-metadata.results.container-image)
- name: ansible-path
value: "ansible"
workspaces:
- name: work
workspace: work
taskSpec:
workspaces:
- name: work
steps:
- name: extract-release-image-content
image: "gcr.io/go-containerregistry/crane"
args:
- export
- $(tasks.parse-metadata.results.container-image)
- $(workspaces.work.path)/image.tar
- name: prepare-tests
image: "quay.io/redhat-appstudio/konflux-test:stable"
script: |
#!/bin/sh
set -ex

# extract the release image content
tar xf $(workspaces.work.path)/image.tar -C $(workspaces.work.path)

# replace the tas_single_node name with the redhat.artifact_signer.tas_single_node name
find $(workspaces.work.path)/ansible/molecule -type f -name "converge.yml" \
-exec sed -i 's@name: tas_single_node@name: redhat.artifact_signer.tas_single_node@g' {} +
- name: run-upgrade-test
runAfter:
- prepare-molecule-tests
Expand Down
40 changes: 16 additions & 24 deletions pipelines/integration-test/ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,23 @@ spec:
- name: output
workspace: work
- name: prepare-molecule-tests
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: eli/dupeCode
- name: pathInRepo
value: tasks/integration-test/prepare-molecule-tests.yaml
params:
- name: container-image
value: $(tasks.parse-metadata.results.container-image)
- name: ansible-path
value: "artifact-signer-ansible"
workspaces:
- name: work
workspace: work
taskSpec:
workspaces:
- name: work
steps:
- name: extract-release-image-content
image: "gcr.io/go-containerregistry/crane"
args:
- export
- $(tasks.parse-metadata.results.container-image)
- $(workspaces.work.path)/image.tar
- name: prepare-env
image: "quay.io/redhat-appstudio/konflux-test:stable"
script: |
#!/bin/sh
set -ex

# extract the release image content
tar xf $(workspaces.work.path)/image.tar -C $(workspaces.work.path)

# replace the tas_single_node name with the redhat.artifact_signer.tas_single_node name
find $(workspaces.work.path)/artifact-signer-ansible/molecule -type f -name "converge.yml" \
-exec sed -i 's@name: tas_single_node@name: redhat.artifact_signer.tas_single_node@g' {} +
- name: run-molecule-tests
runAfter:
- prepare-molecule-tests
Expand All @@ -121,7 +113,7 @@ spec:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
value: eli/dupeCode
- name: pathInRepo
value: tasks/integration-test/ansible/run-molecule-tests.yaml
- name: run-sigstore-e2e-tests
Expand All @@ -140,7 +132,7 @@ spec:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
value: eli/dupeCode
- name: pathInRepo
value: tasks/integration-test/ansible/run-sigstore-e2e-tests.yaml
finally:
Expand Down
41 changes: 41 additions & 0 deletions tasks/integration-test/prepare-molecule-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: prepare-molecule-tests
spec:
description: |
Extracts a container image and prepares the Ansible molecule test environment
by replacing role names in converge.yml files.
params:
- name: container-image
type: string
description: The container image URL to extract (e.g., from Snapshot)
- name: ansible-path
type: string
description: Path to the Ansible directory relative to workspace (e.g., "ansible" or "artifact-signer-ansible")
default: "ansible"
workspaces:
- name: work
description: Workspace where the image will be extracted and processed
steps:
- name: extract-release-image-content
image: "gcr.io/go-containerregistry/crane"
args:
- export
- $(params.container-image)
- $(workspaces.work.path)/image.tar
- name: prepare-env
image: "quay.io/redhat-appstudio/konflux-test:stable"
script: |
#!/bin/sh
set -ex

# Extract the release image content
tar xf $(workspaces.work.path)/image.tar -C $(workspaces.work.path)

# Replace the tas_single_node name with the redhat.artifact_signer.tas_single_node name
# This finds all converge.yml files in the molecule directory and updates the role name
find $(workspaces.work.path)/$(params.ansible-path)/molecule -type f -name "converge.yml" \
-exec sed -i 's@name: tas_single_node@name: redhat.artifact_signer.tas_single_node@g' {} +

echo "Successfully prepared molecule tests in $(params.ansible-path)"