From 795b35fbaa78704123eca3917b5361806b962871 Mon Sep 17 00:00:00 2001 From: Ben Stolz Date: Thu, 25 May 2023 16:12:20 -0600 Subject: [PATCH] add cloudbuild.yaml for new CI! (#7) --- cloudbuild.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 cloudbuild.yaml diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 0000000..2f99cc3 --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,44 @@ +steps: + - id: 'clone dev services' + name: gcr.io/cloud-builders/git + entrypoint: bash + secretEnv: + - GITHUB_TOKEN + args: + - '-c' + - | + git clone https://$$GITHUB_TOKEN@github.com/Yesware/dev-services.git + cd dev-services + echo -e "networks:\n default:\n external:\n name: cloudbuild" >> docker-compose.yml + - id: 'start dev services' + name: docker/compose + args: ['-f', 'dev-services/docker-compose.yml', 'up', '-d', '--build'] + - id: 'bundle install' + name: gcr.io/repcore-prod/yw-ci:latest + env: + - 'RAILS_ENV=test' + script: | + #!/usr/bin/env bash + source /nvm/nvmrc + bundle install + waitFor: ['-'] + volumes: + - name: 'bundle' + path: '/usr/local/bundle' + - id: 'rake ci' + name: gcr.io/repcore-prod/yw-ci:latest + env: + - 'RAILS_ENV=test' + script: | + #!/usr/bin/env bash + source /nvm/nvmrc + bundle exec rake ci + volumes: + - name: 'bundle' + path: '/usr/local/bundle' +options: + machineType: E2_HIGHCPU_32 +availableSecrets: + secretManager: + - versionName: projects/873947770763/secrets/CI_Github_Token/versions/latest + env: GITHUB_TOKEN