Skip to content

Commit

Permalink
Added variables
Browse files Browse the repository at this point in the history
- added bundle variables (after porter [PR #162](getporter/porter#162)
- full path to commands used
  • Loading branch information
nunix authored Feb 19, 2019
1 parent 883b483 commit 10c1a02
Showing 1 changed file with 37 additions and 23 deletions.
60 changes: 37 additions & 23 deletions porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,63 @@ mixins:
- exec

name: WSLDISTRO
version: 0.1.0
version: 0.2.0
description: "Build WSL distros from Docker containers"
invocationImage: wsl-distro:latest
invocationImage: nunix/wsl-distro:latest

parameters:
- name: DISTRO_IMAGE
type: string
default: "alpine"

- name: DISTRO_NAME
type: string
default: "wslcustom"

- name: DISTRO_PATH
type: string
default: "/mnt/c/github/wslcustom"

- name: DISTRO_SOURCE
type: string
default: "/mnt/c/github/wslcustom.tar"

install:
- description: "Creates a container based on the image"
exec:
command: /usr/local/docker/docker
arguments:
- run
- -d
- --name
- source: bundle.parameters.DISTRO_NAME
- source: bundle.parameters.DISTRO_IMAGE

- description: "Export the Docker container to TAR file"
exec:
command: "/mnt/c/Program Files/Docker/Docker/Resources/bin/docker.exe"
command: /usr/local/docker/docker
arguments:
- export
- --output
- ./alpine.tar
- alpine
- source: bundle.parameters.DISTRO_SOURCE
- source: bundle.parameters.DISTRO_NAME

- description: "Install a new WSL distro"
exec:
command: /mnt/c/WINDOWS/system32/wsl.exe
command: /mnt/c/Windows/System32/wsl.exe
arguments:
- --import
- "wslcustom"
- "./wslcustom"
- "./alpine.tar"
- source: bundle.parameters.DISTRO_NAME
- source: bundle.parameters.DISTRO_PATH
- source: bundle.parameters.DISTRO_SOURCE

uninstall:
- description: "Uninstall a WSL distro"
exec:
command: /mnt/c/WINDOWS/system32/wsl.exe
arguments:
- --unregister
- "wslcustom"

parameters:
- name: distro_name
type: string
default: wslcustom

- name: distro_path
type: string
default: "/mnt/c/github/wslcustom"

- name: distro_source
type: string
default: "/mnt/c/github/ubuntu1904.tar"
- source: bundle.parameters.DISTRO_NAME

#dependencies:
# - name: mysql
Expand Down

0 comments on commit 10c1a02

Please sign in to comment.