fix(overrides): place back missing overrides
This patch places back in functionality introduced in [0] that were lost from refactoring. [0] https://review.opendev.org/c/airship/charts/+/775065 Signed-off-by: Tin Lam <tin@irrational.io> Change-Id: I6671fcf36c2fe0867c7bb7886cf24d50c09cfad0
This commit is contained in:
parent
37332487b9
commit
8377c131d9
@ -28,22 +28,29 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
[
|
[{
|
||||||
{
|
"chart_name": "amf",
|
||||||
"chart_name": "amf",
|
"project": "amf",
|
||||||
"project": "amf",
|
"repo": "amf",
|
||||||
"repo": "amf",
|
"version": "0.1.0",
|
||||||
"version": "0.1.0",
|
"build_from_source": true,
|
||||||
"build_from_source": true,
|
"path": "charts",
|
||||||
"path": "charts",
|
"build": {
|
||||||
"build": {
|
"git_repo": "{{ $.Values.git_repo }}",
|
||||||
"git_repo": "{{ $.Values.git_repo }}",
|
"target_loc": "/src/checkout/amf",
|
||||||
"target_loc": "/src/checkout/amf",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"refspec": "{{ $.Values.refspec }}",
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
},
|
||||||
},
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"namespace": "{{ $.Values.namespace }}",
|
"release_name": "amf",
|
||||||
"release_name": "amf",
|
"sources": {
|
||||||
|
"image_map": {
|
||||||
|
"tag": ["releases", "images", "applications", "amf", "tag"],
|
||||||
|
"tmp_name": ["releases", "images", "applications", "amf", "name"],
|
||||||
|
"tmp_repo": ["releases", "images", "applications", "amf", "repo"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"releases": {
|
||||||
"images": {
|
"images": {
|
||||||
"applications": {
|
"applications": {
|
||||||
"amf": {
|
"amf": {
|
||||||
@ -54,7 +61,7 @@ data:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -28,22 +28,29 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
[
|
[{
|
||||||
{
|
"chart_name": "ausf",
|
||||||
"chart_name": "ausf",
|
"project": "ausf",
|
||||||
"project": "ausf",
|
"repo": "ausf",
|
||||||
"repo": "ausf",
|
"version": "0.1.0",
|
||||||
"version": "0.1.0",
|
"build_from_source": true,
|
||||||
"build_from_source": true,
|
"path": "charts",
|
||||||
"path": "charts",
|
"build": {
|
||||||
"build": {
|
"git_repo": "{{ $.Values.git_repo }}",
|
||||||
"git_repo": "{{ $.Values.git_repo }}",
|
"target_loc": "/src/checkout/ausf",
|
||||||
"target_loc": "/src/checkout/ausf",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"refspec": "{{ $.Values.refspec }}",
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
},
|
||||||
},
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"namespace": "{{ $.Values.namespace }}",
|
"release_name": "ausf",
|
||||||
"release_name": "ausf",
|
"sources": {
|
||||||
|
"image_map": {
|
||||||
|
"tag": ["releases", "images", "applications", "ausf", "tag"],
|
||||||
|
"tmp_name": ["releases", "images", "applications", "ausf", "name"],
|
||||||
|
"tmp_repo": ["releases", "images", "applications", "ausf", "repo"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"releases": {
|
||||||
"images": {
|
"images": {
|
||||||
"applications": {
|
"applications": {
|
||||||
"ausf": {
|
"ausf": {
|
||||||
@ -54,7 +61,7 @@ data:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -25,32 +25,35 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
[
|
[{
|
||||||
{
|
"chart_name": "mongodb-sharded",
|
||||||
"chart_name": "mongodb-sharded",
|
"project": "mongodb",
|
||||||
"project": "mongodb",
|
"repo": "mongodb-sharded",
|
||||||
"repo": "mongodb-sharded",
|
"version": "3.3.3",
|
||||||
"version": "3.3.3",
|
"build_from_source": false,
|
||||||
"build_from_source": false,
|
"path": "",
|
||||||
"path": "",
|
"build": {
|
||||||
"build": {
|
"name": "https://charts.bitnami.com/bitnami",
|
||||||
"name": "https://charts.bitnami.com/bitnami",
|
"local_repo": "bitnami_mongodb",
|
||||||
"local_repo": "bitnami_mongodb",
|
"target_loc": "/src/fetch/charts"
|
||||||
"target_loc": "/src/fetch/charts"
|
},
|
||||||
},
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"namespace": "development-pipeline",
|
"release_name": "mongodb-bitnami",
|
||||||
"release_name": "mongodb-bitnami",
|
"sources": {
|
||||||
"images": {
|
"image_map": {
|
||||||
"applications": {
|
"tag": ["releases", "image", "tag"],
|
||||||
"mongodb-sharded": {
|
"tmp_name": ["releases", "image", "repository"],
|
||||||
"tag": "1.0",
|
"tmp_repo": ["releases", "image", "registry"]
|
||||||
"name": "mongodb",
|
}
|
||||||
"repo": "mongodb"
|
},
|
||||||
}
|
"releases": {
|
||||||
}
|
"image": {
|
||||||
|
"registry": "docker.io",
|
||||||
|
"repository": "bitnami/mongodb-sharded",
|
||||||
|
"tag": "4.4.4-debian-10-r28"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -28,22 +28,29 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
[
|
[{
|
||||||
{
|
"chart_name": "nrf",
|
||||||
"chart_name": "nrf",
|
"project": "nrf",
|
||||||
"project": "nrf",
|
"repo": "nrf",
|
||||||
"repo": "nrf",
|
"version": "0.1.0",
|
||||||
"version": "0.1.0",
|
"build_from_source": true,
|
||||||
"build_from_source": true,
|
"path": "charts",
|
||||||
"path": "charts",
|
"build": {
|
||||||
"build": {
|
"git_repo": "{{ $.Values.git_repo }}",
|
||||||
"git_repo": "{{ $.Values.git_repo }}",
|
"target_loc": "/src/checkout/nrf",
|
||||||
"target_loc": "/src/checkout/nrf",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"refspec": "{{ $.Values.refspec }}",
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
},
|
||||||
},
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"namespace": "{{ $.Values.namespace }}",
|
"release_name": "nrf",
|
||||||
"release_name": "nrf",
|
"sources": {
|
||||||
|
"image_map": {
|
||||||
|
"tag": ["releases", "images", "applications", "nrf", "tag"],
|
||||||
|
"tmp_name": ["releases", "images", "applications", "nrf", "name"],
|
||||||
|
"tmp_repo": ["releases", "images", "applications", "nrf", "repo"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"releases": {
|
||||||
"images": {
|
"images": {
|
||||||
"applications": {
|
"applications": {
|
||||||
"nrf": {
|
"nrf": {
|
||||||
@ -54,7 +61,7 @@ data:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -28,22 +28,29 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
[
|
[{
|
||||||
{
|
"chart_name": "pcf",
|
||||||
"chart_name": "pcf",
|
"project": "pcf",
|
||||||
"project": "pcf",
|
"repo": "pcf",
|
||||||
"repo": "pcf",
|
"version": "0.1.0",
|
||||||
"version": "0.1.0",
|
"build_from_source": true,
|
||||||
"build_from_source": true,
|
"path": "charts",
|
||||||
"path": "charts",
|
"build": {
|
||||||
"build": {
|
"git_repo": "{{ $.Values.git_repo }}",
|
||||||
"git_repo": "{{ $.Values.git_repo }}",
|
"target_loc": "/src/checkout/pcf",
|
||||||
"target_loc": "/src/checkout/pcf",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"refspec": "{{ $.Values.refspec }}",
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
},
|
||||||
},
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"namespace": "{{ $.Values.namespace }}",
|
"release_name": "pcf",
|
||||||
"release_name": "pcf",
|
"sources": {
|
||||||
|
"image_map": {
|
||||||
|
"tag": ["releases", "images", "applications", "pcf", "tag"],
|
||||||
|
"tmp_name": ["releases", "images", "applications", "pcf", "name"],
|
||||||
|
"tmp_repo": ["releases", "images", "applications", "pcf", "repo"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"releases": {
|
||||||
"images": {
|
"images": {
|
||||||
"applications": {
|
"applications": {
|
||||||
"pcf": {
|
"pcf": {
|
||||||
@ -54,7 +61,7 @@ data:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -28,22 +28,29 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
[
|
[{
|
||||||
{
|
"chart_name": "smf",
|
||||||
"chart_name": "smf",
|
"project": "smf",
|
||||||
"project": "smf",
|
"repo": "smf",
|
||||||
"repo": "smf",
|
"version": "0.1.0",
|
||||||
"version": "0.1.0",
|
"build_from_source": true,
|
||||||
"build_from_source": true,
|
"path": "charts",
|
||||||
"path": "charts",
|
"build": {
|
||||||
"build": {
|
"git_repo": "{{ $.Values.git_repo }}",
|
||||||
"git_repo": "{{ $.Values.git_repo }}",
|
"target_loc": "/src/checkout/smf",
|
||||||
"target_loc": "/src/checkout/smf",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"refspec": "{{ $.Values.refspec }}",
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
},
|
||||||
},
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"namespace": "{{ $.Values.namespace }}",
|
"release_name": "smf",
|
||||||
"release_name": "smf",
|
"sources": {
|
||||||
|
"image_map": {
|
||||||
|
"tag": ["releases", "images", "applications", "smf", "tag"],
|
||||||
|
"tmp_name": ["releases", "images", "applications", "smf", "name"],
|
||||||
|
"tmp_repo": ["releases", "images", "applications", "smf", "repo"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"releases": {
|
||||||
"images": {
|
"images": {
|
||||||
"applications": {
|
"applications": {
|
||||||
"smf": {
|
"smf": {
|
||||||
@ -54,7 +61,7 @@ data:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -28,22 +28,29 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
[
|
[{
|
||||||
{
|
"chart_name": "udm",
|
||||||
"chart_name": "udm",
|
"project": "udm",
|
||||||
"project": "udm",
|
"repo": "udm",
|
||||||
"repo": "udm",
|
"version": "0.1.0",
|
||||||
"version": "0.1.0",
|
"build_from_source": true,
|
||||||
"build_from_source": true,
|
"path": "charts",
|
||||||
"path": "charts",
|
"build": {
|
||||||
"build": {
|
"git_repo": "{{ $.Values.git_repo }}",
|
||||||
"git_repo": "{{ $.Values.git_repo }}",
|
"target_loc": "/src/checkout/udm",
|
||||||
"target_loc": "/src/checkout/udm",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"refspec": "{{ $.Values.refspec }}",
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
},
|
||||||
},
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"namespace": "{{ $.Values.namespace }}",
|
"release_name": "udm",
|
||||||
"release_name": "udm",
|
"sources": {
|
||||||
|
"image_map": {
|
||||||
|
"tag": ["releases", "images", "applications", "udm", "tag"],
|
||||||
|
"tmp_name": ["releases", "images", "applications", "udm", "name"],
|
||||||
|
"tmp_repo": ["releases", "images", "applications", "udm", "repo"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"releases": {
|
||||||
"images": {
|
"images": {
|
||||||
"applications": {
|
"applications": {
|
||||||
"udm": {
|
"udm": {
|
||||||
@ -54,7 +61,7 @@ data:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -9,7 +9,7 @@ data:
|
|||||||
"use_existing_cluster": "true"
|
"use_existing_cluster": "true"
|
||||||
}
|
}
|
||||||
image.json: |
|
image.json: |
|
||||||
{
|
[{
|
||||||
"build_from_source": true,
|
"build_from_source": true,
|
||||||
"image_from": "harbor-core.jarvis.local/library/ubuntu:focal",
|
"image_from": "harbor-core.jarvis.local/library/ubuntu:focal",
|
||||||
"image_name": "udr",
|
"image_name": "udr",
|
||||||
@ -25,33 +25,42 @@ data:
|
|||||||
"refspec": "{{ $.Values.refspec }}",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
chart.json: |
|
chart.json: |
|
||||||
{
|
[{
|
||||||
"chart_name": "udr",
|
"chart_name": "udr",
|
||||||
"project": "udr",
|
"project": "udr",
|
||||||
"repo": "udr",
|
"repo": "udr",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"build_from_source": true,
|
"build_from_source": true,
|
||||||
"path": "charts",
|
"path": "charts",
|
||||||
"namespace": "{{ $.Values.namespace }}",
|
|
||||||
"build": {
|
"build": {
|
||||||
"git_repo": "{{ $.Values.git_repo }}",
|
"git_repo": "{{ $.Values.git_repo }}",
|
||||||
"target_loc": "/src/checkout/udr",
|
"target_loc": "/src/checkout/udr",
|
||||||
"refspec": "{{ $.Values.refspec }}",
|
"refspec": "{{ $.Values.refspec }}",
|
||||||
"version": "refs/changes/*:refs/changes/*"
|
"version": "refs/changes/*:refs/changes/*"
|
||||||
},
|
},
|
||||||
|
"namespace": "{{ $.Values.namespace }}",
|
||||||
"release_name": "udr",
|
"release_name": "udr",
|
||||||
"images": {
|
"sources": {
|
||||||
"applications": {
|
"image_map": {
|
||||||
"udr": {
|
"tag": ["releases", "images", "applications", "udr", "tag"],
|
||||||
"tag": "1.0",
|
"tmp_name": ["releases", "images", "applications", "udr", "name"],
|
||||||
"name": "udr",
|
"tmp_repo": ["releases", "images", "applications", "udr", "repo"]
|
||||||
"repo": "udr"
|
}
|
||||||
|
},
|
||||||
|
"releases": {
|
||||||
|
"images": {
|
||||||
|
"applications": {
|
||||||
|
"udr": {
|
||||||
|
"tag": "1.0",
|
||||||
|
"name": "udr",
|
||||||
|
"repo": "udr"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
default.json: |
|
default.json: |
|
||||||
{
|
{
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
@ -21,6 +21,7 @@ RUN apt-get update ;\
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
gnupg-agent \
|
gnupg-agent \
|
||||||
software-properties-common \
|
software-properties-common \
|
||||||
|
moreutils \
|
||||||
gettext-base ;\
|
gettext-base ;\
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - ;\
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - ;\
|
||||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" ;\
|
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" ;\
|
||||||
|
@ -4,7 +4,8 @@ set -ex
|
|||||||
|
|
||||||
update-ca-certificates
|
update-ca-certificates
|
||||||
ansible-playbook -vvv /playbooks/functional-microflow.yaml -i hosts \
|
ansible-playbook -vvv /playbooks/functional-microflow.yaml -i hosts \
|
||||||
-e '{"stage":"deploy"}' \
|
-e '{"stage":"deploy"}' \
|
||||||
-e @"/workspace/development_pipeline_data/default.json" \
|
-e @"/workspace/development_pipeline_data/default.json" \
|
||||||
-e @"/workspace/development_pipeline_data/cluster.json" \
|
-e @"/workspace/development_pipeline_data/cluster.json" \
|
||||||
-e 'loop_source="/workspace/development_pipeline_data/chart.json"'
|
-e 'loop_source="/workspace/development_pipeline_data/chart.json"' \
|
||||||
|
-e '{"datapath":"/workspace/development_pipeline_data"}'
|
||||||
|
@ -6,9 +6,36 @@
|
|||||||
when: ("{{ stage }}" == "deploy")
|
when: ("{{ stage }}" == "deploy")
|
||||||
block:
|
block:
|
||||||
#Deploy CNF
|
#Deploy CNF
|
||||||
|
|
||||||
- name: Deploy charts
|
- name: Deploy charts
|
||||||
shell: helm upgrade --install --create-namespace --kubeconfig="{{ cluster_kubeconfig_path }}/kubeconfig" "{{ chart.release_name }}" "{{ chart.project }}-staging/{{ chart.chart_name }}" --version="{{ chart.version }}" --namespace="{{ chart.namespace }}"
|
shell: |
|
||||||
|
set -xe ;
|
||||||
|
CHARTNAME={{ chart.chart_name }} ;
|
||||||
|
REPO={{ docker_registry }} ;
|
||||||
|
NAME={{ chart.project }}-staging/{{ chart.chart_name }} ;
|
||||||
|
|
||||||
|
jq -c --arg c $CHARTNAME --arg v $REPO 'map(if .repo == $c then .["tmp_repo"] = $v else . end)' {{ datapath }}/image.json | sponge {{ datapath }}/image.json ;
|
||||||
|
jq -c --arg c $CHARTNAME --arg v $NAME 'map(if .repo == $c then .["tmp_name"] = $v else . end)' {{ datapath }}/image.json | sponge {{ datapath }}/image.json ;
|
||||||
|
|
||||||
|
M=$(jq -c --arg c $CHARTNAME 'map(select(.chart_name == $c)) | first | .sources.image_map' {{ datapath }}/chart.json) ;
|
||||||
|
if [ "$M" != "null" ] && [ -n "$M" ] ; then \
|
||||||
|
echo $M | jq -r 'keys[]' | while IFS= read -r k; do \
|
||||||
|
v=$(echo $M | jq -c --arg k $k '.[$k]') ;\
|
||||||
|
filter=".$k" ;\
|
||||||
|
value=$(jq -c --arg c $CHARTNAME 'map(select(.image_name == $c)) | first' {{ datapath}}/image.json | jq -r $filter) ;\
|
||||||
|
jq -r --arg c $CHARTNAME --argjson k $v --arg v $value 'map(if .chart_name == $c then getpath($k) = $v else . end)' {{ datapath }}/chart.json | sponge {{ datapath }}/chart.json ;\
|
||||||
|
done ; \
|
||||||
|
fi ;
|
||||||
|
jq -c --arg c $CHARTNAME 'map(select(.chart_name == $c)) | first | .releases' \
|
||||||
|
{{ datapath }}/chart.json > {{ datapath }}/{{ chart.chart_name }}-overrides.json ;
|
||||||
|
cat {{ datapath }}/{{ chart.chart_name }}-overrides.json ;
|
||||||
|
helm upgrade --install \
|
||||||
|
--kubeconfig="{{ cluster_kubeconfig_path }}/kubeconfig" \
|
||||||
|
"{{ chart.release_name }}" "{{ chart.project }}-staging/{{ chart.chart_name }}" \
|
||||||
|
--version="{{ chart.version }}" \
|
||||||
|
--values="{{ datapath }}/{{ chart.chart_name }}-overrides.json" \
|
||||||
|
--namespace="{{ chart.namespace }}"
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
loop: "{{ charts }}"
|
loop: "{{ charts }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: "chart"
|
loop_var: "chart"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user