Skip to content

Commit

Permalink
feat(container): add build.targetImage parameter
Browse files Browse the repository at this point in the history
Allows referencing a specific image in a multi-stage Dockerfile.

Needed a refactor to be able to add a field to the build schema.
  • Loading branch information
edvald committed Feb 27, 2019
1 parent ee9165a commit 9bf6aa1
Show file tree
Hide file tree
Showing 16 changed files with 455 additions and 75 deletions.
22 changes: 0 additions & 22 deletions docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,26 +313,6 @@ Specify how to build the module. Note that plugins may define additional keys on
| Type | Required |
| ---- | -------- |
| `object` | No
### `module.build.command[]`
[module](#module) > [build](#module.build) > command

The command to run inside the module's directory to perform the build.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
module:
...
build:
...
command:
- npm
- run
- build
```
### `module.build.dependencies[]`
[module](#module) > [build](#module.build) > dependencies

Expand Down Expand Up @@ -395,8 +375,6 @@ module:
repositoryUrl:
allowPublish: true
build:
command:
[]
dependencies:
- name:
copy:
Expand Down
73 changes: 73 additions & 0 deletions docs/reference/module-types/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,72 @@ Configuration for a container module.
| Type | Required |
| ---- | -------- |
| `object` | No
### `module.build`
[module](#module) > build

Specify how to build the module. Note that plugins may define additional keys on this object.

| Type | Required |
| ---- | -------- |
| `object` | No
### `module.build.dependencies[]`
[module](#module) > [build](#module.build) > dependencies

A list of modules that must be built before this module is built.

| Type | Required |
| ---- | -------- |
| `array[object]` | No

Example:
```yaml
module:
...
build:
...
dependencies:
- name: some-other-module-name
```
### `module.build.dependencies[].name`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > name

Module name to build ahead of this module.

| Type | Required |
| ---- | -------- |
| `string` | Yes
### `module.build.dependencies[].copy[]`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > copy

Specify one or more files or directories to copy from the built dependency to this module.

| Type | Required |
| ---- | -------- |
| `array[object]` | No
### `module.build.dependencies[].copy[].source`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > [copy](#module.build.dependencies[].copy[]) > source

POSIX-style path or filename of the directory or file(s) to copy to the target.

| Type | Required |
| ---- | -------- |
| `string` | Yes
### `module.build.dependencies[].copy[].target`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > [copy](#module.build.dependencies[].copy[]) > target

POSIX-style path or filename to copy the directory or file(s) to (defaults to same as source path).

| Type | Required |
| ---- | -------- |
| `string` | No
### `module.build.targetImage`
[module](#module) > [build](#module.build) > targetImage

For multi-stage Dockerfiles, specify which image to build (see https://docs.docker.com/engine/reference/commandline/build/#specifying-target-build-stage---target for details).

| Type | Required |
| ---- | -------- |
| `string` | No
### `module.buildArgs`
[module](#module) > buildArgs

Expand Down Expand Up @@ -491,6 +557,13 @@ module:
## Complete YAML schema
```yaml
module:
build:
dependencies:
- name:
copy:
- source:
target: ''
targetImage:
buildArgs: {}
image:
hotReload:
Expand Down
86 changes: 86 additions & 0 deletions docs/reference/module-types/exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,84 @@ The module specification for an exec module.
| Type | Required |
| ---- | -------- |
| `object` | No
### `module.build`
[module](#module) > build

Specify how to build the module. Note that plugins may define additional keys on this object.

| Type | Required |
| ---- | -------- |
| `object` | No
### `module.build.dependencies[]`
[module](#module) > [build](#module.build) > dependencies

A list of modules that must be built before this module is built.

| Type | Required |
| ---- | -------- |
| `array[object]` | No

Example:
```yaml
module:
...
build:
...
dependencies:
- name: some-other-module-name
```
### `module.build.dependencies[].name`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > name

Module name to build ahead of this module.

| Type | Required |
| ---- | -------- |
| `string` | Yes
### `module.build.dependencies[].copy[]`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > copy

Specify one or more files or directories to copy from the built dependency to this module.

| Type | Required |
| ---- | -------- |
| `array[object]` | No
### `module.build.dependencies[].copy[].source`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > [copy](#module.build.dependencies[].copy[]) > source

POSIX-style path or filename of the directory or file(s) to copy to the target.

| Type | Required |
| ---- | -------- |
| `string` | Yes
### `module.build.dependencies[].copy[].target`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > [copy](#module.build.dependencies[].copy[]) > target

POSIX-style path or filename to copy the directory or file(s) to (defaults to same as source path).

| Type | Required |
| ---- | -------- |
| `string` | No
### `module.build.command[]`
[module](#module) > [build](#module.build) > command

The command to run inside the module's directory to perform the build.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
module:
...
build:
...
command:
- npm
- run
- build
```
### `module.env`
[module](#module) > env

Expand Down Expand Up @@ -122,6 +200,14 @@ Key/value map of environment variables. Keys must be valid POSIX environment var
## Complete YAML schema
```yaml
module:
build:
dependencies:
- name:
copy:
- source:
target: ''
command:
[]
env: {}
tasks:
- name:
Expand Down
64 changes: 64 additions & 0 deletions docs/reference/module-types/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,64 @@ module:
...
base: "my-base-chart"
```
### `module.build`
[module](#module) > build

Specify how to build the module. Note that plugins may define additional keys on this object.

| Type | Required |
| ---- | -------- |
| `object` | No
### `module.build.dependencies[]`
[module](#module) > [build](#module.build) > dependencies

A list of modules that must be built before this module is built.

| Type | Required |
| ---- | -------- |
| `array[object]` | No

Example:
```yaml
module:
...
build:
...
dependencies:
- name: some-other-module-name
```
### `module.build.dependencies[].name`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > name

Module name to build ahead of this module.

| Type | Required |
| ---- | -------- |
| `string` | Yes
### `module.build.dependencies[].copy[]`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > copy

Specify one or more files or directories to copy from the built dependency to this module.

| Type | Required |
| ---- | -------- |
| `array[object]` | No
### `module.build.dependencies[].copy[].source`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > [copy](#module.build.dependencies[].copy[]) > source

POSIX-style path or filename of the directory or file(s) to copy to the target.

| Type | Required |
| ---- | -------- |
| `string` | Yes
### `module.build.dependencies[].copy[].target`
[module](#module) > [build](#module.build) > [dependencies](#module.build.dependencies[]) > [copy](#module.build.dependencies[].copy[]) > target

POSIX-style path or filename to copy the directory or file(s) to (defaults to same as source path).

| Type | Required |
| ---- | -------- |
| `string` | No
### `module.chart`
[module](#module) > chart

Expand Down Expand Up @@ -421,6 +479,12 @@ Map of values to pass to Helm when rendering the templates. May include arrays a
```yaml
module:
base:
build:
dependencies:
- name:
copy:
- source:
target: ''
chart:
chartPath: .
dependencies: []
Expand Down
Loading

0 comments on commit 9bf6aa1

Please sign in to comment.