update build workflows & bump private

pull/16055/head
alberhander 4 years ago
parent 7c312b7e59
commit 6a1a829d06

@ -1 +1 @@
Subproject commit 1d33e93f443ed6f3758934c221ff091a2cfc1a5b
Subproject commit 54b229efbf526b2c98bdb754f6681b84d238803e

Binary file not shown.

@ -61,10 +61,7 @@ steps:
args:
- -c
- |
cp private/script/ci/* .
cp private/Dockerfil* .
cp -r private/build_resources/ .
cp script/ci/* .
cp config/app_config.yml.sample config/app_config.yml
cp config/database.yml.sample config/database.yml
cp lib/assets/javascripts/cdb/secrets.example.json lib/assets/javascripts/cdb/secrets.json
@ -75,15 +72,27 @@ steps:
args:
- -c
- |
echo 'Building images...'
docker pull gcr.io/cartodb-on-gcp-main-artifacts/builder:latest
docker build --build-arg BUNDLE_JOBS=16 --build-arg COMPILE_ASSETS=true -t gcr.io/cartodb-on-gcp-main-artifacts/builder:latest -t gcr.io/cartodb-on-gcp-main-artifacts/builder:${SHORT_SHA} --cache-from gcr.io/cartodb-on-gcp-main-artifacts/builder:latest .
docker build -t gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:latest -t gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:${SHORT_SHA} -f Dockerfile.resque .
docker build -t gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:latest -t gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:${SHORT_SHA} -f Dockerfile.subscriber .
docker build --build-arg BUNDLE_JOBS=16 --build-arg COMPILE_ASSETS=true -t gcr.io/cartodb-on-gcp-main-artifacts/builder:${BRANCH_NAME} -t gcr.io/cartodb-on-gcp-main-artifacts/builder:${SHORT_SHA} -t gcr.io/cartodb-on-gcp-main-artifacts/builder:${BRANCH_NAME}--${SHORT_SHA} --cache-from gcr.io/cartodb-on-gcp-main-artifacts/builder:latest .
docker build -t gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:${BRANCH_NAME} -t gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:${SHORT_SHA} -t gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:${BRANCH_NAME}--${SHORT_SHA} -f Dockerfile.resque .
docker build -t gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:${BRANCH_NAME} -t gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:${SHORT_SHA} -t gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:${BRANCH_NAME}--${SHORT_SHA} -f Dockerfile.subscriber .
echo 'Pushing builder image...'
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder:${BRANCH_NAME}
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder:${SHORT_SHA}
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder:latest
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder:${BRANCH_NAME}--${SHORT_SHA}
echo 'Pushing builder-resque image...'
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:${BRANCH_NAME}
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:${SHORT_SHA}
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:latest
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:${BRANCH_NAME}--${SHORT_SHA}
echo 'Pushing builder-subscriber image...'
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:${BRANCH_NAME}
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:${SHORT_SHA}
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:latest
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:${BRANCH_NAME}--${SHORT_SHA}
if [ "${BRANCH_NAME}" == 'master' ];then
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder:latest
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-resque:latest
docker push gcr.io/cartodb-on-gcp-main-artifacts/builder-subscriber:latest
fi
timeout: 1800s

@ -1,81 +0,0 @@
steps:
# Cancel previous job on the same branch
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args:
- '-c'
- 'gcloud builds list --ongoing --filter="buildTriggerId=7c2750ed-7d87-4d94-9f60-de53b2e64c61 AND substitutions.BRANCH_NAME=${BRANCH_NAME} AND id!=${BUILD_ID}" --format="get(ID)" > jobs_to_cancel'
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args:
- '-c'
- 'gcloud builds cancel $(cat jobs_to_cancel | xargs) || true'
# Decrypt github key
- name: gcr.io/cloud-builders/gcloud
args:
- kms
- decrypt
- --ciphertext-file=script/ci/.id_github_cartofante.enc
- --plaintext-file=/root/.ssh/id_rsa
- --location=global
- --keyring=keyring-github-ci
- --key=github-key
volumes:
- name: 'ssh'
path: /root/.ssh
# Set up git with key and domain
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args:
- '-c'
- |
chmod 600 /root/.ssh/id_rsa
cat <<EOF >/root/.ssh/config
Hostname github.com
IdentityFile /root/.ssh/id_rsa
EOF
mv script/ci/known_hosts /root/.ssh/known_hosts
volumes:
- name: 'ssh'
path: /root/.ssh
# Clean working directory
- name: alpine
args: ['sh', '-c', 'rm -rf .* | true && rm -rf *']
# Checkout repo with submodules
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'sh'
args: ['-c', 'git clone git@github.com:CartoDB/cartodb.git -b "${BRANCH_NAME}" --depth 1 --recursive .']
volumes:
- name: 'ssh'
path: /root/.ssh
# Checkout ci-tools
- name: 'gcr.io/cloud-builders/git'
args:
- clone
- git@github.com:CartoDB/ci-tools.git
volumes:
- name: 'ssh'
path: /root/.ssh
- name: ubuntu
args: ['bash', '-c', 'cp ci-tools/repos/cartodb/* . && cp config/app_config.yml.sample.py2 config/app_config.yml && cp config/database.yml.sample config/database.yml && cp lib/assets/javascripts/cdb/secrets.example.json lib/assets/javascripts/cdb/secrets.json && cp script/ci/* .']
- name: 'docker/compose:1.22.0'
args: ['-f', 'docker-compose-pg11.yml', 'up', '--build', '-d']
timeout: 900s
- name: gcr.io/cloud-builders/docker
args: ['exec', '-e', 'SLACK_TOKEN=$_SLACK_TOKEN', '-e', 'BUILD_ID=$BUILD_ID', '-e', 'BRANCH_NAME=$BRANCH_NAME', '-i', 'builder_1', 'bash', '-c',
"trap '/cartodb/script/ci/send_slack_notification.sh' ERR && /cartodb/runParallelTests.sh 24" ]
timeout: 2700s
options:
machineType: 'N1_HIGHCPU_32'
timeout: 3600s

@ -1,79 +0,0 @@
steps:
# Cancel previous job on the same branch
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args:
- '-c'
- 'gcloud builds list --ongoing --filter="buildTriggerId=51a5fed6-3b1c-4b53-aa4c-9855ccb3f510 AND substitutions.BRANCH_NAME=${BRANCH_NAME} AND id!=${BUILD_ID}" --format="get(ID)" > jobs_to_cancel'
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args:
- '-c'
- 'gcloud builds cancel $(cat jobs_to_cancel | xargs) || true'
# Decrypt github key
- name: gcr.io/cloud-builders/gcloud
args:
- kms
- decrypt
- --ciphertext-file=script/ci/.id_github_cartofante.enc
- --plaintext-file=/root/.ssh/id_rsa
- --location=global
- --keyring=keyring-github-ci
- --key=github-key
volumes:
- name: 'ssh'
path: /root/.ssh
# Set up git with key and domain
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args:
- '-c'
- |
chmod 600 /root/.ssh/id_rsa
cat <<EOF >/root/.ssh/config
Hostname github.com
IdentityFile /root/.ssh/id_rsa
EOF
mv script/ci/known_hosts /root/.ssh/known_hosts
volumes:
- name: 'ssh'
path: /root/.ssh
# Clean working directory
- name: alpine
args: ['sh', '-c', 'rm -rf .* | true && rm -rf *']
# Checkout repo with submodules
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'sh'
args: ['-c', 'git clone git@github.com:CartoDB/cartodb.git -b "${BRANCH_NAME}" --depth 1 --recursive .']
volumes:
- name: 'ssh'
path: /root/.ssh
# Checkout ci-tools
- name: 'gcr.io/cloud-builders/git'
args: ['clone', '-b', 'master', 'git@github.com:CartoDB/ci-tools.git']
volumes:
- name: 'ssh'
path: /root/.ssh
- name: ubuntu
args: ['bash', '-c', 'cp ci-tools/repos/cartodb/* . && cp config/app_config.yml.sample config/app_config.yml && cp config/database.yml.sample config/database.yml && cp lib/assets/javascripts/cdb/secrets.example.json lib/assets/javascripts/cdb/secrets.json && cp script/ci/* .']
- name: 'docker/compose:1.22.0'
args: ['-f', 'docker-compose-pg12.yml', 'up', '--build', '-d']
timeout: 900s
- name: gcr.io/cloud-builders/docker
args: ['exec', '-e', 'SLACK_TOKEN=$_SLACK_TOKEN', '-e', 'BUILD_ID=$BUILD_ID', '-e', 'BRANCH_NAME=$BRANCH_NAME', '-i', 'builder_1', 'bash', '-c',
"trap '/cartodb/script/ci/send_slack_notification.sh' ERR && /cartodb/runParallelTests.sh 24" ]
timeout: 2700s
options:
machineType: 'N1_HIGHCPU_32'
timeout: 3600s
Loading…
Cancel
Save