Skip to content

Commit beab293

Browse files
committed
More robust replace for docker runtime named volumes abs path
Signed-off-by: Simone Tollardo <[email protected]>
1 parent 3cb4e1b commit beab293

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

localinstall/scripts/5-prepare_pipeline.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,11 @@ PIPELINE_PWD=$(pwd)
3838
# This is BAD hack, but it works for now
3939
sed -i 's/lab_type: kubernetes/lab_type: docker/g' config/pipeline.yaml
4040

41-
# replace data/output by $PIPELINE_PWD/data/output
42-
# might be two variants (default and staging)
43-
# - '/data/kernelci-deploy-checkout/kernelci-pipeline/data/ssh/:/home/kernelci/data/ssh'
44-
# - '/data/kernelci-deploy-checkout/kernelci-pipeline/data/output/:/home/kernelci/data/output'
45-
# AND
46-
# - 'data/ssh/:/home/kernelci/data/ssh'
47-
# - 'data/output/:/home/kernelci/data/output'
48-
sed -i "s|- 'data/output/|- '$PIPELINE_PWD/data/output/|g" config/pipeline.yaml
49-
sed -i "s|- 'data/ssh/|- '$PIPELINE_PWD/data/ssh/|g" config/pipeline.yaml
50-
# OR
51-
sed -i "s|- '/data/kernelci-deploy-checkout/kernelci-pipeline/data/ssh/|- '$PIPELINE_PWD/data/ssh/|g" config/pipeline.yaml
52-
sed -i "s|- '/data/kernelci-deploy-checkout/kernelci-pipeline/data/output/|- '$PIPELINE_PWD/data/output/|g" config/pipeline.yaml
41+
# replace named data/output and data/ssh volumes with absolute path since it is needed
42+
sed -i '/volumes:/,/data\/output/{
43+
s|['\''"].*data\/ssh\/|'\'''"$PIPELINE_PWD"'\/data\/ssh\/|g;
44+
s|['\''"].*data\/output\/|'\'''"$PIPELINE_PWD"'\/data\/output\/|g;
45+
}' config/pipeline.yaml
5346

5447
chmod 777 data/ssh
5548
cp ../../config/out/ssh.key data/ssh/id_rsa_tarball

0 commit comments

Comments
 (0)