Skip to content

Commit 6fe3c26

Browse files
authored
Merge pull request #166 from tnevrlka/azure-source-repo
Add Azure source-repo pipeline
2 parents 4aea369 + d583f3c commit 6fe3c26

File tree

5 files changed

+142
-11
lines changed

5 files changed

+142
-11
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ FILES=\
66
generated/source-repo/jenkins/Jenkinsfile \
77
generated/source-repo/githubactions/.github/workflows/build-and-update-gitops.yml \
88
generated/source-repo/gitlabci/.gitlab-ci.yml \
9+
generated/source-repo/azure/azure-pipelines.yml \
910
\
1011
generated/gitops-template/jenkins/Jenkinsfile \
1112
generated/gitops-template/githubactions/.github/workflows/gitops-promotion.yml \
@@ -37,7 +38,8 @@ endef
3738
TARGET_DIRS=\
3839
jenkins \
3940
githubactions/.github/workflows \
40-
gitlabci
41+
gitlabci \
42+
azure
4143

4244
define targets_for_ci_type
4345
generated/source-repo/$(1)/%: templates/source-repo/%.njk templates/data.yaml
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Generated from templates/source-repo/azure-pipelines.yml.njk. Do not edit directly.
2+
3+
trigger:
4+
- main
5+
6+
pool:
7+
name: resourcehub
8+
9+
container:
10+
image: quay.io/redhat-appstudio/rhtap-task-runner:latest
11+
options: --privileged
12+
13+
steps:
14+
- bash: |
15+
echo "• init"
16+
bash /work/rhtap/init.sh
17+
name: Init
18+
env:
19+
ROX_API_TOKEN: $(ROX_API_TOKEN)
20+
GITOPS_AUTH_PASSWORD: $(GITOPS_AUTH_PASSWORD)
21+
# Set this password for your specific registry
22+
IMAGE_REGISTRY_PASSWORD: $(IMAGE_REGISTRY_PASSWORD)
23+
# QUAY_IO_CREDS_PSW: $(QUAY_IO_CREDS_PSW)
24+
# ARTIFACTORY_IO_CREDS_PSW: $(ARTIFACTORY_IO_CREDS_PSW)
25+
# NEXUS_IO_CREDS_PSW: $(NEXUS_IO_CREDS_PSW)
26+
COSIGN_SECRET_PASSWORD: $(COSIGN_SECRET_PASSWORD)
27+
COSIGN_SECRET_KEY: $(COSIGN_SECRET_KEY)
28+
- bash: |
29+
echo "• buildah-rhtap"
30+
bash /work/rhtap/buildah-rhtap.sh
31+
echo "• cosign-sign-attest"
32+
bash /work/rhtap/cosign-sign-attest.sh
33+
name: Build
34+
env:
35+
ROX_API_TOKEN: $(ROX_API_TOKEN)
36+
GITOPS_AUTH_PASSWORD: $(GITOPS_AUTH_PASSWORD)
37+
# Set this password for your specific registry
38+
IMAGE_REGISTRY_PASSWORD: $(IMAGE_REGISTRY_PASSWORD)
39+
# QUAY_IO_CREDS_PSW: $(QUAY_IO_CREDS_PSW)
40+
# ARTIFACTORY_IO_CREDS_PSW: $(ARTIFACTORY_IO_CREDS_PSW)
41+
# NEXUS_IO_CREDS_PSW: $(NEXUS_IO_CREDS_PSW)
42+
COSIGN_SECRET_PASSWORD: $(COSIGN_SECRET_PASSWORD)
43+
COSIGN_SECRET_KEY: $(COSIGN_SECRET_KEY)
44+
- bash: |
45+
echo "• update-deployment"
46+
bash /work/rhtap/update-deployment.sh
47+
name: Deploy
48+
env:
49+
ROX_API_TOKEN: $(ROX_API_TOKEN)
50+
GITOPS_AUTH_PASSWORD: $(GITOPS_AUTH_PASSWORD)
51+
# Set this password for your specific registry
52+
IMAGE_REGISTRY_PASSWORD: $(IMAGE_REGISTRY_PASSWORD)
53+
# QUAY_IO_CREDS_PSW: $(QUAY_IO_CREDS_PSW)
54+
# ARTIFACTORY_IO_CREDS_PSW: $(ARTIFACTORY_IO_CREDS_PSW)
55+
# NEXUS_IO_CREDS_PSW: $(NEXUS_IO_CREDS_PSW)
56+
COSIGN_SECRET_PASSWORD: $(COSIGN_SECRET_PASSWORD)
57+
COSIGN_SECRET_KEY: $(COSIGN_SECRET_KEY)
58+
- bash: |
59+
echo "• acs-deploy-check"
60+
bash /work/rhtap/acs-deploy-check.sh
61+
echo "• acs-image-check"
62+
bash /work/rhtap/acs-image-check.sh
63+
echo "• acs-image-scan"
64+
bash /work/rhtap/acs-image-scan.sh
65+
name: Scan
66+
env:
67+
ROX_API_TOKEN: $(ROX_API_TOKEN)
68+
GITOPS_AUTH_PASSWORD: $(GITOPS_AUTH_PASSWORD)
69+
# Set this password for your specific registry
70+
IMAGE_REGISTRY_PASSWORD: $(IMAGE_REGISTRY_PASSWORD)
71+
# QUAY_IO_CREDS_PSW: $(QUAY_IO_CREDS_PSW)
72+
# ARTIFACTORY_IO_CREDS_PSW: $(ARTIFACTORY_IO_CREDS_PSW)
73+
# NEXUS_IO_CREDS_PSW: $(NEXUS_IO_CREDS_PSW)
74+
COSIGN_SECRET_PASSWORD: $(COSIGN_SECRET_PASSWORD)
75+
COSIGN_SECRET_KEY: $(COSIGN_SECRET_KEY)
76+
- bash: |
77+
echo "• show-sbom-rhdh"
78+
bash /work/rhtap/show-sbom-rhdh.sh
79+
echo "• summary"
80+
bash /work/rhtap/summary.sh
81+
name: Summary
82+
env:
83+
ROX_API_TOKEN: $(ROX_API_TOKEN)
84+
GITOPS_AUTH_PASSWORD: $(GITOPS_AUTH_PASSWORD)
85+
# Set this password for your specific registry
86+
IMAGE_REGISTRY_PASSWORD: $(IMAGE_REGISTRY_PASSWORD)
87+
# QUAY_IO_CREDS_PSW: $(QUAY_IO_CREDS_PSW)
88+
# ARTIFACTORY_IO_CREDS_PSW: $(ARTIFACTORY_IO_CREDS_PSW)
89+
# NEXUS_IO_CREDS_PSW: $(NEXUS_IO_CREDS_PSW)
90+
COSIGN_SECRET_PASSWORD: $(COSIGN_SECRET_PASSWORD)
91+
COSIGN_SECRET_KEY: $(COSIGN_SECRET_KEY)

templates/data.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ build_variables:
2323
if: 'isGitLab'
2424

2525
- name: IMAGE_REGISTRY_USER
26-
if: 'isGitHub'
26+
if: 'isGitHub || isAzure'
2727
comment: "Set this to the user for your specific registry"
2828
- name: IMAGE_REGISTRY_USER
29-
if: '!isGitHub'
29+
if: '!isGitHub && !isAzure'
3030
commented_out: true
3131
comment: "Set this to the user for your specific registry"
3232

@@ -67,30 +67,30 @@ build_secrets:
6767
- name: GITOPS_AUTH_PASSWORD
6868

6969
- name: IMAGE_REGISTRY_PASSWORD
70-
if: 'isGitHub'
71-
comment: "Set this password for your specific registry"
70+
if: 'isGitHub || isAzure'
71+
comment: "Set this password for your specific registry"
7272
- name: IMAGE_REGISTRY_PASSWORD
73-
if: '!isGitHub'
73+
if: '!isGitHub && !isAzure'
7474
commented_out: true
7575
comment: "Set this password for your specific registry"
7676

7777
- name: QUAY_IO_CREDS
7878
if: isJenkins
79-
comment: "Default registry is set to quay.io"
79+
comment: "Default registry is set to quay.io"
8080
- name: QUAY_IO_CREDS_PSW
8181
if: '!isJenkins'
8282
commented_out: true
8383

8484
- name: ARTIFACTORY_IO_CREDS
8585
if: isJenkins
86-
commented_out: true
86+
commented_out: true
8787
- name: ARTIFACTORY_IO_CREDS_PSW
8888
if: '!isJenkins'
8989
commented_out: true
9090

9191
- name: NEXUS_IO_CREDS
9292
if: isJenkins
93-
commented_out: true
93+
commented_out: true
9494
- name: NEXUS_IO_CREDS_PSW
9595
if: '!isJenkins'
9696
commented_out: true
@@ -176,13 +176,13 @@ gitops_secrets:
176176
commented_out: true
177177
- name: ARTIFACTORY_IO_CREDS
178178
if: isJenkins
179-
commented_out: true
179+
commented_out: true
180180
- name: ARTIFACTORY_IO_CREDS_PSW
181181
if: '!isJenkins'
182182
commented_out: true
183183
- name: NEXUS_IO_CREDS
184184
if: isJenkins
185-
commented_out: true
185+
commented_out: true
186186
- name: NEXUS_IO_CREDS_PSW
187187
if: '!isJenkins'
188188
commented_out: true

templates/partials/azure-step.njk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- bash: |
2+
{%- filter indent(2) -%}
3+
{%- for substep in step.substeps %}
4+
echo "• {{ substep }}"
5+
bash /work/rhtap/{{ substep }}.sh
6+
{%- endfor %}
7+
name: {{ step.name | title }}
8+
env:
9+
{%- filter indent(2) -%}
10+
{%- for secret in secrets %}
11+
{%- if secret | eval_if_condition %}
12+
{%- if secret.comment %}
13+
# {{ secret.comment }}
14+
{%- endif %}
15+
{% if secret.commented_out %}# {% endif %}{{ secret.name }}: $({{ secret.name}})
16+
{%- endif %}
17+
{%- endfor %}
18+
{%- endfilter -%}
19+
{%- endfilter -%}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{%- include "do-not-edit.njk" -%}
2+
{%- set secrets = build_secrets -%}
3+
4+
trigger:
5+
- main
6+
7+
pool:
8+
name: resourcehub
9+
10+
container:
11+
image: quay.io/redhat-appstudio/rhtap-task-runner:latest
12+
options: --privileged
13+
14+
steps:
15+
{%- filter indent(2) -%}
16+
{%- for step in build_steps %}
17+
{% include "azure-step.njk" %}
18+
{%- endfor -%}
19+
{%- endfilter -%}

0 commit comments

Comments
 (0)