Multiple commands in the same build step in Google Cloud Builder

后端 未结 3 1384
礼貌的吻别
礼貌的吻别 2021-01-11 19:31

I want to run our automated backend test suite on Google Cloud Builder environment. However, naturally, I bumped into the need to install various dependencies and prerequisi

3条回答
  •  时光说笑
    2021-01-11 19:48

    You have 2 options to achieve this at the moment I believe:

    1. create a script that has the sequence of commands you'd like and call the script directly:
    # cloudbuild.yaml
    steps:
      - name: 'ubuntu'
        args: ['./my-awesome-script.sh']
    
    # my-awesome-script.sh
    /usr/bin/env/bash
    
    set -eo pipefail
    
    ./scripts/install-prerequisites.sh
    composer install -n -q --prefer-dist
    php init --overwrite=y
    php tests/run
    
    1. Call bash -c with all the commands you'd like to follow:
    steps:
      - name: 'ubuntu'
        args: ['bash', '-c', './scripts/install-prerequisites.sh && composer install -n -q --prefer-dist && php init --overwrite=y && php tests/run']
    

提交回复
热议问题