Commit f3101b9b authored by Waqas Riaz's avatar Waqas Riaz

Update archive creation strategy

parent 245a7364
Pipeline #4140 failed with stages
in 6 seconds
......@@ -10,24 +10,23 @@ build_job:
- tar --version
script:
- echo "Starting script for deploying to Jfrog"
- files_list=$(find . -type f -name "*.jsonnet" ! -path "./grafonnet-lib/*")
- existing_files=$(find . -type f -name "*.jsonnet" ! -path "./grafonnet-lib/*" | xargs -I{} basename {} )
- last_commit_files=$(git diff --name-only HEAD^ HEAD)
- files_list=$(comm -12 <(echo "${last_commit_files[@]}" | tr ' ' '\n' | sort) <(echo "${existing_files[@]}" | tr ' ' '\n' | sort))
- echo "Creating directory"
- mkdir grafonnet
# - export version=$(echo "$(cat version.txt) + 0.1" | bc)
# - export version=$(cat version.txt)
- ls
- |
while IFS= read -r jsonnet_file;
do
echo $jsonnet_file
filename=$(basename -- "$jsonnet_file")
for json_file in ${files_list[@]};
do
echo $json_file
filename=$(basename -- "$json_file")
filename="${filename%.*}"
echo $filename
JSONNET_PATH=grafonnet-lib \
jsonnet $jsonnet_file > grafonnet/$filename.json
done <<< "$files_list"
jsonnet $json_file > grafonnet/$filename.json
done
- tar -cvzf grafonnet.tar.gz grafonnet/
# - echo "version.txt is `cat version.txt` and uploading version is $version"
- echo "Uploading to $ARTIFACTORY_URL/grafonet/$CI_PIPELINE_ID/grafonnet.tar.gz"
- curl -u $ARTIFACTORY_USER:$ARTIFACTORY_PASS -T grafonnet.tar.gz "$ARTIFACTORY_URL/grafonet/$CI_PIPELINE_ID/grafonnet.tar.gz"
......@@ -45,8 +44,6 @@ deploy_job:
- jq --version
- tar --version
script:
# - export version=$(echo "$(cat version.txt) + 0.1" | bc)
# - export version=$(cat version.txt)
- mkdir -p build/$CI_BUILD_ID
- cd build/$CI_BUILD_ID
- echo "Downloading artifact from $ARTIFACTORY_URL/grafonet/$CI_PIPELINE_ID/grafonnet.tar.gz"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment