platform: linux
inputs:
- name: continuous-deployment-on-kubernetes
outputs:
- name: email
image_resource:
    type: docker-image
    source:
      repository: google/cloud-sdk
      tag: latest
params:
  service_account_json:
  project_id:
  zone:
run:
  path: bash
  args:
  - -exc
  - |
    cat > service_account.json <<EOF
    $service_account_json
    EOF
    apt-get install -y git openssl
    gcloud auth activate-service-account --key-file=service_account.json
    gcloud config set project $project_id
    gcloud config set compute/zone $zone

    cd continuous-deployment-on-kubernetes
    # Setup email
    echo "CD on K8s: Failed to run tutorial" > ../email/subject-failed
    git --no-pager show > ../email/body-failed

    ./tests/scripts/cleanup.sh | tee ../email/body-failed
    ./tests/scripts/install-jenkins.sh | tee ../email/body-failed

platform: linux
inputs:
- name: continuous-deployment-on-kubernetes
outputs:
- name: email
image_resource:
    type: docker-image
    source:
      repository: google/cloud-sdk
      tag: latest
params:
  service_account_json:
  project_id:
  zone:
run:
  path: bash
  args:
  - -exc
  - |
    set -o pipefail
    cat > service_account.json <<EOF
    $service_account_json
    EOF
    apt-get install -y git openssl
    gcloud auth activate-service-account --key-file=service_account.json
    gcloud config set project $project_id
    gcloud config set compute/zone $zone

    cd continuous-deployment-on-kubernetes
    # Setup email
    echo "CD on K8s: Failed to run tutorial" > ../email/subject-failed
    git --no-pager show > ../email/body-failed

    ./tests/scripts/cleanup.sh | tee ../email/body-failed
    ./tests/scripts/install-jenkins.sh | tee ../email/body-failed

Set -o pipefail in install_jenkins pipeline
Set -o pipefail in install_jenkins pipeline