Skip to content

Commit 381ed50

Browse files
authored
Merge pull request #168 from tnevrlka/azure-ci-test
Test Azure in ci-test.sh
2 parents bf2684d + 8636e7a commit 381ed50

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

ci-test.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,27 @@ function test_gitlab_ci() {
191191
echo "Gitops: $TEST_GITOPS_GITLAB_REPO"
192192
}
193193

194+
function test_azure_pipelines() {
195+
updateBuild $AZURE_BUILD $TEST_GITOPS_AZURE_REPO
196+
updateBuild $AZURE_GITOPS
197+
198+
echo "Update .azure-pipelines.yml file in $AZURE_BUILD and $AZURE_GITOPS"
199+
cp $GEN_SRC/azure/azure-pipelines.yml $AZURE_BUILD/azure-pipelines.yml
200+
cp $GEN_GITOPS/azure/azure-pipelines.yml $AZURE_GITOPS/azure-pipelines.yml
201+
updateGitAndQuayRefs $AZURE_BUILD/azure-pipelines.yml
202+
updateGitAndQuayRefs $AZURE_GITOPS/azure-pipelines.yml
203+
204+
if [ $SKIP_SECRETS == "false" ]; then
205+
python3 hack/azure_set_vars.py
206+
fi
207+
updateRepos $AZURE_BUILD
208+
updateRepos $AZURE_GITOPS
209+
210+
echo "Azure Build and Gitops Repos"
211+
echo "Build: $TEST_BUILD_AZURE_REPO"
212+
echo "Gitops: $TEST_GITOPS_AZURE_REPO"
213+
}
214+
194215
# create latest images for dev github and gitlab
195216
make build-push-image
196217

@@ -201,3 +222,4 @@ GEN_GITOPS=generated/gitops-template
201222
test_gh_actions
202223
test_gitlab_ci
203224
test_jenkins
225+
test_azure_pipelines

hack/azure_set_vars.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def main() -> None:
146146
VarFromEnv("GITOPS_AUTH_PASSWORD"),
147147
VarFromEnv("QUAY_IO_CREDS_USR", is_secret=False),
148148
VarFromEnv("QUAY_IO_CREDS_PSW"),
149+
VarFromEnv("IMAGE_REGISTRY", is_secret=False),
150+
VarFromEnv("IMAGE_REGISTRY_USER", is_secret=False),
151+
VarFromEnv("IMAGE_REGISTRY_PASSWORD"),
149152
VarFromEnv("COSIGN_SECRET_PASSWORD"),
150153
VarFromEnv("COSIGN_SECRET_KEY"),
151154
VarFromEnv("COSIGN_PUBLIC_KEY", is_secret=False),

setup-local-dev-repos.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ TEST_GITOPS_GITLAB_REPO=https://gitlab.com/$TEST_REPO_GITLAB_ORG/tssc-dev-gitops
3131
TEST_BUILD_JENKINS_REPO=https://github.com/$TEST_REPO_ORG/tssc-dev-source-jenkins
3232
TEST_GITOPS_JENKINS_REPO=https://github.com/$TEST_REPO_ORG/tssc-dev-gitops-jenkins
3333

34+
TEST_BUILD_AZURE_REPO=https://github.com/$TEST_REPO_ORG/tssc-dev-source-azure
35+
TEST_GITOPS_AZURE_REPO=https://github.com/$TEST_REPO_ORG/tssc-dev-gitops-azure
36+
3437
# If you prefer to use ssh git urls
3538
if [ -n "$USE_SSH_GIT_URLS" ]; then
3639
[email protected]:$TEST_REPO_ORG/devfile-sample-nodejs-dance.git
@@ -39,6 +42,8 @@ if [ -n "$USE_SSH_GIT_URLS" ]; then
3942
[email protected]:$TEST_REPO_GITLAB_ORG/tssc-dev-gitops.git
4043
[email protected]:$TEST_REPO_ORG/tssc-dev-source-jenkins.git
4144
[email protected]:$TEST_REPO_ORG/tssc-dev-gitops-jenkins.git
45+
[email protected]:$TEST_REPO_ORG/tssc-dev-source-azure.git
46+
[email protected]:$TEST_REPO_ORG/tssc-dev-gitops-azure.git
4247
fi
4348

4449
function cloneRepo() {
@@ -92,6 +97,7 @@ function cloneRepo() {
9297
# Github in build/gitops
9398
# Gitlab in gitlab-build, gitlab-gitops
9499
# Jenkins in jenkins-build, jenkins-gitops
100+
# Azure in azure-build, azure-gitops
95101

96102
TMP_REPOS=tmp
97103
rm -rf $TMP_REPOS/*
@@ -101,6 +107,8 @@ GITLAB_BUILD=$TMP_REPOS/gitlab-build
101107
GITLAB_GITOPS=$TMP_REPOS/gitlab-gitops
102108
JENKINS_BUILD=$TMP_REPOS/jenkins-build
103109
JENKINS_GITOPS=$TMP_REPOS/jenkins-gitops
110+
AZURE_BUILD=$TMP_REPOS/azure-build
111+
AZURE_GITOPS=$TMP_REPOS/azure-gitops
104112

105113
# Change this for public or private image testing
106114
export TEST_PRIVATE_REGISTRY=${TEST_PRIVATE_REGISTRY:-true}
@@ -117,6 +125,8 @@ cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_GITLAB_REPO_SSH:-$TEST_BUILD_GITLAB_
117125
cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_GITLAB_REPO_SSH:-$TEST_GITOPS_GITLAB_REPO} $TEST_GITOPS_GITLAB_REPO $GITLAB_GITOPS
118126
cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_JENKINS_REPO_SSH:-$TEST_BUILD_JENKINS_REPO} $TEST_BUILD_JENKINS_REPO $JENKINS_BUILD
119127
cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_JENKINS_REPO_SSH:-$TEST_GITOPS_JENKINS_REPO} $TEST_GITOPS_JENKINS_REPO $JENKINS_GITOPS
128+
cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_AZURE_REPO_SSH:-$TEST_BUILD_AZURE_REPO} $TEST_BUILD_AZURE_REPO $AZURE_BUILD
129+
cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_AZURE_REPO_SSH:-$TEST_GITOPS_AZURE_REPO} $TEST_GITOPS_AZURE_REPO $AZURE_GITOPS
120130

121131
# Avoid messing with your real $HOME/.gitconfig when running locally
122132
if [ -n "$LOCAL_SHELL_RUN" ]; then

0 commit comments

Comments
 (0)