Commit 73b22259 authored by Roman Haefeli's avatar Roman Haefeli
Browse files

build_macos: add --skip-upload flag

parent 07c0848e
#!/bin/bash #!/bin/bash
SKIP_UPLOAD=false
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
-k|--skip-upload)
SKIP_UPLOAD=true
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
app_name="netpd" app_name="netpd"
package_version=$(date +%Y-%m-%d) package_version=$(date +%Y-%m-%d)
src_url="https://github.com/reduzent/netpd" src_url="https://github.com/reduzent/netpd"
...@@ -93,15 +114,20 @@ s/{BUNDLE_VERSION}/${app_version}/ ...@@ -93,15 +114,20 @@ s/{BUNDLE_VERSION}/${app_version}/
dmg "${app_name}-${app_version}-macos-${package_version}.iso" "${app_name}-${app_version}-macos-${package_version}.dmg" || fail dmg "${app_name}-${app_version}-macos-${package_version}.iso" "${app_name}-${app_version}-macos-${package_version}.dmg" || fail
rm "${app_name}-${app_version}-macos-${package_version}.iso" || fail rm "${app_name}-${app_version}-macos-${package_version}.iso" || fail
# put file online if $SKIP_UPLOAD; then
scp -q "${app_name}-${app_version}-macos-${package_version}.dmg" "all@netpd.org:public_html/software/" || fail # clean up workdir only
rm -r "${work_dir}" || fail
else
# put file online
scp -q "${app_name}-${app_version}-macos-${package_version}.dmg" "all@netpd.org:public_html/software/" || fail
# clean up # clean up
rm -r "${work_dir}" "${app_name}-${app_version}-macos-${package_version}.dmg" || fail rm -r "${work_dir}" "${app_name}-${app_version}-macos-${package_version}.dmg" || fail
# create short cut # create short cut
ssh all@netpd.org ln -f -s "${app_name}-${app_version}-macos-${package_version}.dmg" "public_html/software/${app_name}-${app_version}-macos.dmg" || fail ssh all@netpd.org ln -f -s "${app_name}-${app_version}-macos-${package_version}.dmg" "public_html/software/${app_name}-${app_version}-macos.dmg" || fail
# update redirect target in .htaccess # update redirect target in .htaccess
ssh all@netpd.org sed -i "2s/[0-9]\.[0-9]\.[0-9]/${app_version}/" public_html/software/.htaccess || fail ssh all@netpd.org sed -i "2s/[0-9]\.[0-9]\.[0-9]/${app_version}/" public_html/software/.htaccess || fail
fi
) )
Supports Markdown
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