only: bundle_upload_folder
This commit is contained in:
parent
3b8244ff69
commit
4825fc2307
|
@ -42,6 +42,9 @@ inputs:
|
||||||
uploads:
|
uploads:
|
||||||
required: false
|
required: false
|
||||||
default: ini bundles
|
default: ini bundles
|
||||||
|
bundle_upload_folder:
|
||||||
|
required: false
|
||||||
|
default: 'build_server'
|
||||||
MY_REPO_PAT:
|
MY_REPO_PAT:
|
||||||
description: 'Token for accessing private repos'
|
description: 'Token for accessing private repos'
|
||||||
required: false
|
required: false
|
||||||
|
@ -129,6 +132,7 @@ runs:
|
||||||
echo "RUSEFI_SSH_SERVER=${{inputs.RUSEFI_SSH_SERVER}}" >> $GITHUB_ENV
|
echo "RUSEFI_SSH_SERVER=${{inputs.RUSEFI_SSH_SERVER}}" >> $GITHUB_ENV
|
||||||
echo "RUSEFI_SSH_USER=${{inputs.RUSEFI_SSH_USER}}" >> $GITHUB_ENV
|
echo "RUSEFI_SSH_USER=${{inputs.RUSEFI_SSH_USER}}" >> $GITHUB_ENV
|
||||||
echo "RUSEFI_SSH_PASS=${{inputs.RUSEFI_SSH_PASS}}" >> $GITHUB_ENV
|
echo "RUSEFI_SSH_PASS=${{inputs.RUSEFI_SSH_PASS}}" >> $GITHUB_ENV
|
||||||
|
echo "bundle_upload_folder=${{inputs.bundle_upload_folder}}" >> $GITHUB_ENV
|
||||||
echo "LTS=${{toJSON(inputs.lts)}}" >> $GITHUB_ENV
|
echo "LTS=${{toJSON(inputs.lts)}}" >> $GITHUB_ENV
|
||||||
echo "BUNDLE_SIMULATOR=${{toJSON(inputs.bundle_simulator)}}" >> $GITHUB_ENV
|
echo "BUNDLE_SIMULATOR=${{toJSON(inputs.bundle_simulator)}}" >> $GITHUB_ENV
|
||||||
echo "RUN_SIMULATOR=${{toJSON(inputs.run_simulator)}}" >> $GITHUB_ENV
|
echo "RUN_SIMULATOR=${{toJSON(inputs.run_simulator)}}" >> $GITHUB_ENV
|
||||||
|
|
|
@ -16,15 +16,22 @@ if [ -n "${USER}" -a -n "$PASS" -a -n "${HOST}" ]; then
|
||||||
echo "$SCRIPT_NAME: BUNDLE_FILE_NAME argument not specified"
|
echo "$SCRIPT_NAME: BUNDLE_FILE_NAME argument not specified"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${bundle_upload_folder}" ]; then
|
||||||
|
echo "$SCRIPT_NAME: bundle_upload_folder is ${bundle_upload_folder}"
|
||||||
|
else
|
||||||
|
bundle_upload_folder="rusefi_bundle"
|
||||||
|
echo "$SCRIPT_NAME: bundle_upload_folder env variable was not specified using default ${bundle_upload_folder}"
|
||||||
|
fi
|
||||||
|
|
||||||
# technical debt: more than one file uses magic 'rusefi_bundle_' constant, can we extract constant?
|
# technical debt: more than one file uses magic 'rusefi_bundle_' constant, can we extract constant?
|
||||||
FULL_BUNDLE_FILE="rusefi_bundle_${BUNDLE_FILE_NAME}.zip"
|
FULL_BUNDLE_FILE="rusefi_bundle_${BUNDLE_FILE_NAME}.zip"
|
||||||
UPDATE_BUNDLE_FILE="rusefi_bundle_${BUNDLE_FILE_NAME}_autoupdate.zip"
|
UPDATE_BUNDLE_FILE="rusefi_bundle_${BUNDLE_FILE_NAME}_autoupdate.zip"
|
||||||
|
|
||||||
RET=0
|
RET=0
|
||||||
if [ "$LTS" == "true" -a -n "$REF" ]; then
|
if [ "$LTS" == "true" -a -n "$REF" ]; then
|
||||||
DESTINATION_FOLDER="build_server/lts/${REF}"
|
DESTINATION_FOLDER="${bundle_upload_folder}/lts/${REF}"
|
||||||
else
|
else
|
||||||
DESTINATION_FOLDER="build_server"
|
DESTINATION_FOLDER="${bundle_upload_folder}"
|
||||||
fi
|
fi
|
||||||
tar -czf - $FULL_BUNDLE_FILE | sshpass -p $PASS ssh -o StrictHostKeyChecking=no ${USER}@${HOST} "mkdir -p ${DESTINATION_FOLDER}; tar -xzf - -C ${DESTINATION_FOLDER}"
|
tar -czf - $FULL_BUNDLE_FILE | sshpass -p $PASS ssh -o StrictHostKeyChecking=no ${USER}@${HOST} "mkdir -p ${DESTINATION_FOLDER}; tar -xzf - -C ${DESTINATION_FOLDER}"
|
||||||
RET=$((RET+$?+PIPESTATUS))
|
RET=$((RET+$?+PIPESTATUS))
|
||||||
|
|
Loading…
Reference in New Issue