diff --git a/cloudbuild.yaml b/cloudbuild.yaml index d74f306f0be..b29014a3533 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -53,9 +53,29 @@ steps: ".", ] - - name: "us.gcr.io/$PROJECT_ID/relay:$COMMIT_SHA" - args: ['--help'] - id: "smoke test" + # On-premise Integration tests + - name: 'gcr.io/$PROJECT_ID/docker-compose' + entrypoint: 'bash' + env: + - 'RELAY_IMAGE=us.gcr.io/$PROJECT_ID/relay:$COMMIT_SHA' + - 'SENTRY_TEST_HOST=http://nginx' + - 'CI=1' + args: + - '-e' + - '-c' + - | + mkdir onpremise && cd onpremise + # TODO(byk): We may also build this part as a builder image everytime + # there's a push to onpremise and use that image for + curl -L "https://github.com/getsentry/onpremise/archive/master.tar.gz" | tar xzf - --strip-components=1 + # The following trick is from https://stackoverflow.com/a/52400857/90297 with great gratuity + echo '{"version": "3.4", "networks":{"default":{"external":{"name":"cloudbuild"}}}}' > docker-compose.override.yml + ./install.sh + docker-compose run --rm web createuser --superuser --email test@example.com --password test123TEST + docker-compose up -d + timeout 20 bash -c 'until $(curl -Isf -o /dev/null http://nginx); do printf "."; sleep 0.5; done' || docker-compose logs web + ./test.sh || docker-compose logs nginx web relay + timeout: 450s - name: 'gcr.io/cloud-builders/docker' secretEnv: ['DOCKER_PASSWORD']