Last active
December 6, 2018 12:06
-
-
Save xingxing/886b3f5479a7a8f04191915d511a433e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p cloudbuild | |
projectName=$(pwd | awk -F / '{print $NF}') | |
echo $projectName | |
touch cloudbuild/production.yaml cloudbuild/scambio.yaml | |
cat <<EOF > cloudbuild/scambio.yaml | |
steps: | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['build', | |
'-t', 'gcr.io/\$PROJECT_ID/github.com/scambio/$projectName:\$COMMIT_SHA', | |
'-t', 'gcr.io/\$PROJECT_ID/github.com/scambio/$projectName:latest', | |
'--cache-from', 'gcr.io/\$PROJECT_ID/github.com/scambio/$projectName:latest', | |
'.'] | |
images: | |
- 'gcr.io/\$PROJECT_ID/github.com/scambio/$projectName:\$COMMIT_SHA' | |
- 'gcr.io/\$PROJECT_ID/github.com/scambio/$projectName:latest' | |
logsBucket: gs://cloud-build.logs.deq.peatio.com/scambio | |
EOF | |
cat <<EOF > cloudbuild/production.yaml | |
steps: | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['build', | |
'-t', 'gcr.io/\$PROJECT_ID/github.com/peatio/$projectName:\$TAG_NAME', | |
'-t', 'gcr.io/\$PROJECT_ID/github.com/peatio/$projectName:latest', | |
'--cache-from', 'gcr.io/\$PROJECT_ID/github.com/peatio/$projectName:latest', | |
'.'] | |
images: | |
- 'gcr.io/\$PROJECT_ID/github.com/peatio/$projectName:\$TAG_NAME' | |
- 'gcr.io/\$PROJECT_ID/github.com/peatio/$projectName:latest' | |
logsBucket: gs://cloud-build.logs.deq.peatio.com/production | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment