Skip to content
Snippets Groups Projects
Commit 1d1ac854 authored by Marc Guillemot's avatar Marc Guillemot
Browse files

XPLANBOX-2564 produce zip files

parent 612a795e
No related branches found
No related tags found
No related merge requests found
Pipeline #30405 failed
build
stages:
- build
zipAndUpload:
stage: build
image: alpine
before_script:
- apk add --update zip curl
script:
- ls
- ./packFiles.sh
- while IFS= read -r filename; do curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/$filename "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/my_package/$filename"; done < <(ls -1 build)
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file path/to/file.txt "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/my_package/0.0.1/file.txt"'
#!/bin/bash
targetDir=${1:-build}
mkdir -p $targetDir
function handleGmlFile() {
local gmlFile=$1
local pathWithoutExt="${gmlFile%.*}"
local basename=$(basename $pathWithoutExt)
local tmpDir=$(mktemp -d)
cp $pathWithoutExt.* $tmpDir
mv $tmpDir/*.gml $tmpDir/xplan.gml
local zipFile=$targetDir/$basename.zip
echo "Packing $zipFile..."
zip -q -j $zipFile $tmpDir/*
rm -rf $tmpDir
}
while IFS= read -r filename
do
handleGmlFile $filename
done < <(find . -name '*.gml')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.