Skip to content

Commit

Permalink
chore(helm,docker): add artifact-backend-init cmd (#1175)
Browse files Browse the repository at this point in the history
Because

- We are refactoring the preset pipeline mechanism. The preset pipelines
will now be created programmatically by other services instead of being
downloaded via the preset pipeline downloader. For example, the preset
pipelines used by artifact-backend will be created by artifact-backend
itself.

This commit

- adds artifact-backend-init cmd for creating preset pipelines.
  • Loading branch information
donch1989 authored Feb 9, 2025
1 parent 0d8a99c commit c0b7fe4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/core/templates/artifact-backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,29 @@ spec:
- name: config
mountPath: {{ .Values.artifactBackend.configPath }}
subPath: config.yaml
- name: wait-for-dependencies
image: curlimages/curl:8.00.1
command: ['sh', '-c']
args:
- >
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${PIPELINE_BACKEND_HOST}:${PIPELINE_BACKEND_PORT}/v1beta/__readiness)" != "200" ]]; do echo waiting for pipeline-backend; sleep 1; done
env:
- name: PIPELINE_BACKEND_HOST
value: "{{ template "core.pipelineBackend" . }}"
- name: PIPELINE_BACKEND_PORT
value: "{{ template "core.pipelineBackend.publicPort" . }}"
- name: artifact-backend-init
image: {{ .Values.artifactBackend.image.repository }}:{{ .Values.artifactBackend.image.tag }}
imagePullPolicy: {{ .Values.artifactBackend.image.pullPolicy }}
command: [./{{ .Values.artifactBackend.commandName.init }}]
volumeMounts:
- name: config
mountPath: {{ .Values.artifactBackend.configPath }}
subPath: config.yaml
env:
{{- if .Values.artifactBackend.extraEnv }}
{{- toYaml .Values.artifactBackend.extraEnv | nindent 12 }}
{{- end }}
{{- with .Values.artifactBackend.extraInitContainers }}
{{- toYaml . | indent 8 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ artifactBackend:
# -- The command names to be executed
commandName:
migration: artifact-backend-migrate
init: artifact-backend-init
main: artifact-backend
# -- The path of configuration file for artifact-backend
configPath: /artifact-backend/config/config.yaml
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ services:
- -c
- |
./artifact-backend-migrate
./artifact-backend-init
./artifact-backend
healthcheck:
test:
Expand All @@ -353,6 +354,8 @@ services:
condition: service_healthy
mgmt_backend:
condition: service_healthy
pipeline_backend:
condition: service_healthy

console:
container_name: ${CONSOLE_HOST}
Expand Down

0 comments on commit c0b7fe4

Please sign in to comment.