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

Add argo namespace to workflowtemplate #40

Merged
merged 3 commits into from
Jun 21, 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
8 changes: 6 additions & 2 deletions templates/argo-cd/createapp-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: create-application
namespace: argo
spec:
arguments:
parameters:
Expand All @@ -11,6 +12,8 @@ spec:
value: "lma"
- name: repository_url
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: main
templates:
- name: createApp
inputs:
Expand All @@ -27,13 +30,14 @@ spec:
- -c
- |
# log into Argo CD server
./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME --password $ARGO_PASSWORD
./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME \
--password $ARGO_PASSWORD

# check if app already exists.
./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 --project $APP_NAME --directory-recurse
./argocd app create $PATH --repo $REPO --revision $REVISION --path $SITE_NAME/$APP_NAME/$PATH --dest-namespace $NAMESPACE --dest-name $SITE_NAME --project $APP_NAME --directory-recurse
fi

./argocd app set $PATH --sync-policy automated --auto-prune
Expand Down
28 changes: 14 additions & 14 deletions templates/argo-cd/prepare-argocd-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: prepare-argocd
namespace: argo
spec:
entrypoint: preparation
arguments:
Expand Down Expand Up @@ -51,24 +52,23 @@ spec:
- /bin/bash
- '-c'
- |
./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME
./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME \
--password $ARGO_PASSWORD

./argocd proj get lma
if [[ $? != 0 ]]; then
./argocd proj create lma --dest "*,*" --src "*" --allow-cluster-resource "*/*"
fi

./argocd proj create lma --upsert
./argocd proj allow-cluster-resource lma '*' '*'
./argocd proj add-destination lma '*' '*'
./argocd proj add-source lma '*'
./argocd proj get service-mesh
if [[ $? != 0 ]]; then
./argocd proj create service-mesh --dest "*,*" --src "*" --allow-cluster-resource "*/*"
fi

./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 '*'
./argocd proj get openstack
if [[ $? != 0 ]]; then
./argocd proj create openstack --dest "*,*" --src "*" --allow-cluster-resource "*/*"
fi
env:
- name: ARGO_SERVER
value: '{{workflow.parameters.argo_server}}'
Expand Down
2 changes: 2 additions & 0 deletions templates/decapod-apps/lma-federation-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
value: "lma"
- name: repository_url
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: main
templates:
- name: deploy
dag:
Expand Down
2 changes: 2 additions & 0 deletions templates/decapod-apps/lma-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
value: "lma"
- name: repository_url
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: main
templates:
- name: deploy
dag:
Expand Down
2 changes: 2 additions & 0 deletions templates/decapod-apps/openstack-components-wf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
value: "openstack"
- name: repository_url
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: main
templates:
- name: deploy
dag:
Expand Down
2 changes: 2 additions & 0 deletions templates/decapod-apps/openstack-infra-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
value: "openstack"
- name: repository_url
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: main
templates:
- name: deploy
dag:
Expand Down
2 changes: 2 additions & 0 deletions templates/decapod-apps/service-mesh-wf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
value: "service-mesh"
- name: repository_url
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: main
templates:
- name: deploy
dag:
Expand Down