Skip to content

Commit

Permalink
update package-image docker file and context defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
henrjk committed Sep 1, 2023
1 parent 653da5f commit 1570bfd
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ listed in the changelog.

### Changed

- Build tasks streamlining and avoidance of file copies (#678 fixed by [#710](https://github.com/opendevstack/ods-pipeline/pull/710)). This is an incompatible change. Build tasks were adjusted to (mostly) no longer copy build files in a dedicated location. Instead one should adjust a Dockerfile (or other downstream tasks) to directly consume the build outputs from their natural locations. In addition build task skipping is now an opt-in with parameter `cache-sources`. See the PR for further information and the issue for more context.
- Build tasks streamlining and avoidance of file copies (#678 fixed by [#710](https://github.com/opendevstack/ods-pipeline/pull/710)). This is an incompatible change. Build tasks were adjusted to (mostly) no longer copy build files in a dedicated location. Instead one should adjust a Dockerfile (or other downstream tasks) to directly consume the build outputs from their natural locations. In addition build task skipping is now an opt-in with parameter `cache-sources`. The package-image task `dockerfile` and `docker-dir` parameters have been changed to assume that the docker context and file are at the repository root. See the PR for further information and the issue for more context.

## [0.13.2] - 2023-07-18

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
- name: dockerfile
description: Path to the Dockerfile to build (relative to `docker-dir`).
type: string
default: ./docker/Dockerfile
default: ./Dockerfile
- name: docker-dir
description: Path to the directory to use as Docker context.
type: string
Expand Down
2 changes: 1 addition & 1 deletion docs/design/software-design-specification.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ a| Checks if an image with the tag to built exist already in the target registry

Builds a container image using SDS-EXT-18:

* The Docker context directory defaults to `docker` and can be overwritten by the `docker-dir` parameter.
* The Docker context directory defaults to `.` and can be overwritten by the `docker-dir` parameter.
* The Dockerfile defaults to `Dockerfile`, and can be overwritten by `dockerfile` parameter. The location is relative to the Docker context directory.
* The resulting image name and SHA is placed into `.ods/artifacts`.

Expand Down
2 changes: 1 addition & 1 deletion docs/tasks/ods-package-image.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The following artifacts are generated by the task and placed into `.ods/artifact


| dockerfile
| ./docker/Dockerfile
| ./Dockerfile
| Path to the Dockerfile to build (relative to `docker-dir`).


Expand Down
2 changes: 1 addition & 1 deletion tasks/ods-package-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
- name: dockerfile
description: Path to the Dockerfile to build (relative to `docker-dir`).
type: string
default: ./docker/Dockerfile
default: ./Dockerfile
- name: docker-dir
description: Path to the directory to use as Docker context.
type: string
Expand Down
5 changes: 4 additions & 1 deletion test/tasks/ods-package-image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ func TestTaskODSPackageImage(t *testing.T) {
},
"task should build image with build extra args param": {
WorkspaceDirMapping: map[string]string{"source": "hello-build-extra-args-app"},
TaskParamsMapping: map[string]string{"buildah-build-extra-args": "'--build-arg=firstArg=one --build-arg=secondArg=two'"},
TaskParamsMapping: map[string]string{
"buildah-build-extra-args": "'--build-arg=firstArg=one --build-arg=secondArg=two'",
"docker-dir": "docker",
},
PreRunFunc: func(t *testing.T, ctxt *tasktesting.TaskRunContext) {
wsDir := ctxt.Workspaces["source"]
ctxt.ODS = tasktesting.SetupGitRepo(t, ctxt.Namespace, wsDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM busybox
ARG firstArg
ARG secondArg

COPY message.txt message.txt

RUN echo "firstArg=${firstArg}" >> message.txt
RUN echo "secondArg=${secondArg}" >> message.txt
Expand Down
Empty file.

0 comments on commit 1570bfd

Please sign in to comment.