Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployment-configuration/codefresh-template-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ steps:
commands:
- bash cloud-harness/install.sh
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
- harness-deployment $PATHS -d ${{DOMAIN}} -r ${{REGISTRY}} -rs '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} --write-env -e $ENV --cache-url '${{IMAGE_CACHE_URL}}' $HELM_META_ARGS $PARAMS
- harness-deployment $PATHS -d ${{DOMAIN}} -r ${{REGISTRY}} -rsn '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} --write-env -e $ENV --cache-url '${{IMAGE_CACHE_URL}}' $HELM_META_ARGS $PARAMS
- cat deployment/.env >> ${{CF_VOLUME_PATH}}/env_vars_to_export
- cat ${{CF_VOLUME_PATH}}/env_vars_to_export
prepare_deployment_view:
Expand Down
2 changes: 1 addition & 1 deletion deployment-configuration/codefresh-template-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ steps:
commands:
- bash cloud-harness/install.sh
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} -e $ENV --no-cd $HELM_META_ARGS $PARAMS
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rsn '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} -e $ENV --no-cd $HELM_META_ARGS $PARAMS
prepare_deployment_view:
commands:
- "helm template ./deployment/helm --debug -n ${{NAMESPACE}}"
Expand Down
2 changes: 1 addition & 1 deletion deployment-configuration/codefresh-template-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ steps:
commands:
- bash cloud-harness/install.sh
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -n ${{NAMESPACE}} -e $ENV --no-cd $HELM_META_ARGS $PARAMS
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rsn ${{REGISTRY_SECRET}} -n ${{NAMESPACE}} -e $ENV --no-cd $HELM_META_ARGS $PARAMS
prepare_deployment_view:
commands:
- "helm template ./deployment/helm --debug -n ${{NAMESPACE}}"
Expand Down
2 changes: 1 addition & 1 deletion deployment-configuration/codefresh-template-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ steps:
commands:
- bash cloud-harness/install.sh
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
- harness-deployment $PATHS -n test-${{NAMESPACE_BASENAME}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -e $ENV --write-env --cache-url '${{IMAGE_CACHE_URL}}' -N $HELM_META_ARGS $PARAMS
- harness-deployment $PATHS -n test-${{NAMESPACE_BASENAME}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rsn ${{REGISTRY_SECRET}} -e $ENV --write-env --cache-url '${{IMAGE_CACHE_URL}}' -N $HELM_META_ARGS $PARAMS
- cat deployment/.env >> ${{CF_VOLUME_PATH}}/env_vars_to_export
- cat ${{CF_VOLUME_PATH}}/env_vars_to_export
prepare_deployment_view:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
spec:
{{- if and .root.Values.registry.secret (contains .root.Values.registry.name .app.harness.deployment.image) }}
imagePullSecrets:
- name: {{ .root.Values.registry.secret }}
- name: {{ .root.Values.registry.secret.name }}
{{- end }}
{{- if and .app.harness.deployment.volume }}
{{- if or (not (hasKey .app.harness.deployment.volume "usenfs")) (not .app.harness.deployment.volume.usenfs) }}
Expand Down
7 changes: 7 additions & 0 deletions deployment-configuration/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ metadata:
data:
allvalues.yaml: |
{{- $values_copy := deepCopy .Values }}
{{- $registry := get $values_copy "registry" }}
{{- if $registry }}
{{- $secret := get $registry "secret" }}
{{- if and (kindIs "map" $secret) (not (empty $secret.value)) }}
{{- $tmp := set $registry "secret" nil }}
{{- end }}
{{- end }}
{{- range $key, $val := .Values.apps }}
{{- $app := get $values_copy.apps $key }}
{{- $tmp := set $app.harness "secrets" dict }}
Expand Down
19 changes: 19 additions & 0 deletions deployment-configuration/helm/templates/registry-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if and .Values.registry.name .Values.registry.secret.name }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.registry.secret.name | quote }}
namespace: {{ .Release.Namespace }}
type: kubernetes.io/dockerconfigjson
stringData:
.dockerconfigjson: |-
{
"auths": {
"{{ .Values.registry.name }}": {
"username": "_json_key",
"password": {{ .Values.registry.secret.value | toJson }},
"auth": "{{ printf "_json_key:%s" .Values.registry.secret.value | b64enc }}"
}
}
}
{{- end }}
6 changes: 5 additions & 1 deletion deployment-configuration/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ registry:
name: "localhost:5000"
# -- Optional secret used for pulling from docker registry.
secret:
# -- Secret name used for pulling from docker registry.
name:
# -- Value of the secret used for pulling from docker registry in json encoded format.
value:
# -- Docker tag used to pull images.
tag: latest
# -- List of applications.
Expand Down Expand Up @@ -85,4 +89,4 @@ proxy:
requests:
memory: "32Mi"
limits:
memory: "64Mi"
memory: "64Mi"
Loading
Loading