-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacker.json
57 lines (57 loc) · 2.1 KB
/
packer.json
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
49
50
51
52
53
54
55
56
57
{
"variables": {
"client_id": "",
"client_secret": "",
"subscription_id": "",
"tenant_id": "",
"managed_image_prefix": "",
"managed_image_resource_group_name": "",
"build_resource_group_name": "",
"ssh_username": "packer",
"ssh_password": "",
"ApplicationArtifacts": "",
"WorkingDirectory": ""
},
"sensitive-variables": ["client_secret"],
"builders": [
{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"tenant_id": "{{user `tenant_id`}}",
"subscription_id": "{{user `subscription_id`}}",
"build_resource_group_name": "{{user `build_resource_group_name`}}",
"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",
"ssh_pty": "true",
"managed_image_name": "{{user `managed_image_prefix`}}-{{timestamp}}",
"managed_image_resource_group_name": "{{user `managed_image_resource_group_name`}}",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "18.04-LTS",
"vm_size": "Standard_DS2_v2"
}
],
"provisioners": [
{
"type": "file",
"source": "{{user `WorkingDirectory`}}/{{user `ApplicationArtifacts`}}",
"destination": "/tmp"
},
{
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'",
"script": "{{user `WorkingDirectory`}}/setup.sh"
},
{
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'",
"inline": [
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell",
"skip_clean": true
}
]
}