Skip to content
Snippets Groups Projects
Commit de767af4 authored by akiraohgaki's avatar akiraohgaki
Browse files

Move transfer function from build.sh to build-docker.sh

parent 742ad75f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment