diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..83ea78951eab71125eb8ff381610a8c3d7d6c153 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +api +front +music/files diff --git a/README.md b/README.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..798523b73305a513cda2e7199a15eda6cbd9dcf1 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,13 @@ +#Funkwhale demo + +You simply need to download demo tracks (courtesy of Jamendo): + + ./download-tracks.sh + +Then set up everything: + + ./setup-demo.sh + +This will take care of pulling git repositories, spin up docker containers, etc. + +`./setup-demo` may be called multiple times if you want to update the demo to newer versions. diff --git a/api-env b/api-env new file mode 100644 index 0000000000000000000000000000000000000000..64b7cc2a0aaaa781356cbb3fac813148f4a1bbf0 --- /dev/null +++ b/api-env @@ -0,0 +1 @@ +API_AUTHENTICATION_REQUIRED=false diff --git a/download-tracks.sh b/download-tracks.sh new file mode 100755 index 0000000000000000000000000000000000000000..85b79649292abd22edf8e9329757805d74734742 --- /dev/null +++ b/download-tracks.sh @@ -0,0 +1,18 @@ +#! /bin/bash + +echo "This will download tracks from zip archives listed under music/list" + +mkdir -p music/files +cd music/files + +echo "Downloading files..." +cat ../list | grep "^[^#;]" | xargs -n 1 curl -LO + +echo "Unzipping archives..." +find . -name "*.zip" | while read filename; do + dirname="${filename%.*}" + mkdir $dirname + unzip -o -d "$dirname" "$filename"; +done; + +echo "Done!" diff --git a/front-env b/front-env new file mode 100644 index 0000000000000000000000000000000000000000..d981344852a3637b7b00aa8b8ac6e407a5da1dbf --- /dev/null +++ b/front-env @@ -0,0 +1 @@ +BACKEND_URL=https://demo.funkwhale.io diff --git a/music/list b/music/list new file mode 100644 index 0000000000000000000000000000000000000000..26a83c4e84b220d1f0d76b42912433cd762910d1 --- /dev/null +++ b/music/list @@ -0,0 +1,8 @@ +# You can get a pretty list of open music here: https://archive.org/details/jamendo-albums +https://archive.org/compress/jamendo-069098/formats=OGG%20VORBIS&file=/jamendo-069098.zip +https://archive.org/compress/jamendo-001144/formats=OGG%20VORBIS&file=/jamendo-001144.zip +https://archive.org/compress/jamendo-027690/formats=OGG%20VORBIS&file=/jamendo-027690.zip +https://archive.org/compress/jamendo-001469/formats=OGG%20VORBIS&file=/jamendo-001469.zip +https://archive.org/compress/jamendo-106323/formats=OGG%20VORBIS&file=/jamendo-106323.zip +https://archive.org/compress/jamendo-071149/formats=OGG%20VORBIS&file=/jamendo-071149.zip +https://archive.org/compress/jamendo-085030/formats=OGG%20VORBIS&file=/jamendo-085030.zip diff --git a/setup-demo.sh b/setup-demo.sh new file mode 100755 index 0000000000000000000000000000000000000000..4a7b7bbfaff00a5bde32a4f8e2361bcce710b978 --- /dev/null +++ b/setup-demo.sh @@ -0,0 +1,37 @@ +#! /bin/bash + +API_BRANCH="develop" +FRONT_BRANCH="master" +echo "Initializing repositories..." +git clone ssh://git@code.eliotberriot.com:2222/funkwhale/api.git api +git clone ssh://git@code.eliotberriot.com:2222/funkwhale/front.git front + +echo "Updating repositories..." +git -C api checkout $API_BRANCH +git -C api pull +git -C front checkout $FRONT_BRANCH +git -C front pull + +echo "Copying music directory..." +cp -r music api/ + +echo "Setting up api .env file..." +cp ./api-env api/.env + +echo "Setting up front .env file..." +cp ./front-env front/.env + +echo "Stopping previous demo..." +docker-compose -p funkwhale_demo_api -f api/dev.yml down -v +docker-compose -p funkwhale_demo_front -f front/dev.yml down -v +rm -rf api/funkwhale_api/media + +echo "Compiling front-end files..." +docker-compose -p funkwhale_demo_front -f front/dev.yml run app npm run build + +echo "Configuring api..." +docker-compose -p funkwhale_demo_api -f api/dev.yml up -d postgres +sleep 5 +docker-compose -p funkwhale_demo_api -f api/dev.yml run django ./demo/load-demo-data.sh + +docker-compose -p funkwhale_demo_api -f api/dev.yml up -d