Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create argocd projects and register applications with projects #29

Merged
merged 1 commit into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: {}