2022-06-23 17:21:06 +00:00
|
|
|
|
tasks:
|
2022-07-03 08:45:36 +00:00
|
|
|
|
- name: Docker
|
2022-06-23 17:21:06 +00:00
|
|
|
|
env:
|
|
|
|
|
COMPOSE_FILE: dev.yml
|
|
|
|
|
init: |
|
2022-07-03 08:45:36 +00:00
|
|
|
|
# Install frontend depencencies locally
|
2022-06-23 17:21:06 +00:00
|
|
|
|
cd front
|
|
|
|
|
yarn install
|
|
|
|
|
cd ..
|
2022-07-03 08:45:36 +00:00
|
|
|
|
|
|
|
|
|
# Prepare prebuild .env
|
2022-06-23 17:21:06 +00:00
|
|
|
|
echo "# Gitpod Environment Variables" > .env
|
2022-07-03 08:45:36 +00:00
|
|
|
|
|
|
|
|
|
# Prepare docker
|
2022-06-23 17:21:06 +00:00
|
|
|
|
docker network create federation
|
|
|
|
|
docker-compose pull
|
|
|
|
|
docker-compose build
|
|
|
|
|
docker-compose up -d postgres redis
|
|
|
|
|
sleep 10 # allow postgres and redis to initialize
|
2022-07-03 08:45:36 +00:00
|
|
|
|
|
|
|
|
|
# Prepare backend
|
2022-06-23 17:21:06 +00:00
|
|
|
|
docker-compose run --rm api python manage.py migrate
|
|
|
|
|
docker-compose run --rm api python manage.py createsuperuser --no-input --username gitpod --email gitpod@example.com
|
2022-07-03 08:45:36 +00:00
|
|
|
|
docker-compose run --rm api python manage.py fw users set --password "gitpod" gitpod --no-input
|
|
|
|
|
|
|
|
|
|
# Compile frontend locales
|
2022-06-23 17:21:06 +00:00
|
|
|
|
docker-compose run --rm front yarn run i18n-compile
|
2022-07-03 08:45:36 +00:00
|
|
|
|
|
|
|
|
|
# Start API to let script create an actor
|
|
|
|
|
docker-compose up -d nginx
|
|
|
|
|
gp ports await 8000
|
|
|
|
|
|
|
|
|
|
# Clone music repo
|
|
|
|
|
git clone https://dev.funkwhale.audio/funkwhale/catalog.git
|
|
|
|
|
sudo mv catalog/music data
|
|
|
|
|
sudo chown -R root:root data/music
|
|
|
|
|
rm -rf catalog
|
|
|
|
|
|
|
|
|
|
# Login with cURL to create actor
|
|
|
|
|
python .gitpod/init_actor.py
|
|
|
|
|
|
|
|
|
|
# Import music
|
|
|
|
|
docker-compose down
|
|
|
|
|
LIBRARY_ID=`cat .gitpod/create_library.py | docker-compose run --rm -T api python manage.py shell -i python`
|
|
|
|
|
docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/music/" --recursive --noinput --in-place
|
|
|
|
|
|
|
|
|
|
# Stop docker
|
|
|
|
|
docker-compose stop
|
|
|
|
|
command: |
|
|
|
|
|
# Prepare workspace .env
|
|
|
|
|
echo "MEDIA_URL=`gp url 8000`/media/" >> .env
|
|
|
|
|
echo "STATIC_URL=`gp url 8000`/staticfiles/" >> .env
|
|
|
|
|
echo "FUNKWHALE_HOSTNAME=`gp url 8000 | sed 's#https://##'`" >> .env
|
|
|
|
|
echo "FUNKWHALE_PROTOCOL=https" >> .env
|
|
|
|
|
echo "GITPOD_WORKSPACE_URL=$GITPOD_WORKSPACE_URL" >> .env
|
|
|
|
|
echo "HMR_PORT=8000" >> .env
|
|
|
|
|
echo "VUE_APP_INSTANCE_URL=$VUE_APP_INSTANCE_URL" >> .env
|
|
|
|
|
|
|
|
|
|
# Start app
|
|
|
|
|
docker-compose up front api nginx
|
2022-06-23 17:21:06 +00:00
|
|
|
|
|
|
|
|
|
- name: Welcome to Funkwhale development!
|
2022-07-03 08:45:36 +00:00
|
|
|
|
env:
|
|
|
|
|
COMPOSE_FILE: dev.yml
|
2022-06-23 17:21:06 +00:00
|
|
|
|
command: |
|
|
|
|
|
clear
|
|
|
|
|
echo ""
|
2022-07-03 08:45:36 +00:00
|
|
|
|
echo -e " ⠀⠀⠸⣿⣷⣦⣄⣠⣶⣾⣿⠇⠀⠀ You can now start developing Funkwhale with gitpod!"
|
|
|
|
|
echo -e " ⠀⠀⠀⠈⠉⠻⣿⣿⠟⠉⠁⠀⠀⠀"
|
|
|
|
|
echo -e " \u1b[34m⣀⠀⢀⡀⢀⣀\u1b[0m⠹⠇\u1b[34m⣀⡀⢀⡀⠀⣀ \u1b[0mTo sign in to the superuser account,"
|
|
|
|
|
echo -e " \u1b[34m⢻⣇⠘⣧⡈⠻⠶⠶⠟⢁⣾⠃⣸⡟ \u1b[0mplease use these credentials:"
|
|
|
|
|
echo -e " \u1b[34m⠀⠻⣦⡈⠻⠶⣶⣶⠶⠟⢁⣴⠟⠀"
|
|
|
|
|
echo -e " \u1b[34m⠀⠀⠈⠻⠷⣦⣤⣤⣴⠾⠟⠁⠀⠀ gitpod\u1b[0m:\u1b[34mgitpod"
|
|
|
|
|
echo ""
|
2022-06-23 17:21:06 +00:00
|
|
|
|
|
|
|
|
|
ports:
|
|
|
|
|
- port: 8000
|
|
|
|
|
visibility: public
|
|
|
|
|
onOpen: notify
|
|
|
|
|
|
|
|
|
|
vscode:
|
|
|
|
|
extensions:
|
|
|
|
|
- lukashass.volar
|
|
|
|
|
- lextudio.restructuredtext
|
|
|
|
|
- trond-snekvik.simple-rst
|
|
|
|
|
- ms-python.python
|
|
|
|
|
- ms-toolsai.jupyter
|
|
|
|
|
- ms-toolsai.jupyter-keymap
|
|
|
|
|
- ms-toolsai.jupyter-renderers
|