Skip to content

Instantly share code, notes, and snippets.

@nogo
Last active August 30, 2016 07:54
Show Gist options
  • Save nogo/a6c4c23c729803779708eacd6195f0a8 to your computer and use it in GitHub Desktop.
Save nogo/a6c4c23c729803779708eacd6195f0a8 to your computer and use it in GitHub Desktop.
Install and update my cloud instance

Folder structure

/cloud
  /config
  /data
  /releases
    /current -> X.X.X
    /X.X.X
    /...

Install or update

> ./install_cloud.sh 10.0.0
... Download and upgrade ...
> cd current
> php occ maintenance:mode --off

After upgrade

Login into the cloud and check everything is working. Enable 3rd-party apps.

#!/bin/bash
[[ -z $1 ]] && { echo "add version X.X.X as parameter"; exit 1; }
VERSION=$1
NAME=nextcloud
FILE=nextcloud-${VERSION}.tar.bz2
FOLDER=${VERSION}
# Download
if [ -f ${FILE} ]; then
rm ${FILE}
fi
#wget --no-check-certificate https://download.owncloud.org/community/${FILE}
wget --no-check-certificate https://download.nextcloud.com/server/releases/${FILE}
# Extract
if [ -d ${FOLDER} ]; then
rm -fR ${FOLDER}
fi
tar -xjf ${FILE}
mv ${NAME} ${FOLDER}
rm ${FILE}
# Symlink
cd ${FOLDER}
rm -fR config
ln -s ../../config config
ln -s ../../data data
cd ..
# Maintenance
cd current
php occ maintenance:mode --on
cd ..
# Update
rm current
ln -s ${FOLDER} current
cd current
php occ upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment