diff --git a/examples/site-install-taskrun.yaml b/examples/site-install-taskrun.yaml new file mode 100644 index 0000000000000000000000000000000000000000..298a71ebad3033cdf0626230b6c7f1c320b9b585 --- /dev/null +++ b/examples/site-install-taskrun.yaml @@ -0,0 +1,14 @@ +apiVersion: tekton.dev/v1beta1 +kind: TaskRun +metadata: + name: site-install +spec: + taskRef: + name: site-install + kind: ClusterTask + params: + - name: drupalSite + value: test-dimitra-drupalsite + - name: namespace + value: test-dimitra + serviceAccountName: tektoncd diff --git a/tasks/site-install.yaml b/tasks/site-install.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5606f4addbff5d422dba831bc92c00da9a0cdb05 --- /dev/null +++ b/tasks/site-install.yaml @@ -0,0 +1,26 @@ +apiVersion: tekton.dev/v1beta1 +kind: ClusterTask +metadata: + name: site-install +spec: + params: + - name: drupalSite + type: string + description: The name of the drupal site + - name: namespace + type: string + description: The namespace of the drupal site + steps: + - name: site-install + image: image-registry.openshift-image-registry.svc:5000/openshift/cli:latest + command: + - /bin/sh + - '-c' + args: + - |- + sleep 200 + echo "--------------------------- Site install ---------------------------" + echo "Drupal site name: $(params.drupalSite)" + deploymentPod=$(oc get pods -n $(params.namespace) -l drupalSite=$(params.drupalSite) -l app=drupal -o custom-columns=POD:.metadata.name --no-headers) + echo "Deployment pod: $deploymentPod" + oc exec $deploymentPod -c php-fpm -- drush site-install -y --config-dir=../config/sync --account-name=admin --account-pass=pass --account-mail=admin@example.com