diff --git a/scripts/build-docker.sh b/scripts/build-docker.sh index 91720c060b2a23dc691326799ccbf88305bd8b85..bff025c08b3c74a69882ab93a805695d9af50a68 100644 --- a/scripts/build-docker.sh +++ b/scripts/build-docker.sh @@ -4,6 +4,8 @@ # This is wrapper script for build.sh use from inside docker container ################################################################################ +PKGNAME='ocs-url' + PKGUSER='pkgbuilder' BUILDTYPE='' @@ -15,6 +17,15 @@ PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)" BUILDSCRIPT="${PROJDIR}/scripts/build.sh" +transfer_file() { + filepath="${1}" + if [ -f "${filepath}" ]; then + filename="$(basename "${filepath}")" + echo "Uploading ${filename}" + curl -T "${filepath}" "https://transfer.sh/${filename}" + fi +} + build_ubuntu() { # docker-image: ubuntu:14.04 apt update -qq @@ -27,6 +38,8 @@ build_ubuntu() { chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}" su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER} + + transfer_file "$(find "${PROJDIR}/build_*" -type f -name "${PKGNAME}*.deb")" } build_fedora() { @@ -44,6 +57,8 @@ build_fedora() { chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}" su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER} + + transfer_file "$(find "${PROJDIR}/build_*" -type f -name "${PKGNAME}*.rpm")" } build_archlinux() { @@ -58,6 +73,8 @@ build_archlinux() { chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}" su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER} + + transfer_file "$(find "${PROJDIR}/build_*" -type f -name "${PKGNAME}*.pkg.tar.xz")" } build_snap() { @@ -72,6 +89,8 @@ build_snap() { chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}" su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER} + + transfer_file "$(find "${PROJDIR}/build_*" -type f -name "${PKGNAME}*.snap")" } build_appimage() { @@ -88,6 +107,8 @@ build_appimage() { chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}" su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER} + + transfer_file "$(find "${PROJDIR}/build_*" -type f -name "${PKGNAME}*.AppImage")" } if [ "${BUILDTYPE}" = 'ubuntu' ]; then diff --git a/scripts/build.sh b/scripts/build.sh index 0da0d39dbcb2f35697174a874f14349b2d5bad95..a9969aa8a2a6326ad5e628428f3a3650fecd78d2 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -24,15 +24,6 @@ export_srcarchive() { $(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${filepath}" HEAD) } -transfer_file() { - filepath="${1}" - if [ -f "${filepath}" ]; then - filename="$(basename "${filepath}")" - echo "Uploading ${filename}" - curl -T "${filepath}" "https://transfer.sh/${filename}" - fi -} - build_ubuntu() { cd "${PROJDIR}" mkdir -p "${BUILDDIR}" @@ -42,8 +33,6 @@ build_ubuntu() { cp -r "${PROJDIR}/pkg/ubuntu/debian" "${BUILDDIR}/${PKGNAME}" cd "${BUILDDIR}/${PKGNAME}" debuild -uc -us -b - - transfer_file "$(find "${BUILDDIR}" -type f -name "${PKGNAME}*.deb")" } build_fedora() { @@ -56,8 +45,6 @@ build_fedora() { mv "${SRCARCHIVE}" "${BUILDDIR}/SOURCES" cp "${PROJDIR}/pkg/fedora/${PKGNAME}.spec" "${BUILDDIR}/SPECS" rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec" - - transfer_file "$(find "${BUILDDIR}" -type f -name "${PKGNAME}*.rpm")" } build_archlinux() { @@ -69,8 +56,6 @@ build_archlinux() { cd "${BUILDDIR}" updpkgsums makepkg -s - - transfer_file "$(find "${BUILDDIR}" -type f -name "${PKGNAME}*.pkg.tar.xz")" } build_snap() { @@ -83,8 +68,6 @@ build_snap() { cp -r "${PROJDIR}/pkg/snap/setup" "${BUILDDIR}/${PKGNAME}" cd "${BUILDDIR}/${PKGNAME}" snapcraft - - transfer_file "$(find "${BUILDDIR}" -type f -name "${PKGNAME}*.snap")" } build_appimage() { @@ -118,8 +101,6 @@ build_appimage() { install -m 755 -p "${BUILDDIR}/${PKGNAME}/pkg/appimage/appimage-desktopintegration_${PKGNAME}" "${BUILDDIR}/${PKGNAME}.AppDir/AppRun" ./linuxdeployqt --appimage-extract ./squashfs-root/usr/bin/appimagetool "${BUILDDIR}/${PKGNAME}.AppDir" - - transfer_file "$(find "${BUILDDIR}" -type f -name "${PKGNAME}*.AppImage")" } if [ "${BUILDTYPE}" = 'ubuntu' ]; then