Test new cloudron packages locally before on a live server.
-
Is there an option to test a cloudron app package locally e.g. on my dev computer (an apple MacBook) before installing it on a real server?
I did my first cloudronManifest and just want to test it locally before I install it on a real live machine, where nothing should crash
due to the fact it is my first packaging, there will be errors and I would feel more save if I can test it beforehand

-
Is there an option to test a cloudron app package locally e.g. on my dev computer (an apple MacBook) before installing it on a real server?
I did my first cloudronManifest and just want to test it locally before I install it on a real live machine, where nothing should crash
due to the fact it is my first packaging, there will be errors and I would feel more save if I can test it beforehand

-
Is there an option to test a cloudron app package locally e.g. on my dev computer (an apple MacBook) before installing it on a real server?
I did my first cloudronManifest and just want to test it locally before I install it on a real live machine, where nothing should crash
due to the fact it is my first packaging, there will be errors and I would feel more save if I can test it beforehand

@grienauer
When I did my testing for the Valheim Server App I wrote this script to make testing easier.Note tho, this only works when not using any addons, but localstorage works with the local mount.
#!/bin/bash # Function to get the user to input the needed vars get_vars () { read -p "Cloudron E-Mail: " EMAIL read -p "Cloudron Username: " USERNAME read -s -p "Cloudron Password: " PASSWORD read -p "Cloudron URL: " CLOUDRON_URL read -p "DOCKER REPOSITORY URL: " DOCKER_REPOSITORY_URL read -p "DOCKER USERNAME: " DOCKER_REPOSITORY_USERNAME read -p -s "DOCKER PASSWORD: " DOCKER_REPOSITORY_PASSWORD printf "EMAIL=$EMAIL\n USERNAME=$USERNAME\n PASSWORD=$PASSWORD\n CLOUDRON_URL=$CLOUDRON_URL\n DOCKER_REPOSITORY_URL=$DOCKER_REPOSITORY_URL\n DOCKER_REPOSITORY_USERNAME=$DOCKER_REPOSITORY_USERNAME\n DOCKER_REPOSITORY_PASSWORD=$DOCKER_REPOSITORY_PASSWORD\n " > .env } # check if .env file exists and read it or check if vars exsist if [ -f ".env" ]; then export $(egrep -v '^#' .env | xargs) &> /dev/null else echo ".env File missing - asking for required vars" get_vars fi if [ -z "$EMAIL" ] || [ -z "$USERNAME" ] || [ -z "$PASSWORD" ] || [ -z "$CLOUDRON_URL" ] || [ -z "$DOCKER_REPOSITORY_URL" ] || [ -z "$DOCKER_REPOSITORY_USERNAME" ] || [ -z "$DOCKER_REPOSITORY_PASSWORD" ]; then echo "some vars are empty - asking for required vars" get_vars fi echo "=> Login Docker" docker login --username $DOCKER_REPOSITORY_USERNAME --password $DOCKER_REPOSITORY_PASSWORD $DOCKER_REPOSITORY_URL echo "=> Login Cloudron" cloudron login --username $USERNAME --password $PASSWORD my.$CLOUDRON_URL set -x # Get the ID and VERSION from the CloudronManifest.json ID=$(jq -r ".id" CloudronManifest.json) VERSION=$(jq -r ".version" CloudronManifest.json) echo "=> Create Test Data dir" mkdir -p ./cloudron_test/data ./cloudron_test/tmp ./cloudron_test/run echo "=> Cleanup Test Data" rm -rf ./cloudron_test/data/* ./cloudron_test/tmp/* ./cloudron_test/run/* echo "=> Build test image" cloudron build --set-repository $DOCKER_REPOSITORY_URL/$ID # docker build -t $DOCKER_REPOSITORY_URL/$ID:$VERSION . if [[ RUN_IMG = "" ]]; then read -p "Do you want to run the image created image?: (y/N)" RUN_IMG fi if [[ "$RUN_IMG" = "y" || "$RUN_IMG" = "Y" ]]; then echo "=> Run `test` tag of build image" docker run -ti --read-only \ --volume $(pwd)/cloudron_test/data:/app/data:rw \ --volume $(pwd)/cloudron_test/tmp:/tmp:rw \ --volume $(pwd)/cloudron_test/run:/run:rw \ $DOCKER_REPOSITORY_URL/$ID:$VERSION \ bash fi echo "=> Running tests" cd test echo "=> Running ncu - updating deps" ncu -u npm -i echo "=> Installing package.json" npm install if [[ -f ./node_modules/.bin/mocha ]]; then ./node_modules/.bin/mocha ./test.js -b fi if [[ -f ../node_modules/.bin/mocha ]]; then ../node_modules/.bin/mocha ./test.js -b fi # remove installed test instance echo "Cancel now if you wish to keep the app installed" sleep 10 cloudron uninstall --app test.$CLOUDRON_URL
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login