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
88 changes: 21 additions & 67 deletions pipelines/integration-test/ansible-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,21 @@ spec:
- name: prepare-molecule-tests
runAfter:
- clone-source-code
params:
- name: container-image
value: $(tasks.parse-metadata.results.container-image)
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' {} +
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: tasks/integration-test/prepare-molecule-tests.yaml
- name: run-upgrade-test
runAfter:
- prepare-molecule-tests
Expand Down Expand Up @@ -188,51 +178,15 @@ spec:
memory: 4Gi
finally:
- name: aws-cleanup
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: tasks/integration-test/aws-cleanup-ec2-instances.yaml
params:
- name: run-id
value: "$(context.pipelineRun.name)"
taskSpec:
params:
- name: run-id
volumes:
- name: aws-creds
secret:
secretName: aws-ci-test
steps:
- name: terminate-instances
volumeMounts:
- name: aws-creds
mountPath: /creds
image: amazon/aws-cli:latest
env:
- name: AWS_DEFAULT_REGION
value: "eu-north-1"
script: |
#!/bin/bash
set -eu

set +x
export AWS_SECRET_ACCESS_KEY=$(cat /creds/AWS_ACCESS_KEY)
export AWS_ACCESS_KEY_ID=$(cat /creds/AWS_ACCESS_KEY_ID)
set -x

# Check for credentials before proceeding (crucial step)
if [ -z "${AWS_ACCESS_KEY_ID}" ]; then
echo "ERROR: AWS_ACCESS_KEY_ID environment variable is missing." >&2
exit 1
fi

INSTANCE_LIST=$(
aws ec2 describe-instances \
--filters "Name=tag:Name,Values=CI-$(params.run-id)*" "Name=instance-state-name,Values=running,pending" \
--query 'Reservations[].Instances[].InstanceId' \
--output text
)
echo "Instance IDs received for termination: ${INSTANCE_LIST} in ${AWS_DEFAULT_REGION}..."

aws ec2 terminate-instances \
--instance-ids ${INSTANCE_LIST} \
--region ${AWS_DEFAULT_REGION} \
--output text

echo "Termination request sent for instance ${INSTANCE_LIST}."
92 changes: 25 additions & 67 deletions pipelines/integration-test/ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,25 @@ spec:
- name: output
workspace: work
- name: prepare-molecule-tests
runAfter:
- clone-source-code
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' {} +
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: tasks/integration-test/prepare-molecule-tests.yaml
- name: run-molecule-tests
runAfter:
- prepare-molecule-tests
Expand Down Expand Up @@ -145,51 +139,15 @@ spec:
value: tasks/integration-test/ansible/run-sigstore-e2e-tests.yaml
finally:
- name: aws-cleanup
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: tasks/integration-test/aws-cleanup-ec2-instances.yaml
params:
- name: run-id
value: "$(context.pipelineRun.name)"
taskSpec:
params:
- name: run-id
volumes:
- name: aws-creds
secret:
secretName: aws-ci-test
steps:
- name: terminate-instances
volumeMounts:
- name: aws-creds
mountPath: /creds
image: amazon/aws-cli:latest
env:
- name: AWS_DEFAULT_REGION
value: "eu-north-1"
script: |
#!/bin/bash
set -eu

set +x
export AWS_SECRET_ACCESS_KEY=$(cat /creds/AWS_ACCESS_KEY)
export AWS_ACCESS_KEY_ID=$(cat /creds/AWS_ACCESS_KEY_ID)
set -x

# Check for credentials before proceeding (crucial step)
if [ -z "${AWS_ACCESS_KEY_ID}" ]; then
echo "ERROR: AWS_ACCESS_KEY_ID environment variable is missing." >&2
exit 1
fi

INSTANCE_LIST=$(
aws ec2 describe-instances \
--filters "Name=tag:Name,Values=CI-$(params.run-id)*" "Name=instance-state-name,Values=running,pending" \
--query 'Reservations[].Instances[].InstanceId' \
--output text
)
echo "Instance IDs received for termination: ${INSTANCE_LIST} in ${AWS_DEFAULT_REGION}..."

aws ec2 terminate-instances \
--instance-ids ${INSTANCE_LIST} \
--region ${AWS_DEFAULT_REGION} \
--output text

echo "Termination request sent for instance ${INSTANCE_LIST}."
98 changes: 20 additions & 78 deletions pipelines/integration-test/operator-dast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,87 +239,29 @@ spec:
runAfter:
- install-operator-from-fbc
- clone-operator-source-code
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: tasks/integration-test/prepare-tests.yaml
params:
- name: eaasSpaceSecretRef
value: $(tasks.provision-eaas-space.results.secretRef)
- name: clusterName
value: "$(tasks.provision-cluster.results.clusterName)"
- name: workdir
value: "operator"
- name: install-tas
value: "true"
- name: tas-namespace
value: "$(params.TAS_DEPLOY_NAMESPACE)"
workspaces:
- name: source-code
workspace: sources
taskSpec:
results:
- name: oidc-hostname
type: string
value: "$(steps.install-keycloak.results.oidc-hostname)"
- name: fulcio-url
type: string
value: "$(steps.install-tas.results.fulcio-url)"
- name: tsa-url
type: string
value: "$(steps.install-tas.results.tsa-url)"
- name: tuf-url
type: string
value: "$(steps.install-tas.results.tuf-url)"
- name: rekor-url
type: string
value: "$(steps.install-tas.results.rekor-url)"
volumes:
- name: credentials
emptyDir: { }
workspaces:
- name: source-code
steps:
- name: get-kubeconfig
ref:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/build-definitions.git
- name: revision
value: main
- name: pathInRepo
value: stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml
params:
- name: eaasSpaceSecretRef
value: $(tasks.provision-eaas-space.results.secretRef)
- name: clusterName
value: "$(tasks.provision-cluster.results.clusterName)"
- name: credentials
value: credentials
- name: install-keycloak
ref:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: stepactions/integration-test/install-keycloak.yaml
params:
- name: credentials
value: credentials
- name: KUBECONFIG
value: "$(steps.get-kubeconfig.results.kubeconfig)"
- name: workdir
value: "$(workspaces.source-code.path)/operator"
- name: install-tas
ref:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: stepactions/integration-test/install-tas.yaml
params:
- name: credentials
value: credentials
- name: KUBECONFIG
value: "$(steps.get-kubeconfig.results.kubeconfig)"
- name: workdir
value: $(workspaces.source-code.path)/operator
- name: tas-namespace
value: "$(params.TAS_DEPLOY_NAMESPACE)"
- name: OIDC_ISSUER_URL
value: "$(steps.install-keycloak.results.oidc-issuer-url)"
# FULCIO DAST testing
- name: fulcio-dast
runAfter:
Expand Down
61 changes: 16 additions & 45 deletions pipelines/integration-test/operator-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,54 +231,25 @@ spec:
runAfter:
- provision-cluster
- clone-operator-source-code
taskRef:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: tasks/integration-test/prepare-tests.yaml
params:
- name: eaasSpaceSecretRef
value: $(tasks.provision-eaas-space.results.secretRef)
- name: clusterName
value: "$(tasks.provision-cluster.results.clusterName)"
- name: workdir
value: "operator"
workspaces:
- name: source-code
workspace: work
taskSpec:
results:
- name: oidc-hostname
type: string
value: "$(steps.install-keycloak.results.oidc-hostname)"
volumes:
- name: credentials
emptyDir: { }
workspaces:
- name: source-code
steps:
- name: get-kubeconfig
ref:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/build-definitions.git
- name: revision
value: main
- name: pathInRepo
value: stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml
params:
- name: eaasSpaceSecretRef
value: $(tasks.provision-eaas-space.results.secretRef)
- name: clusterName
value: "$(tasks.provision-cluster.results.clusterName)"
- name: credentials
value: credentials
- name: install-keycloak
ref:
resolver: git
params:
- name: url
value: https://github.com/securesign/pipelines.git
- name: revision
value: main
- name: pathInRepo
value: stepactions/integration-test/install-keycloak.yaml
params:
- name: credentials
value: credentials
- name: KUBECONFIG
value: "$(steps.get-kubeconfig.results.kubeconfig)"
- name: workdir
value: "$(workspaces.source-code.path)/operator"
- name: run-operator-upgrade
runAfter:
- prepare-tests
Expand Down
Loading