-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathbuild_gcp_private.yaml
More file actions
48 lines (44 loc) · 1.09 KB
/
build_gcp_private.yaml
File metadata and controls
48 lines (44 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
steps:
# Decrypt the file containing the access key.
- name: 'gcr.io/cloud-builders/gcloud'
args:
- kms
- decrypt
- --ciphertext-file=version1key.enc
- --plaintext-file=/root/.ssh/id_rsa
- --location=global
- --keyring=version1-keyring
- --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 known_hosts /root/.ssh/known_hosts
volumes:
- name: 'ssh'
path: /root/.ssh
# Clone the repository.
- name: 'gcr.io/cloud-builders/git'
args:
- clone
- '--depth'
- '1'
- git@github.com:dnstanciu/drf-angular-docker-tutorial.git
volumes:
- name: 'ssh'
path: /root/.ssh
# Build and tag the image.
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/yourproject/version1', './drf-angular-docker-tutorial/django']
# Publish the image to Container Registry.
images: ['gcr.io/yourproject/version1']