forked from hpcc-systems/HPCC-Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,35 +50,36 @@ jobs: | |
- name: Fetch Output from Container and Upload to S3 | ||
run: | | ||
docker cp package-container:/app/output.json ${{ github.workspace }}/output.json | ||
aws s3 cp ${{ github.workspace }}/output.json s3://ebelfarsi-bucket/releases/output.json | ||
- name: Prepare Directory Structure | ||
shell: bash | ||
run: | | ||
output_json_path="${{ github.workspace }}/output.json" | ||
# Extract version number from the first entry | ||
version=$(jq -r '.[0].Version' "$output_json_path") | ||
base_dir="${{ github.workspace }}/releases/CE-Candidate-${version}" | ||
version=$(jq -r '.[0].Version' "$output_json_path" | cut -d'-' -f1) | ||
base_dir="${{ github.workspace }}/CE-Candidate-${version}" | ||
# Create base directory if it doesn't exist | ||
mkdir -p "$base_dir" | ||
# Parse JSON and create directory structure | ||
jq -r '.[] | .Edge_Cast_Path' "$output_json_path" | while read path; do | ||
full_path="${{ github.workspace }}/$path" | ||
full_path="$base_dir/$(echo $path | sed 's#releases/CE-Candidate-[^/]*##')" | ||
mkdir -p "$(dirname "$full_path")" | ||
touch "$full_path" | ||
done | ||
# Rename and move output.json to manifests_versionnumber_meta_data.json in the base directory | ||
mv "$output_json_path" "$base_dir/manifests_${version}_meta_data.json" | ||
- name: Sync Directory to S3 Bucket | ||
shell: bash | ||
run: | | ||
output_json_path="${{ github.workspace }}/output.json" | ||
version=$(jq -r '.[0].Version' "$output_json_path") | ||
base_dir="${{ github.workspace }}/releases/CE-Candidate-${version}" | ||
aws s3 sync "$base_dir" s3://ebelfarsi-bucket/releases/ | ||
version=$(jq -r '.[0].Version' ${{ github.workspace }}/output.json | cut -d'-' -f1) | ||
base_dir="${{ github.workspace }}/CE-Candidate-${version}" | ||
aws s3 sync "$base_dir" s3://ebelfarsi-bucket/releases/CE-Candidate-${version}/ | ||
|
||
- name: Upload output.json to GitHub Release | ||
uses: ncipollo/[email protected] | ||
|