mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 06:32:00 -03:30
build: fully local builds
This commit is contained in:
parent
7a8c0e40f5
commit
dabc17fb07
@ -2,6 +2,8 @@ torrent/
|
|||||||
tmp/
|
tmp/
|
||||||
cache/
|
cache/
|
||||||
output/
|
output/
|
||||||
|
raspbian_root/
|
||||||
|
raspbian_boot/
|
||||||
qemu-raspbian-network/
|
qemu-raspbian-network/
|
||||||
armbian/
|
armbian/
|
||||||
*.img
|
*.img
|
||||||
|
|||||||
13
armbian.sh
13
armbian.sh
@ -25,7 +25,18 @@ chage -d -1 root
|
|||||||
touch /.ncp-image
|
touch /.ncp-image
|
||||||
|
|
||||||
# install NCP
|
# install NCP
|
||||||
curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash
|
cd /tmp/overlay
|
||||||
|
echo -e "\nInstalling NextCloudPi"
|
||||||
|
source etc/library.sh
|
||||||
|
|
||||||
|
install_script lamp.sh
|
||||||
|
install_script etc/ncp-config.d/nc-nextcloud.sh
|
||||||
|
activate_script etc/ncp-config.d/nc-nextcloud.sh
|
||||||
|
install_script ncp.sh
|
||||||
|
activate_script etc/ncp-config.d/nc-init.sh
|
||||||
|
install_script post-inst.sh
|
||||||
|
|
||||||
|
cd -
|
||||||
|
|
||||||
# force change root password at first login (again)
|
# force change root password at first login (again)
|
||||||
chage -d 0 root
|
chage -d 0 root
|
||||||
|
|||||||
4
batch.sh
4
batch.sh
@ -39,14 +39,14 @@ make nextcloudpi-x86 && {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Docker armhf
|
# Docker armhf
|
||||||
cp /usr/bin/qemu-arm-static docker-armhf
|
cp -n /usr/bin/qemu-arm-static docker-armhf && \
|
||||||
make nextcloudpi-armhf && {
|
make nextcloudpi-armhf && {
|
||||||
docker push ownyourbits/nextcloudpi-armhf
|
docker push ownyourbits/nextcloudpi-armhf
|
||||||
docker push ownyourbits/nextcloud-armhf
|
docker push ownyourbits/nextcloud-armhf
|
||||||
docker push ownyourbits/lamp-armhf
|
docker push ownyourbits/lamp-armhf
|
||||||
docker push ownyourbits/debian-ncp-armhf
|
docker push ownyourbits/debian-ncp-armhf
|
||||||
}
|
}
|
||||||
rm docker-armhf/qemu-arm-static
|
rm -f docker-armhf/qemu-arm-static
|
||||||
|
|
||||||
# License
|
# License
|
||||||
#
|
#
|
||||||
|
|||||||
@ -16,11 +16,12 @@
|
|||||||
echo "No internet connectivity"
|
echo "No internet connectivity"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
cd "$TMPDIR"
|
[[ -f /.ncp-image ]] || cd "$TMPDIR" # update locally during build
|
||||||
|
|
||||||
echo -e "Performing updates"
|
echo -e "Performing updates"
|
||||||
./update.sh && {
|
./update.sh && {
|
||||||
|
|
||||||
|
cd "$TMPDIR"
|
||||||
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
|
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
|
||||||
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
|
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
|
||||||
echo "$VER" > /usr/local/etc/ncp-version
|
echo "$VER" > /usr/local/etc/ncp-version
|
||||||
|
|||||||
@ -25,8 +25,9 @@ prepare_dirs # tmp cache output
|
|||||||
( cd armbian && git pull --ff-only --tags )
|
( cd armbian && git pull --ff-only --tags )
|
||||||
|
|
||||||
# add NCP modifications
|
# add NCP modifications
|
||||||
mkdir -p armbian/userpatches
|
mkdir -p armbian/userpatches armbian/userpatches/overlay
|
||||||
cp armbian.sh armbian/userpatches/customize-image.sh
|
cp armbian.sh armbian/userpatches/customize-image.sh
|
||||||
|
rsync -Aax --delete --exclude-from .gitignore . armbian/userpatches/overlay/
|
||||||
|
|
||||||
# GENERATE IMAGE
|
# GENERATE IMAGE
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ echo -e "\e[1m\n[ Build NCP ]\e[0m"
|
|||||||
prepare_chroot_raspbian "$IMG"
|
prepare_chroot_raspbian "$IMG"
|
||||||
|
|
||||||
mkdir raspbian_root/tmp/ncp-build
|
mkdir raspbian_root/tmp/ncp-build
|
||||||
cp etc/library.sh lamp.sh etc/ncp-config.d/{nc-nextcloud.sh,nc-init.sh} ncp.sh post-inst.sh raspbian_root/tmp/ncp-build
|
cp -r *.sh etc bin ncp-web raspbian_root/tmp/ncp-build
|
||||||
|
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
||||||
sudo chroot raspbian_root /bin/bash <<'EOFCHROOT'
|
sudo chroot raspbian_root /bin/bash <<'EOFCHROOT'
|
||||||
@ -52,12 +52,12 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
|||||||
|
|
||||||
# install everything
|
# install everything
|
||||||
cd /tmp/ncp-build || exit 1
|
cd /tmp/ncp-build || exit 1
|
||||||
source library.sh
|
source etc/library.sh
|
||||||
install_script lamp.sh
|
install_script lamp.sh
|
||||||
install_script nc-nextcloud.sh
|
install_script etc/ncp-config.d/nc-nextcloud.sh
|
||||||
activate_script nc-nextcloud.sh
|
activate_script etc/ncp-config.d/nc-nextcloud.sh
|
||||||
install_script ncp.sh
|
install_script ncp.sh
|
||||||
activate_script nc-init.sh
|
activate_script etc/ncp-config.d/nc-init.sh
|
||||||
install_script post-inst.sh
|
install_script post-inst.sh
|
||||||
|
|
||||||
# harden SSH further for Raspbian
|
# harden SSH further for Raspbian
|
||||||
|
|||||||
@ -6,7 +6,12 @@ SHELL ["/bin/bash", "-c"]
|
|||||||
|
|
||||||
ENV DOCKERBUILD 1
|
ENV DOCKERBUILD 1
|
||||||
|
|
||||||
COPY ncp.sh /usr/local/etc/
|
RUN mkdir -p /tmp/ncp-build
|
||||||
|
COPY bin/* /tmp/ncp-build/bin/
|
||||||
|
COPY etc /tmp/ncp-build/etc/
|
||||||
|
COPY ncp.sh update.sh /tmp/ncp-build/
|
||||||
|
COPY ncp-web /tmp/ncp-build/ncp-web/
|
||||||
|
COPY docker-common /tmp/ncp-build/docker-common/
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
|
|
||||||
@ -22,25 +27,25 @@ apt-get install --no-install-recommends -y wget ca-certificates; \
|
|||||||
# install nextcloudpi
|
# install nextcloudpi
|
||||||
source /usr/local/etc/library.sh; \
|
source /usr/local/etc/library.sh; \
|
||||||
set +x; \
|
set +x; \
|
||||||
cd /usr/local/etc/; \
|
cd /tmp/ncp-build/; \
|
||||||
install_script ncp.sh; \
|
install_script ncp.sh; \
|
||||||
|
|
||||||
# fix default paths
|
# fix default paths
|
||||||
sed -i 's|/media/USBdrive|/data/backups|' ncp-config.d/nc-backup.sh; \
|
sed -i 's|/media/USBdrive|/data/backups|' /usr/local/etc/ncp-config.d/nc-backup.sh; \
|
||||||
|
|
||||||
# specific cleanup
|
# specific cleanup
|
||||||
rm /usr/local/etc/ncp.sh; \
|
rm -r /tmp/ncp-build; \
|
||||||
rm /.ncp-image; \
|
rm /.ncp-image; \
|
||||||
|
|
||||||
# should be cleaned up in no-ip.sh, but breaks udiskie.
|
|
||||||
# safe to do it here since no automount in docker
|
|
||||||
apt-get purge -y make gcc libc-dev; \
|
|
||||||
|
|
||||||
# cleanup all NCP extras
|
# cleanup all NCP extras
|
||||||
source /usr/local/etc/library.sh; \
|
source /usr/local/etc/library.sh; \
|
||||||
cd /usr/local/etc/ncp-config.d/; \
|
cd /usr/local/etc/ncp-config.d/; \
|
||||||
for script in *.sh; do cleanup_script $script; done; \
|
for script in *.sh; do cleanup_script $script; done; \
|
||||||
|
|
||||||
|
# should be cleaned up in no-ip.sh, but breaks udiskie.
|
||||||
|
# safe to do it here since no automount in docker
|
||||||
|
apt-get purge -y make gcc libc-dev; \
|
||||||
|
|
||||||
# package clean up
|
# package clean up
|
||||||
apt-get autoremove -y; \
|
apt-get autoremove -y; \
|
||||||
apt-get clean; \
|
apt-get clean; \
|
||||||
|
|||||||
@ -6,7 +6,12 @@ SHELL ["/bin/bash", "-c"]
|
|||||||
|
|
||||||
ENV DOCKERBUILD 1
|
ENV DOCKERBUILD 1
|
||||||
|
|
||||||
COPY ncp.sh /usr/local/etc/
|
RUN mkdir -p /tmp/ncp-build
|
||||||
|
COPY bin/* /tmp/ncp-build/bin/
|
||||||
|
COPY etc /tmp/ncp-build/etc/
|
||||||
|
COPY ncp.sh update.sh /tmp/ncp-build/
|
||||||
|
COPY ncp-web /tmp/ncp-build/ncp-web/
|
||||||
|
COPY docker-common /tmp/ncp-build/docker-common/
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
|
|
||||||
@ -22,25 +27,25 @@ apt-get install --no-install-recommends -y wget ca-certificates; \
|
|||||||
# install nextcloudpi
|
# install nextcloudpi
|
||||||
source /usr/local/etc/library.sh; \
|
source /usr/local/etc/library.sh; \
|
||||||
set +x; \
|
set +x; \
|
||||||
cd /usr/local/etc/; \
|
cd /tmp/ncp-build/; \
|
||||||
install_script ncp.sh; \
|
install_script ncp.sh; \
|
||||||
|
|
||||||
# fix default paths
|
# fix default paths
|
||||||
sed -i 's|/media/USBdrive|/data/backups|' ncp-config.d/nc-backup.sh; \
|
sed -i 's|/media/USBdrive|/data/backups|' /usr/local/etc/ncp-config.d/nc-backup.sh; \
|
||||||
|
|
||||||
# specific cleanup
|
# specific cleanup
|
||||||
rm /usr/local/etc/ncp.sh; \
|
rm -r /tmp/ncp-build; \
|
||||||
rm /.ncp-image; \
|
rm /.ncp-image; \
|
||||||
|
|
||||||
# should be cleaned up in no-ip.sh, but breaks udiskie.
|
|
||||||
# safe to do it here since no automount in docker
|
|
||||||
apt-get purge -y make gcc libc-dev; \
|
|
||||||
|
|
||||||
# cleanup all NCP extras
|
# cleanup all NCP extras
|
||||||
source /usr/local/etc/library.sh; \
|
source /usr/local/etc/library.sh; \
|
||||||
cd /usr/local/etc/ncp-config.d/; \
|
cd /usr/local/etc/ncp-config.d/; \
|
||||||
for script in *.sh; do cleanup_script $script; done; \
|
for script in *.sh; do cleanup_script $script; done; \
|
||||||
|
|
||||||
|
# should be cleaned up in no-ip.sh, but breaks udiskie.
|
||||||
|
# safe to do it here since no automount in docker
|
||||||
|
apt-get purge -y make gcc libc-dev; \
|
||||||
|
|
||||||
# package clean up
|
# package clean up
|
||||||
apt-get autoremove -y; \
|
apt-get autoremove -y; \
|
||||||
apt-get clean; \
|
apt-get clean; \
|
||||||
|
|||||||
@ -25,7 +25,6 @@ configure()
|
|||||||
} || {
|
} || {
|
||||||
sudo -u www-data php "$OCC" config:system:set htaccess.RewriteBase --value="/"
|
sudo -u www-data php "$OCC" config:system:set htaccess.RewriteBase --value="/"
|
||||||
sudo -u www-data php "$OCC" maintenance:update:htaccess
|
sudo -u www-data php "$OCC" maintenance:update:htaccess
|
||||||
a2enmod env
|
|
||||||
echo "Your cloud now has a pretty domain name."
|
echo "Your cloud now has a pretty domain name."
|
||||||
}
|
}
|
||||||
bash -c "sleep 2 && service apache2 reload" &>/dev/null &
|
bash -c "sleep 2 && service apache2 reload" &>/dev/null &
|
||||||
|
|||||||
8
ncp.sh
8
ncp.sh
@ -21,7 +21,7 @@ install()
|
|||||||
{
|
{
|
||||||
# NCP-CONFIG
|
# NCP-CONFIG
|
||||||
apt-get update
|
apt-get update
|
||||||
$APTINSTALL dialog whiptail
|
$APTINSTALL git dialog whiptail
|
||||||
mkdir -p $CONFDIR
|
mkdir -p $CONFDIR
|
||||||
|
|
||||||
# include option in raspi-config (only Raspbian)
|
# include option in raspi-config (only Raspbian)
|
||||||
@ -182,11 +182,7 @@ EOF
|
|||||||
chmod g+w /var/run/.ncp-latest-version
|
chmod g+w /var/run/.ncp-latest-version
|
||||||
|
|
||||||
# update to latest version from github as part of the build process
|
# update to latest version from github as part of the build process
|
||||||
$APTINSTALL git
|
bin/ncp-update $BRANCH
|
||||||
wget https://raw.githubusercontent.com/nextcloud/nextcloudpi/$BRANCH/bin/ncp-update -O /usr/local/bin/ncp-update
|
|
||||||
chmod a+x /usr/local/bin/ncp-update
|
|
||||||
|
|
||||||
/usr/local/bin/ncp-update $BRANCH
|
|
||||||
|
|
||||||
# ONLY FOR IMAGE BUILDS
|
# ONLY FOR IMAGE BUILDS
|
||||||
if [[ -f /.ncp-image ]]; then
|
if [[ -f /.ncp-image ]]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user