-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathskaffold.yaml
68 lines (68 loc) · 2.35 KB
/
skaffold.yaml
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
apiVersion: skaffold/v4beta12
kind: Config
manifests:
rawYaml:
- k8s-pod.yaml
hooks:
before:
- host:
command: ["sh", "-c", "echo pre-render host hook running on $(hostname)!"]
after:
- host:
command: ["sh", "-c", "echo post-render host hook running on $(hostname)!"]
build:
hooks:
before:
- command: ["sh", "-c", "echo pre-build hook running"]
after:
- command: ["sh", "-c", "echo post-build hook running"]
artifacts:
- image: hooks-example
hooks:
before:
- command: ["sh", "-c", "./hook.sh"]
os: [darwin, linux]
dir: .
- command: ["cmd.exe", "/C", "hook.bat"]
os: [windows]
dir: .
after:
- command: ["sh", "-c", "docker images $SKAFFOLD_IMAGE --digests"]
os: [darwin, linux]
- command: ["cmd.exe", "/C", "docker images %SKAFFOLD_IMAGE% --digests"]
os: [windows]
sync:
manual:
- src: 'hello.txt'
dest: .
hooks:
before:
- host:
command: ["sh", "-c", "echo file changes detected: $SKAFFOLD_FILES_ADDED_OR_MODIFIED"]
os: [darwin, linux]
- host:
command: ["cmd.exe", "/C", "echo file changes detected: %SKAFFOLD_FILES_ADDED_OR_MODIFIED%"]
os: [windows]
after:
- container:
command: ["sh", "-c", "set -x; kill -HUP 1"]
deploy:
kubectl:
hooks:
before:
- host:
command: ["sh", "-c", "echo pre-deploy host hook running on $(hostname)!"]
os: [darwin, linux]
- container:
# this will only run when there's a matching container from a previous deploy iteration like in `skaffold dev`
command: ["sh", "-c", "echo pre-deploy container hook running on $(hostname)!"]
containerName: hooks-example*
podName: hooks-example-deployment*
after:
- host:
command: ["sh", "-c", "echo post-deploy host hook running on $(hostname)!"]
os: [darwin, linux]
- container:
command: ["sh", "-c", "echo post-deploy container hook running on $(hostname)!"]
containerName: hooks-example* # use a glob pattern to prefix-match the container name and pod name for deployments, stateful-sets, etc.
podName: hooks-example-deployment*