1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-12-24 08:55:43 +00:00

[E2E] Add common function when we are adding a registry to tasks

Closes #145

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
This commit is contained in:
Chmouel Boudjnah 2019-11-26 14:04:04 +01:00 committed by tekton-robot
parent 1b3ceee11d
commit c9bd921943
5 changed files with 13 additions and 29 deletions

View File

@ -1,11 +1,5 @@
#!/bin/bash
# - TMPF is the temporary file where the YAML is processed.
# - We are duplicating the temporary file since we cannot do the manipulation in
# place (i.e: reading and writing at the same time)
cp ${TMPF} ${TMPF}.read
# Add an internal registry as sidecar to the task so we can upload it directly
# from our tests withouth having to go to an external registry.
cat ${TMPF}.read | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read());data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF}
rm -f ${TMPF}.read
add_sidecar_registry ${TMPF}

View File

@ -1,11 +1,5 @@
#!/bin/bash
# - TMPF is the temporary file where the YAML is processed.
# - We are duplicating the temporary file since we cannot do the manipulation in
# place (i.e: reading and writing at the same time)
cp ${TMPF} ${TMPF}.read
# Add an internal registry as sidecar to the task so we can upload it directly
# from our tests withouth having to go to an external registry.
cat ${TMPF}.read | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read());data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF}
rm -f ${TMPF}.read
add_sidecar_registry ${TMPF}

View File

@ -1,11 +1,5 @@
#!/bin/bash
# - TMPF is the temporary file where the YAML is processed.
# - We are duplicating the temporary file since we cannot do the manipulation in
# place (i.e: reading and writing at the same time)
cp ${TMPF} ${TMPF}.read
# Add an internal registry as sidecar to the task so we can upload it directly
# from our tests withouth having to go to an external registry.
cat ${TMPF}.read | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read());data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF}
rm -f ${TMPF}.read
add_sidecar_registry ${TMPF}

View File

@ -1,12 +1,5 @@
#!/bin/bash
# - TMPF is the temporary file where the YAML is processed.
# - We are duplicating the temporary file since we cannot do the manipulation in
# place (i.e: reading and writing at the same time)
# - Here we simply add a sidecar to our task so we can upload there.
cp ${TMPF} ${TMPF}.read
# Add an internal registry as sidecar to the task so we can upload it directly
# from our tests withouth having to go to an external registry.
cat ${TMPF}.read | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read());data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF}
rm -f ${TMPF}.read
add_sidecar_registry ${TMPF}

View File

@ -23,6 +23,15 @@ RELEASE_YAML=${RELEASE_YAML:-}
source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/e2e-tests.sh
# Add an internal registry as sidecar to a task so we can upload it directly
# from our tests withouth having to go to an external registry.
function add_sidecar_registry() {
cp ${1} ${TMPF}.read
cat ${TMPF}.read | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read());data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF}
rm -f ${TMPF}.read
}
function install_pipeline_crd() {
local latestreleaseyaml
echo ">> Deploying Tekton Pipelines"