-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.json
More file actions
92 lines (92 loc) · 2.36 KB
/
Copy pathsetup.json
File metadata and controls
92 lines (92 loc) · 2.36 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
"builders": [
{
"ssh_agent_auth": true,
"ssh_host": "{{ user `ssh_host` }}",
"ssh_username": "{{ user `ssh_user` }}",
"type": "null"
},
{
"changes": [
"VOLUME [\"/run/lock\"]",
"ENTRYPOINT [\"/sbin/init\"]"
],
"commit": true,
"image": "{{ user `from` }}",
"type": "docker"
}
],
"post-processors": [
{
"only": [
"docker"
],
"repository": "{{ user `vendor`}}/{{ user `project` }}",
"tags": [
"latest"
],
"type": "docker-tag"
}
],
"provisioners": [
{
"inline": [
"passwd -d root"
],
"inline_shebang": "/bin/sh -eux",
"only": [
"docker"
],
"type": "shell"
},
{
"inline": [
"git bundle create {{ user `family`}}.{{ build_name }}.git HEAD"
],
"inline_shebang": "/bin/sh -eux",
"type": "shell-local"
},
{
"destination": "/tmp/{{ user `family`}}.git",
"generated": true,
"source": "{{ user `family`}}.{{ build_name }}.git",
"type": "file"
},
{
"inline": [
"rm {{ user `family`}}.{{ build_name }}.git"
],
"inline_shebang": "/bin/sh -eux",
"type": "shell-local"
},
{
"environment_vars": [
"VENDOR={{ user `vendor` }}",
"PROJECT={{ user `project` }}",
"APT_PROXY={{ user `apt_proxy` }}",
"REPO={{ user `repo` }}",
"BRANCH={{ user `branch` }}",
"TAG={{ user `tag` }}",
"OPENSSL={{ user `openssl` }}"
],
"execute_command": "[ $(id -u) -eq 0 ] || SUDO=sudo; env {{ .Vars }} ${SUDO:+$SUDO --preserve-env=PACKER_BUILDER_TYPE,VENDOR,PROJECT,APT_PROXY,REPO,BRANCH,TAG,OPENSSL} /bin/sh -eux '{{ .Path }}'",
"script": "setup",
"type": "shell"
},
{
"execute_command": "[ $(id -u) -eq 0 ] || SUDO=sudo; env {{ .Vars }} ${SUDO:-} /bin/sh -eux '{{ .Path }}'",
"inline": [
"find \"$(getent passwd root | cut -d: -f6)/.ssh\" -type f -print0 2>&- | xargs -r -0 shred -u",
"rm -rf \"$(getent passwd root | cut -d: -f6)/.ssh\""
],
"type": "shell"
}
],
"variables": {
"family": "{{ user `vendor`}}-{{ user `project` }}",
"name": "{{ user `commit` }}",
"from": "debian:bullseye-slim",
"ssh_host": "192.0.2.100",
"ssh_user": "{{ env `USER` }}"
}
}