Skip to content

Commit

Permalink
Add cacheFrom to action/task definition + docs (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartleeks authored Sep 2, 2022
1 parent 4c819a6 commit afa58a5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ inputs:
userDataFolder:
required: false
description: Some steps for building the dev container (e.g. container-features) require generating additional build files. To aid docker build cache re-use, you can use this property to set the path that these files will be generated under and use the actions/cache action to cache that folder across runs
cacheFrom:
required: False
description: Specify additional images to use for build caching
runs:
using: 'node16'
main: 'github-action/run-main.js'
Expand Down
6 changes: 6 additions & 0 deletions azdo-task/DevcontainersCi/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
"required": false,
"defaultValue": false

},
{
"name": "cacheFrom",
"type": "multiLine",
"label": "Specify additional images to use for build caching",
"required": false
}
],
"outputVariables": [],
Expand Down
3 changes: 2 additions & 1 deletion azdo-task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ In the example above, the devcontainer-build-run will perform the following step
| subFolder | false | Use this to specify the repo-relative path to the folder containing the dev container (i.e. the folder that contains the `.devcontainer` folder). Defaults to repo root |
| runCmd | true | The command to run after building the dev container image |
| env | false | Specify environment variables to pass to the dev container when run |
| push | false | One of: `never`, `filter`, `always`. When set to `filter`, the image if pushed if the `sourceBranchFilterForPush`, `buildReasonsForPush`, and `pushOnFailedBuild` conditions are met. Defaults to `filter` if `imageName` is set, `never` otherwise. |
| push | false | One of: `never`, `filter`, `always`. When set to `filter`, the image if pushed if the `sourceBranchFilterForPush`, `buildReasonsForPush`, and `pushOnFailedBuild` conditions are met. Defaults to `filter` if `imageName` is set, `never` otherwise. |
| pushOnFailedBuild | false | If `false` (default), only push if the build is successful. Set to true to push on failed builds |
| sourceBranchFilterForPush | false | Allows you to limit which branch's builds are pushed to the registry (only specified branches are allowed to push). If empty, all branches are allowed |
| buildReasonsForPush | false | Allows you to limit the Build.Reason values that are allowed to push to the registry. Defaults to Manual, IndividualCI, BatchedCI. See https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&viewFallbackFrom=vsts&tabs=yaml |
| skipContainerUserIdUpdate | false | For non-root dev containers (i.e. where `remoteUser` is specified), the action attempts to make the container user UID and GID match those of the host user. Set this to true to skip this step (defaults to false) |
| cacheFrom | false | Specify additional images to use for build caching |


## Specifying a sub-folder
Expand Down
3 changes: 2 additions & 1 deletion docs/azure-devops-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ In the example above, the devcontainer-build-run will perform the following step
| subFolder | false | Use this to specify the repo-relative path to the folder containing the dev container (i.e. the folder that contains the `.devcontainer` folder). Defaults to repo root |
| runCmd | true | The command to run after building the dev container image |
| env | false | Specify environment variables to pass to the dev container when run |
| push | false | One of: `never`, `filter`, `always`. When set to `filter`, the image if pushed if the `sourceBranchFilterForPush`, `buildReasonsForPush`, and `pushOnFailedBuild` conditions are met. Defaults to `filter` if `imageName` is set, `never` otherwise. |
| push | false | One of: `never`, `filter`, `always`. When set to `filter`, the image if pushed if the `sourceBranchFilterForPush`, `buildReasonsForPush`, and `pushOnFailedBuild` conditions are met. Defaults to `filter` if `imageName` is set, `never` otherwise. |
| pushOnFailedBuild | false | If `false` (default), only push if the build is successful. Set to true to push on failed builds |
| sourceBranchFilterForPush | false | Allows you to limit which branch's builds are pushed to the registry (only specified branches are allowed to push). If empty, all branches are allowed |
| buildReasonsForPush | false | Allows you to limit the Build.Reason values that are allowed to push to the registry. Defaults to Manual, IndividualCI, BatchedCI. See https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&viewFallbackFrom=vsts&tabs=yaml |
| skipContainerUserIdUpdate | false | For non-root dev containers (i.e. where `remoteUser` is specified), the action attempts to make the container user UID and GID match those of the host user. Set this to true to skip this step (defaults to false) |
| cacheFrom | false | Specify additional images to use for build caching |


## Specifying a sub-folder
Expand Down
25 changes: 13 additions & 12 deletions docs/github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,19 @@ The [`devcontainers/ci` action](https://github.com/marketplace/actions/devcontai

## Inputs

| Name | Required | Description |
| ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| imageName | true | Image name to use when building the dev container image (including registry) |
| imageTag | false | Image tag to use when building/pushing the dev container image (defaults to `latest`) |
| subFolder | false | Use this to specify the repo-relative path to the folder containing the dev container (i.e. the folder that contains the `.devcontainer` folder). Defaults to repo root |
| runCmd | true | The command to run after building the dev container image |
| env | false | Specify environment variables to pass to the dev container when run |
| checkoutPath | false | Only used for development/testing |
| push | false | Control when images are pushed. Options are `never`, `filter`, `always`. For `filter`, images are pushed if the `refFilterForPush` and `eventFilterForPush` conditions are met. Defaults to `filter` if `imageName` is set, `never` otherwise. |
| refFilterForPush | false | Set the source branches (e.g. `refs/heads/main`) that are allowed to trigger a push of the dev container image. Leave empty to allow all (default) |
| eventFilterForPush | false | Set the event names (e.g. `pull_request`, `push`) that are allowed to trigger a push of the dev container image. Defaults to `push`. Leave empty for all |
| skipContainerUserIdUpdate | false | For non-root dev containers (i.e. where `remoteUser` is specified), the action attempts to make the container user UID and GID match those of the host user. Set this to true to skip this step (defaults to false) |
| Name | Required | Description |
| ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| imageName | true | Image name to use when building the dev container image (including registry) |
| imageTag | false | Image tag to use when building/pushing the dev container image (defaults to `latest`) |
| subFolder | false | Use this to specify the repo-relative path to the folder containing the dev container (i.e. the folder that contains the `.devcontainer` folder). Defaults to repo root |
| runCmd | true | The command to run after building the dev container image |
| env | false | Specify environment variables to pass to the dev container when run |
| checkoutPath | false | Only used for development/testing |
| push | false | Control when images are pushed. Options are `never`, `filter`, `always`. For `filter`, images are pushed if the `refFilterForPush` and `eventFilterForPush` conditions are met. Defaults to `filter` if `imageName` is set, `never` otherwise. |
| refFilterForPush | false | Set the source branches (e.g. `refs/heads/main`) that are allowed to trigger a push of the dev container image. Leave empty to allow all (default) |
| eventFilterForPush | false | Set the event names (e.g. `pull_request`, `push`) that are allowed to trigger a push of the dev container image. Defaults to `push`. Leave empty for all |
| skipContainerUserIdUpdate | false | For non-root dev containers (i.e. where `remoteUser` is specified), the action attempts to make the container user UID and GID match those of the host user. Set this to true to skip this step (defaults to false) |
| cacheFrom | false | Specify additional images to use for build caching |

## Specifying a sub-folder

Expand Down

0 comments on commit afa58a5

Please sign in to comment.