From 394a0aeeaf77ebbb6ab56236ba6df5087cc76ee9 Mon Sep 17 00:00:00 2001 From: Elai Shalev Date: Thu, 19 Dec 2024 16:34:42 +0200 Subject: [PATCH] Small changes to gitlab templates --- .../advanced-workflow/template.yaml | 16 ++++++++-------- .../basic-workflow/template.yaml | 2 +- .../gitlab-workflows/build/.gitlab-ci.yml | 10 +++++----- scaffolder-templates/gitops/bootstrap/README.md | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scaffolder-templates/gitlab-workflows/advanced-workflow/template.yaml b/scaffolder-templates/gitlab-workflows/advanced-workflow/template.yaml index ca2fc03..429b5ea 100644 --- a/scaffolder-templates/gitlab-workflows/advanced-workflow/template.yaml +++ b/scaffolder-templates/gitlab-workflows/advanced-workflow/template.yaml @@ -266,7 +266,7 @@ spec: version: 1.0.0-SNAPSHOT workflowId: ${{ parameters.workflowId }} infrastructureWorkflowId: ${{ parameters.infrastructureWorkflowId }} - sourceControl: github.com + sourceControl: gitlab.com applicationType: workflow-project lifecycle: development quayOrgName: ${{ parameters.quayOrgName }} @@ -294,8 +294,8 @@ spec: argocdNamespace: ${{ parameters.argocdNamespace }} orgName: ${{ parameters.orgName }} workflowId: ${{ parameters.workflowId }} - gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git - gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + gitUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git quayOrgName: ${{ parameters.quayOrgName }} quayRepoName: ${{ parameters.quayRepoName }} gitHost: ${{ parameters.gitlabHost }} @@ -314,8 +314,8 @@ spec: argocdNamespace: ${{ parameters.argocdNamespace }} orgName: ${{ parameters.orgName }} workflowId: ${{ parameters.workflowId }} - gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git - gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + gitUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git quayOrgName: ${{ parameters.quayOrgName }} quayRepoName: ${{ parameters.quayRepoName }} convertToFlat: false @@ -376,10 +376,10 @@ spec: system: ${{ parameters.system }} applicationType: workflow-project description: ${{ parameters.description }} - sourceControl: github.com + sourceControl: gitlab.com lifecycle: development - gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git - gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + gitUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git persistencePSQLSecretName: ${{ parameters.persistencePSQLSecretName }} persistencePSQLUserKey: ${{ parameters.persistencePSQLUserKey }} persistencePSQLPasswordKey: ${{ parameters.persistencePSQLPasswordKey }} diff --git a/scaffolder-templates/gitlab-workflows/basic-workflow/template.yaml b/scaffolder-templates/gitlab-workflows/basic-workflow/template.yaml index a5d93ed..0624955 100644 --- a/scaffolder-templates/gitlab-workflows/basic-workflow/template.yaml +++ b/scaffolder-templates/gitlab-workflows/basic-workflow/template.yaml @@ -342,7 +342,7 @@ spec: action: fetch:template if: ${{ parameters.CI == 'tekton_argocd' }} input: - url: ./ + url: ../build/ copyWithoutTemplating: - .gitlab-ci.yml values: diff --git a/scaffolder-templates/gitlab-workflows/build/.gitlab-ci.yml b/scaffolder-templates/gitlab-workflows/build/.gitlab-ci.yml index 38b7bdc..c4100dd 100644 --- a/scaffolder-templates/gitlab-workflows/build/.gitlab-ci.yml +++ b/scaffolder-templates/gitlab-workflows/build/.gitlab-ci.yml @@ -3,17 +3,17 @@ stages: - update wait_for_populated_variable: - # A tag can be set according to your Gitlab runner configuration, for example: - # tags: - # - shared-podman + + tags: + - shared-podman # Change to any tag your organization uses stage: wait image: ubuntu:latest script: | sleep 5 update_pipelinerun: - # tags: - # - shared-podman + tags: + - shared-podman # Change to any tag your organization uses stage: update image: ubuntu:latest script: | diff --git a/scaffolder-templates/gitops/bootstrap/README.md b/scaffolder-templates/gitops/bootstrap/README.md index 3f421f6..48cc3df 100644 --- a/scaffolder-templates/gitops/bootstrap/README.md +++ b/scaffolder-templates/gitops/bootstrap/README.md @@ -18,7 +18,7 @@ SSH_PRIVATE_KEY=$(oc get secrets -n orchestrator-gitops github-ssh-credentials - {% else %} SSH_PRIVATE_KEY=$(oc get secrets -n orchestrator-gitops gitlab-ssh-credentials -o jsonpath='{.data.id_rsa}') {% endif %} -sed -i "s/__REPLACE_SSH_PRIVATE_KEY__/$SSH_PRIVATE_KEY/" ${{values.workflowId}}-argocd-repo.yaml +sed -i "s/__REPLACE_SSH_PRIVATE_KEY__/$SSH_PRIVATE_KEY/" bootstrap/${{values.workflowId}}-argocd-repo.yaml kubectl apply -f . ``` @@ -26,7 +26,7 @@ kubectl apply -f . **Note:** If you're not logged into the repository, you need to provide a personal access token (PAT) as part of the clone URL. ``` -git clone https://@${{ values.gitHost }}/${{ values.orgName }}/${{ values.repoName }}.git +git clone https://token:@${{ values.gitHost }}/${{ values.orgName }}/${{ values.repoName }}.git ``` Replace `` with your personal access token. Ensure the token has the necessary permissions to access the repository.