Skip to content
Snippets Groups Projects
Commit 5597615b authored by Vineet Reddy Rajula's avatar Vineet Reddy Rajula
Browse files

Add argocd ignore annotation to clustertasks

parent c841286f
No related branches found
No related tags found
1 merge request!10Add restore site task & restructure job templates
Pipeline #2848845 passed
......@@ -2,6 +2,12 @@ apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
name: clear-cache
annotations:
app: drupal
# TEKTON runs work only when 'PipelineRun' and 'TaskRun' are excluded from argocd
# Cf. https://github.com/tektoncd/pipeline/issues/3202
# This annotation will be added to the child Runs of this task
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
params:
- name: drupalSite
......
......@@ -2,6 +2,12 @@ apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
name: database-restore
annotations:
app: drupal
# TEKTON runs work only when 'PipelineRun' and 'TaskRun' are excluded from argocd
# Cf. https://github.com/tektoncd/pipeline/issues/3202
# This annotation will be added to the child Runs of this task
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
params:
- name: drupalSite
......
......@@ -2,6 +2,12 @@ apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
name: drupalsite-backup
annotations:
app: drupal
# TEKTON runs work only when 'PipelineRun' and 'TaskRun' are excluded from argocd
# Cf. https://github.com/tektoncd/pipeline/issues/3202
# This annotation will be added to the child Runs of this task
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
params:
- name: drupalSite
......
......@@ -2,6 +2,12 @@ apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
name: drupalsite-restore
annotations:
app: drupal
# TEKTON runs work only when 'PipelineRun' and 'TaskRun' are excluded from argocd
# Cf. https://github.com/tektoncd/pipeline/issues/3202
# This annotation will be added to the child Runs of this task
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
params:
- name: drupalSite
......@@ -33,18 +39,20 @@ spec:
export OPERATIONS_IMAGE={{ .Values.image }}
export RESTORE_SERVICE_ACCOUNT={{ .Values.restoreServiceAccount }}
envsubst < /tekton-task-templates/restore_pv_job.yaml | oc create -f -
oc wait --for=condition=complete job/$TASK-$DRUPALSITE -n $VELERO_NAMESPACE
oc wait --for=condition=complete "job/$TASK-$DRUPALSITE" -n "$VELERO_NAMESPACE"
jobStatus=$(oc get job/$TASK-$DRUPALSITE -n $VELERO_NAMESPACE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed")
echo "Files restore Job status: $jobStatus"
echo "Files restore Job logs:"
oc logs job/$TASK-$DRUPALSITE -n $VELERO_NAMESPACE
oc logs "job/$TASK-$DRUPALSITE" -n "$VELERO_NAMESPACE"
echo "Cleaning up Jobs"
oc delete -n "$VELERO_NAMESPACE" "job/$TASK-$DRUPALSITE"
echo "--------------------------- Drupalsite database restore ---------------------------"
export TASK=db-restore-$DATE
export SERVING_POD_IMAGE=$(oc get -n $NAMESPACE drupalsite/$DRUPALSITE -o=jsonpath='{.status.servingPodImage}')
export OPERATION="database-restore"
export ARGS="-f 'database_backup.sql'"
envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n $NAMESPACE -f -
envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n "$NAMESPACE" -f -
oc wait --for=condition=complete job/$TASK-$DRUPALSITE
jobStatus=$(oc get job/$TASK-$DRUPALSITE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed")
echo "Database restore Job status: $jobStatus"
......
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
generateName: database-restore-
spec:
taskRef:
name: database-restore
kind: ClusterTask
params:
- name: drupalSite
value: test-dimitra-drupalsite
- name: namespace
value: test-dimitra
serviceAccountName: tektoncd
......@@ -11,4 +11,6 @@ spec:
value: test-dimitra-drupalsite
- name: namespace
value: test-dimitra
- name: backup
value: tekton-test
serviceAccountName: tektoncd
......@@ -4,11 +4,13 @@ metadata:
generateName: drupalsite-restore-
spec:
taskRef:
name: database-restore
name: drupalsite-restore
kind: ClusterTask
params:
- name: drupalSite
value: test-dimitra-drupalsite
value: drupalsite-sample
- name: backupName
value: ravineet-1-tekton-test-fbfe0
- name: namespace
value: test-dimitra
value: ravineet-1
serviceAccountName: tektoncd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment