diff --git a/README.md b/README.md index 36ea2dd4766c2d26d0d99c8940df78daa48e8768..f6e93ef2eb023e9c81327f21d21ba3f8805dbb06 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,13 @@ We will now create a personal instance `myuser.cozy.mydomain.tld` : Open in a browser the url displayed at the end of the script output to finalize the instance configuration. :+1: Congratulations you have now your own cozy cloud. + +## Install applications + +[Drive](https://github.com/cozy/cozy-drive) and [Photo](https://github.com/cozy/cozy-photos) are installed by default by the [create-instance.sh](create-instance.sh) script. Other applications like [banks](https://github.com/cozy/cozy-banks) or [contacts](https://github.com/cozy/cozy-contacts) are also available. + +To install an application, you can run the [application.sh](application.sh) script : + +``` +sudo ./application.sh <instance name> <application> +``` diff --git a/application.sh b/application.sh new file mode 100755 index 0000000000000000000000000000000000000000..bde74b24ad77fc19c12ddb690b096bc91e886d20 --- /dev/null +++ b/application.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -u + +function usage() { + echo "Install official applications" + echo + echo "Usage: $0 <instance> <application>" + echo "Non exhaustive list of official possible applications :" + echo " - drive (installed by default)" + echo " - photos (installed by default)" + echo " - settings (installed by default)" + echo " - banks" + echo " - contacts" + exit 1 +} + +if [ $# -eq 0 ]; then + usage +fi + +if [ ! -e ".env" ]; then + echo "Environnement configuration not found (.env file)" + exit 1 +fi + +source .env + +INSTANCE_ID=$1 +APP=$2 + +INSTANCE="${INSTANCE_ID}.${COZY_TLD}" +echo "Installing $APP application on $INSTANCE" + +if [ "$APP" == "banks" ]; then + BRANCH="latest" +else + BRANCH="build" +fi + +BASE_URL="git://github.com/cozy/cozy-" + +APP_URL="${BASE_URL}${APP}.git#${BRANCH}" + +echo "Installing from ${APP_URL}" + +# TODO allow different actions +docker-compose exec cozy ./cozy apps install --domain ${INSTANCE} ${APP} ${APP_URL}