-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yamlOLD
42 lines (33 loc) · 1.34 KB
/
cloudbuild.yamlOLD
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
# In this directory, run the following command to build this builder.
# $ gcloud builds submit . --config=cloudbuild.yaml
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['components', 'install', 'kubectl']
#- name: 'gcr.io/cloud-builders/docker'
# args: ['build', '--tag=gcr.io/$PROJECT_ID/ansible', '-f', './Dockerfile', '.']
# Step 1: Check out your source code (if it's in a repository)
#- name: 'gcr.io/cloud-builders/git'
# args: ['clone', 'https://source.cloud.google.com/mofo-proj/ansible/.git', 'ansible']
#Simple sanity check: check that ansible-playbook has not errors
- name: 'gcr.io/$PROJECT_ID/ansible'
args: ['--version']
# Run some ansible commands for check
#- name: 'gcr.io/$PROJECT_ID/ansible'
# entrypoint: '/usr/bin/ansible'
# args: ['all', '-i', 'localhost,', '-c', 'local', '-e', 'ansible_python_interpreter=python3', '-m', 'setup', '-a', 'filter=ansible_hostname']
# Run Playbook
# name: 'gcr.io/$PROJECT_ID/ansible'
# entrypoint: '/usr/bin/ansible-playbook'
# args: ['./main.yml']
# Step 3: Run your Ansible playbook
- name: 'ubuntu'
entrypoint: 'bash'
args:
- '-c'
- |
cd ./ # Change to the directory containing your Ansible playbook
ansible-playbook ./main.yml --private-key ./keith -i hosts
images:
- 'gcr.io/$PROJECT_ID/ansible'
timeout: 1200s
tags: ['cloud-builders-community']