A global guide to improvised comedy
1.8K
These instructions will get you started as a developer.
Create a file at ~/.secret/uk_improv_guide.sh. It should contain the following content, but change the paaswords as appropriate for you:
#! /bin/bash
export POSTGRES_PASSWORD=abc1aa
export SLACK_WEB_HOOK=http://example.com
export PRODUCTION_SECRET="dsfdsdffsdfsf"
The password and production secrets can be any random text.
Run the development "up" script:
./up_dev.sh
This will install all of the components and start the containers. Next you can load some content:
./restore.sh
This installs a snapshot of production data into the locally running app.
When you install Git, make sure you set it to "Check out as is, Commit UNIX-style"
Just do all of the above in a Git Bash session.
Get rid of your firewall. Most Windows firewalls are incompatible with Docker.
Login to adminer. Use these login credentials:
~/.secret/uk_improv_guide.sh file.Execute this SQL inside Adminer:
DO $$ DECLARE
tabname RECORD;
BEGIN
FOR tabname IN (SELECT tablename
FROM pg_tables
WHERE schemaname = current_schema())
LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(tabname.tablename) || ' CASCADE';
END LOOP;
END $$;
After you drop the tables you will have to do one of the following before you can run the ./restore.sh script:
./up_dev.sh, or./migrate.shDropping tables is not extreme enough for you? This is the nuclear option:
CTRL-C if you have a your docker-compose console live../kill_and_remove.sh to ensure that all the containers have stopped.docker volume ls to list all the docker volumesdocker volume rm uk_improv_guide_postgres_data./up_dev.shIf you are starting from a brand-new database, run the ./up_dev.sh script to create the tables and authentication data.
Next, start a docker shell in another window:
./shell.sh
From within the shell enter the following command:
python manage.py createsuperuser
If you see an error like this: django.db.utils.ProgrammingError: relation "auth_user" does not exist the chances are that your superuser account was created. Just try to login.
it's possible that the database is in a state incompatible with the restore data. The simplest way to fix this is to wipe the database and then re-populate it.
sal@gruntyman:~/workspace/uk_improv_guide$ ./kill_and_remove.sh
a0401d6747b9
b23f274401fa
db107b245e11
0d43601de0b8
a52a73aee288
sal@gruntyman:~/workspace/uk_improv_guide$ ./up_dev.sh
Removing network uk_improv_guide_internal
Creating network "uk_improv_guide_internal" with the default driver
Creating postgres ... done
Creating uk_improv_guide_dev_1 ... done
Creating dev_adminer ... done
Creating uk_improv_guide_python_1 ... done
Content type
Image
Digest
Size
48.9 MB
Last updated
about 7 years ago
docker pull salimfadhley/uk_improv_guide