Skip to content

Commit

Permalink
Add argo namespace to workflowtemplate
Browse files Browse the repository at this point in the history
Fix create argo proj
  • Loading branch information
seungkyua committed Jun 18, 2021
1 parent e43c4cb commit f771322
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
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 sync $PATH --async
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 servicemesh
if [[ $? != 0 ]]; then
./argocd proj create servicemesh --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: 1 addition & 1 deletion templates/decapod-apps/service-mesh-wf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
- name: site_name
value: "hanu-reference"
- name: app_name
value: "service-mesh"
value: "servicemesh"
- name: repository_url
value: "https://github.com/openinfradev/decapod-manifests"
templates:
Expand Down

0 comments on commit f771322

Please sign in to comment.