-
Notifications
You must be signed in to change notification settings - Fork 0
/
porter.yaml
executable file
·93 lines (79 loc) · 2.39 KB
/
porter.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# This is the configuration for Porter
# You must define steps for each action, but the rest is optional
# Uncomment out the sections below to take full advantage of what Porter can do!
mixins:
- exec
name: WSLDISTRO
version: 0.7.0
description: "Build WSL distros from Docker containers"
invocationImage: nunix/wsldistro:latest
parameters:
- name: DISTRO_IMAGE
type: string
default: "alpine"
- name: DISTRO_NAME
type: string
default: "wslcnab"
- name: DISTRO_PATH
type: string
default: "/github/wslcustom"
- name: DISTRO_SOURCE
type: string
default: "/github/wslcustom.tar"
- name: DOCKER_SOURCE
type: string
default: "/usr/local/docker/docker"
- name: WSL_SOURCE
type: string
default: "/mnt/c/Windows/System32/wsl.exe"
install:
- exec:
description: "===PORTER DEP=== Creates a container based on the image"
command: "{{ bundle.parameters.DOCKER_SOURCE }}"
arguments:
- run
- -d
- --name
- "{{ bundle.parameters.DISTRO_NAME }}"
- "{{ bundle.parameters.DISTRO_IMAGE }}"
- /bin/sh
- exec:
description: "===PORTER MAIN=== Export the Docker container to TAR file"
command: "{{ bundle.parameters.DOCKER_SOURCE }}"
arguments:
- export
- --output
- "{{ bundle.parameters.DISTRO_SOURCE }}"
- "{{ bundle.parameters.DISTRO_NAME }}"
- exec:
description: "===PORTER MAIN=== Install a new WSL distro"
command: "{{ bundle.parameters.WSL_SOURCE }}"
arguments:
- --import
- "{{ bundle.parameters.DISTRO_NAME }}"
- "{{ bundle.parameters.DISTRO_PATH }}"
- "{{ bundle.parameters.DISTRO_SOURCE }}"
uninstall:
- exec:
description: "===PORTER MAIN=== Uninstall a WSL distro"
command: "{{ bundle.parameters.WSL_SOURCE }}"
arguments:
- --unregister
- "{{ bundle.parameters.DISTRO_NAME }}"
- exec:
description: "===PORTER DEP=== Removes the builder container"
command: "{{ bundle.parameters.DOCKER_SOURCE }}"
arguments:
- rm
- -f
- "{{ bundle.parameters.DISTRO_NAME }}"
#region The Corsair will steal 😈
upgrade:
- exec:
description: "=== To infinity and beyond ==="
command: "{{ bundle.parameters.WSL_SOURCE }}"
arguments:
- --set-version
- "{{ bundle.parameters.DISTRO_NAME }}"
- 2
#endregion