Skip to content

Commit

Permalink
Merge pull request #29 from openinfradev/argocd_project
Browse files Browse the repository at this point in the history
create argocd projects and register applications with projects
  • Loading branch information
intelliguy committed May 20, 2021
2 parents a6c371a + 7b82f87 commit af3cd53
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/argo-cd/createapp-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
./argocd app get $PATH
if [[ $? -ne 0 ]]; then
# create new application if not exists.
./argocd app create $PATH --repo $REPO --path $SITE_NAME/$APP_NAME/$PATH --dest-namespace $NAMESPACE --dest-name $SITE_NAME --directory-recurse
./argocd app create $PATH --repo $REPO --path $SITE_NAME/$APP_NAME/$PATH --dest-namespace $NAMESPACE --dest-name $SITE_NAME --project $APP_NAME --directory-recurse
fi
./argocd app sync $PATH --async
Expand Down
46 changes: 45 additions & 1 deletion templates/argo-cd/prepare-argocd-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: WorkflowTemplate
metadata:
name: prepare-argocd
spec:
startpoint: configuration
entrypoint: preparation
arguments:
parameters:
- name: argo_server
Expand Down Expand Up @@ -40,3 +40,47 @@ spec:
value: "{{workflow.parameters.argo_username}}"
- name: ARGO_PASSWORD
value: "{{workflow.parameters.argo_password}}"

- name: createProject
container:
name: create
image: 'docker.io/sktdev/argocd:latest'
command:
- /bin/bash
- '-c'
- >
./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME
--password $ARGO_PASSWORD
./argocd proj create lma --upsert
./argocd proj allow-cluster-resource lma '*' '*'
./argocd proj add-destination lma '*' '*'
./argocd proj add-source lma '*'
./argocd proj create service-mesh --upsert
./argocd proj allow-cluster-resource service-mesh '*' '*'
./argocd proj add-destination service-mesh '*' '*'
./argocd proj add-source service-mesh '*'
./argocd proj create openstack --upsert
./argocd proj allow-cluster-resource openstack '*' '*'
./argocd proj add-destination openstack '*' '*'
./argocd proj add-source openstack '*'
env:
- name: ARGO_SERVER
value: '{{workflow.parameters.argo_server}}'
- name: ARGO_USERNAME
value: '{{workflow.parameters.argo_username}}'
- name: ARGO_PASSWORD
value: '{{workflow.parameters.argo_password}}'
activeDeadlineSeconds: 120

- name: preparation
steps:
- - name: configuration
template: configuration
arguments: {}
- - name: createProject
template: createProject
arguments: {}

0 comments on commit af3cd53

Please sign in to comment.