From 9c2c2a152d931147ae18e037cdad39de3427f74a Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 21 Jan 2025 01:38:05 -0500 Subject: OK --- .github/workflows/pipeline_index.yml | 10 +++++----- .github/workflows/pipeline_run.yml | 14 +++++++++++++- bin/getfile | 28 ++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100755 bin/getfile diff --git a/.github/workflows/pipeline_index.yml b/.github/workflows/pipeline_index.yml index ccf36af..c0bc785 100644 --- a/.github/workflows/pipeline_index.yml +++ b/.github/workflows/pipeline_index.yml @@ -16,12 +16,12 @@ on: type: choice description: Mission name (e.g. hst) options: - - thing1 - - thing2 - - thing3 - - thing4 + - hst + - jwst + - roman + - generic required: true - default: "thing4" + default: "generic" build_name: type: string diff --git a/.github/workflows/pipeline_run.yml b/.github/workflows/pipeline_run.yml index 27ceaac..b6a1081 100644 --- a/.github/workflows/pipeline_run.yml +++ b/.github/workflows/pipeline_run.yml @@ -67,6 +67,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Configure PATH + run: | + echo "PATH=${{ github.workspace }}/bin:$PATH" >> $GITHUB_ENV + #- name: Mount data area # uses: ./.github/actions/sshfs # with: @@ -76,6 +80,14 @@ jobs: # remote_dir: /data # local_dir: /mydata + - name: Get delivery file + run: | + src="${{ inputs.delivery_file }}" + dest="${{ runner.temp }}/$(basename $src)" + getfile "$src" "$dest" + echo "DELIVERY_FILE=$dest" >> $GITHUB_ENV + shell: bash + - name: STASIS (${{ runner.os }}-${{ runner.arch }}) uses: ./.github/actions/stasis with: @@ -83,7 +95,7 @@ jobs: artifactory_url: https://blah.tld artifactory_repo: ${{ inputs.artifactory_repo }} stasis_args: ${{ inputs.stasis_args }} - option_delivery_file: ${{ inputs.delivery_file }} + option_delivery_file: ${{ env.DELIVERY_FILE }} option_verbose: ${{ inputs.verbose }} option_continue_on_error: ${{ inputs.continue_on_error }} option_no_testing: ${{ inputs.no_testing }} diff --git a/bin/getfile b/bin/getfile new file mode 100755 index 0000000..d8bcbb6 --- /dev/null +++ b/bin/getfile @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +prog="$(basename $0)" +src="$1" +dest="$2" + +usage() { + echo "$prog {src|url} [dest]" +} + +if [[ -z "$src" ]]; then + usage + exit 1 +fi + +if [[ -z "$dest" ]]; then + dest="./$(basename $src)" +fi + +if [[ "$src" =~ :// ]]; then + cmd=curl + cmd_argv="-L -o $dest $src" +else + cmd=rsync + cmd_argv="-a -P $src $dest" +fi + +echo "$cmd $cmd_argv" -- cgit