- Make changes on a new branch, including a broad category and the ticket number if relevant e.g.
- Push your branch to the remote.
- Make merge requests at https://github.com/helsenorgelab/helsenorgelab.no/compare, setting the 'compare' to your feature branch and the 'base' to
master. Select 'Compare branches and continue'.
- Edit details as necessary.
Setting up a local build
To set up a new build:
git clone https://github.com/helsenorgelab/helsenorgelab.no.git cd helsenorgelab.no vagrant up vagrant ssh
Then within the SSH session:
dj migrate dj createcachetable dj createsuperuser djrun
This will make the site available on the host machine at: http://127.0.0.1:8000/
To build front-end assets you will additionally need to run the following commands in the
npm install npm run build:prod
The static assets should be automatically generated on deployment and you do
not need to commit them. The command used to generate the production version
of static files is
npm run build:prod.
VM should come preinstalled with Fabric, Heroku CLI and AWS CLI.
Login to Heroku
Please log in to Heroku before executing any commands for servers hosted there
heroku login -i command. You have to do it both in the VM and your
host machine if you want to be able to use it in both places.
Authenticate with Dokku
You need to have your SSH key added by a sysadmin to the Dokku server in order to be able to connect to it.
To populate your local database with the content from production:
Additionally, to fetch images and other media.
(This will only take the "original" images. New versions of the other renditions will be recreated on the fly.)
To deploy the site to dev/staging/production:
fab deploy-staging fab deploy-production
Connect to the shell
To open the shell of the servers.
fab staging-shell fab production-shell
Pushing database and media files
Please be aware executing those commands is a possibly destructive action. Make sure to take backups.
If you want to push your local database to the servers.
fab push-staging-data fab push-production-data
Or if you want to push your local media files.
fab push-staging-media fab push-production-media
When you set up a server you should make sure the following scheduled tasks are set.
django-admin publish_scheduled_pages- every 10 minutes or more often. This is necessary to make publishing scheduled pages work.
django-admin clearsessions- once a day (not necessary, but useful).
django-admin update_index- once a day (not necessary, but useful to make sure search index stays intact).
[ ] Configure CI tests? Checkk sample config in .gitlab-ci.yml