Skip to content

Commit

Permalink
Revert the template and test data to use github. Job will fail as tok…
Browse files Browse the repository at this point in the history
…ens are not yet passed using github secrets

Signed-off-by: cmoulliard <cmoulliard@redhat.com>
  • Loading branch information
cmoulliard committed Jun 19, 2024
1 parent 1513d5f commit 535d773
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 34 deletions.
9 changes: 4 additions & 5 deletions .github/test-data/quarkus-app-3.11-db.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
"io.quarkus:quarkus-hibernate-validator"
],
"repo": {
"host": "gitea.cnoe.localtest.me:8443",
"org": "qshift",
"visibility": "public"
"host": "github.com",
"org": "q-shift",
},
"namespace": "dummy",
"imageRepository": "gitea.cnoe.localtest.me:8443/giteadmin",
"imageUrl": "gitea.cnoe.localtest.me:8443/giteaadmin/my-quarkus-app-job",
"imageRepository": "quay.io",
"imageUrl": "quay.io/snowdrop/my-quarkus-app",
"virtualMachineName": "quarkus-dev",
"virtualMachineNamespace": "dummy"
},
Expand Down
49 changes: 20 additions & 29 deletions locations/templates/quarkus-application/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,18 @@ spec:
host:
title: Repo Host
type: string
default: gitea.cnoe.localtest.me:8443
default: github.com
enum:
- gitea.cnoe.localtest.me:8443
- github.com
- gitea.cnoe.localtest.me:8443

org:
title: Repo Org Owner
type: string
description: Your SCM organization/group
default: qshift
default: q-shift
enum:
- qshift
- q-shift
- aureamunoz
- ch007m
- iocanel
Expand Down Expand Up @@ -216,10 +216,10 @@ spec:
imageRepository:
title: Select a registry
type: string
default: gitea.cnoe.localtest.me:8443/giteadmin
default: quay.io
enum:
- gitea.cnoe.localtest.me:8443/giteadmin
- quay.io
- gitea.cnoe.localtest.me:8443/giteadmin
- image-registry.openshift-image-registry.svc:5000
enumNames:
- Gitea
Expand All @@ -230,7 +230,10 @@ spec:
title: Image URL
type: string
description: The Quay.io or OpenShift Image URL <REGISTRY>/<IMAGE_URL>/<REPO_NAME>
default: gitea.cnoe.localtest.me:8443/giteadmin/my-quarkus-app-job
default: quay.io/snowdrop/my-quarkus-app
enumNames:
- quay.io/snowdrop/my-quarkus-app
- gitea.cnoe.localtest.me:8443/giteadmin/my-quarkus-app-job

virtualMachineName:
title: Virtual Machine Name
Expand Down Expand Up @@ -317,9 +320,8 @@ spec:
system: ${{ parameters.system }}
applicationType: service
description: ${{ parameters.description }}
# TODO: To be reviewed and find a way to properly set the DNS names of: gitea, argocd, etc
# destination: destination: ${{ parameters.repo.org }}/${{ parameters.component_id }}
destination: http://my-gitea-http.gitea.svc.cluster.local:3000/${{ parameters.repo.org }}/${{ parameters.component_id }}.git
# TODO: To be reviewed and tested with different git providers
destination: ${{ parameters.repo.org }}/${{ parameters.component_id }}
host: ${{ parameters.repo.host }}
namespace: ${{ parameters.namespace }}
imageUrl: ${{ parameters.imageUrl }}
Expand All @@ -342,9 +344,8 @@ spec:
values:
component_id: ${{ parameters.component_id }}
description: ${{ parameters.description }}
# TODO: To be reviewed and find a way to properly set the DNS names of: gitea, argocd, etc
# destination: https://${{ parameters.repo.host }}/${{ parameters.repo.org }}/${{ parameters.component_id }}.git
destination: http://my-gitea-http.gitea.svc.cluster.local:3000/${{ parameters.repo.org }}/${{ parameters.component_id }}.git
# TODO: To be reviewed and tested with different git providers
destination: https://${{ parameters.repo.host }}/${{ parameters.repo.org }}/${{ parameters.component_id }}.git
git_repo: ${{ parameters.repo.host }} # quay.io, ghcr.io, docker.io, etc
git_org: ${{ parameters.repo.org }}
git_repo_name: ${{ parameters.component_id }}
Expand All @@ -365,19 +366,11 @@ spec:
input:
allowedHosts: ['github.com']
description: This is ${{ parameters.component_id }}
repoUrl: "${{ parameters.repo.host }}?owner=${{ parameters.repo.org }}&repo=${{parameters.component_id}}"
repoUrl: ${{ parameters.repo.host }}?owner=${{ parameters.repo.org }}&repo=${{parameters.component_id}}
defaultBranch: main
protectDefaultBranch: false
repoVisibility: ${{ parameters.repo.visibility }}

#- id: debug-gitea
# name: Publishing to Gitea
# action: debug:log
# if: ${{ parameters.repo.host !== "github.com" }}
# input:
# message: |
# Pushing files to ${{ parameters.repo.host }} server and repo name: ${{ parameters.component_id }}

- id: publish-gitea
name: Publishing to a gitea git repository
action: publish:gitea
Expand All @@ -393,10 +386,9 @@ spec:
name: Registering the Catalog Info Component
action: catalog:register
input:
# TODO: Find a way to define properly define the address to access the gitea server or github
catalogInfoUrl: https://${{ parameters.repo.host }}/${{ parameters.repo.org }}/${{ parameters.component_id }}/src/branch/main/catalog-info.yaml
#repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}
#catalogInfoPath: catalog-info.yaml
# TODO: To be reviewed and tested with different git providers
repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}
catalogInfoPath: catalog-info.yaml

- id: create-argocd-resources
name: Create ArgoCD Resources
Expand All @@ -406,9 +398,8 @@ spec:
argoInstance: argocdQShift # Match appconfig => argocd/appLocatorMethods/instances/name
projectName: ${{ parameters.component_id }}
namespace: ${{ parameters.namespace }}
# repoUrl: https://${{ parameters.repo.host }}/${{ parameters.repo.org }}/${{ parameters.component_id }}.git
# TODO: Find a way to define properly the address to access the gitea server
repoUrl: http://my-gitea-http.gitea.svc.cluster.local:3000/${{ parameters.repo.org }}/${{ parameters.component_id }}.git
# TODO: To be reviewed and tested with different git providers
repoUrl: https://${{ parameters.repo.host }}/${{ parameters.repo.org }}/${{ parameters.component_id }}.git
path: 'argocd/'

output:
Expand Down

0 comments on commit 535d773

Please sign in to comment.