Skip to content

Commit cc29e6d

Browse files
author
Julien Bouquillon
authored
fix(build): default imagePackage to app (#412)
1 parent e9e28c3 commit cc29e6d

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

packages/kontinuous/tests/samples/jobs-build/env/dev/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
use: socialgouv/kontinuous/plugins/contrib/jobs/build
3131
with:
3232
registrySecretRefName: harbor
33-
imagePackage: app
3433
build-hasura:
3534
use: socialgouv/kontinuous/plugins/contrib/jobs/build
3635
with:

plugins/contrib/jobs/build/use.schema.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
"properties": {
99
"dockerfile": {
1010
"description": "Path to the Dockerfile on the repository. Defaults to /Dockerfile",
11+
"examples": ["./packages/api/custom.Dockerfile"],
12+
"default": "./Dockerfile",
1113
"type": "string"
1214
},
1315
"context": {
1416
"description": "Docker context (cwd) when building the image. Defaults to .",
17+
"examples": ["./packages/api"],
18+
"default": ".",
1519
"type": "string"
1620
},
1721
"registrySecretRefName": {
@@ -20,14 +24,17 @@
2024
},
2125
"registry": {
2226
"description": "Url of your custom docker registry",
27+
"examples": ["ghcr.io"],
2328
"type": "string"
2429
},
2530
"imagePackage": {
26-
"description": "Name of the dockerfile on the registry",
31+
"description": "Name of the docker image on the registry",
32+
"examples": ["app"],
2733
"type": "string"
2834
},
2935
"imageProject": {
3036
"description": "Optional project name in the docker registry",
37+
"examples": ["project"],
3138
"type": "string"
3239
},
3340
"imageRepository": {
@@ -62,14 +69,15 @@
6269
"type": "string"
6370
},
6471
"buildkitServiceAddr": {
65-
"description": "Adress of the buildkit service. defaults to `tcp://buildkit-service.buildkit-service.svc:1234`",
72+
"description": "Address of the buildkit service. defaults to `tcp://buildkit-service.buildkit-service.svc:1234`",
6673
"type": "string",
6774
"examples": ["tcp://buildkit-service.buildkit-service.svc:1234"]
68-
}
75+
}
6976
},
7077
"definitions": {
7178
"build-args": {
72-
"description": "Build args to customize the docker build",
79+
"title": "Docker image build arguments",
80+
"markdownDescription": "Build args to customize the docker, see [docker documentation](https://docs.docker.com/engine/reference/commandline/build/#build-arg)",
7381
"type": "object",
7482
"additionalProperties": true
7583
}

plugins/contrib/jobs/build/use.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
cpuRequest: 500m
1111
memoryLimit: 4Gi
1212
memoryRequest: 1Gi
13-
entrypoint: ["/bin/sh","-c"]
13+
entrypoint: ["/bin/sh", "-c"]
1414
user: 1000
1515
group: 1000
1616
annotations:
@@ -65,7 +65,7 @@ runs:
6565
6666
mkdir -p /home/user/.docker
6767
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /home/user/.docker/config.json
68-
export IMAGE_PATH=$CI_REGISTRY{{ if (or $.with.imageProject $.Values.global.imageProject) }}{{ (print "/" (or $.with.imageProject $.Values.global.imageProject)) }}{{ end }}/{{ or $.with.imageRepository $.Values.global.imageRepository }}{{ if $.with.imagePackage }}{{ (print "/" $.with.imagePackage) }}{{ end }}{{ if $.with.target }}{{ (print "-" $.with.target) }}{{ end }}
68+
export IMAGE_PATH=$CI_REGISTRY{{ if (or $.with.imageProject $.Values.global.imageProject) }}{{ (print "/" (or $.with.imageProject $.Values.global.imageProject)) }}{{ end }}/{{ or $.with.imageRepository $.Values.global.imageRepository }}{{ if $.with.imagePackage }}{{ (print "/" $.with.imagePackage) }}{{else}}/app{{ end }}{{ if $.with.target }}{{ (print "-" $.with.target) }}{{ end }}
6969
export LATEST_TAG=""
7070
if [ "{{ $.Values.global.isProd }}" = "true" ]; then
7171
export LATEST_TAG=",$IMAGE_PATH:latest"
@@ -92,5 +92,5 @@ runs:
9292
{{ if $.with.target -}}
9393
--target="{{ $.with.target }}" \
9494
{{ end -}}
95-
96-
echo "$IMAGE_PATH:{{ or $.with.imageTag $.Values.global.imageTag }}" >$KONTINUOUS_OUTPUT/IMAGE
95+
96+
echo "$IMAGE_PATH:{{ or $.with.imageTag $.Values.global.imageTag }}" >$KONTINUOUS_OUTPUT/IMAGE

0 commit comments

Comments
 (0)