erlef / infra-wg

ErlEF infrastructure working group
6 stars 1 forks source link

document the way we update the website #6

Closed benoitc closed 3 years ago

benoitc commented 4 years ago

document on the website how to update website

starbelly commented 4 years ago

@benoitc Currently we are still on gigalixir. Gigalixir uses a git based deploy system ala heroku. This is also what is planned to be built out on vultr, but a much simpler version based around our use case. But, without going into all that right now let me go over the current flow.

  1. PRs come into erlef/website, they get approved and merged
  2. Depending on the change we might deploy the changes to a staging instance on gigalixir first to test out the changes.
  3. Finally, we deploy to our production instance on gigalixr.

In terms of commands and assuming you have access to the gigalixir account and have added it to your local clone as a git remote:

$ cd erlef/website
$ git pull
$ git push gigalixir-staging master
$ gigalixir run  /app/bin/erlef eval "Erlef.Release.migrate" -a name_of_staging_app

The above assumes there is a database migration to be run, I have a local script that just does all of this for me and assumes there is for every deploy. If the above went well on staging, then we deploy to prod in the same manor:

Now if everything went smoothly:

$ cd erlef/website
$ git pull
$ git push gigalixir master
$ gigalixir run  /app/bin/erlef eval "Erlef.Release.migrate" -a name_of_production_app

Note that gigalixr-staging is a git remote that points to the gigalixir staging instance, likewise gigalixir is the git remote for the production instance. Documentation on configuring this may be found here :

https://gigalixir.readthedocs.io/en/latest/

It should also be noted sometimes we will have custom release tasks. These would be defined in lib/erlef/release.ex and executed like the migration task, we don't have any yet defined though.

Likewise there is also a release task to perform database rollbacks:

 gigalixir run  /app/bin/erlef eval "Erlef.Release.rollback" -a instance_name

As stated, we are still supposed to move to vultr and I had planned on us keeping basically the same git based deploy system, since it's simple (just git hooks that build a release on the remote).

We should probably start making use of releases/tags on github or at least better use of a production branch.

benoitc commented 4 years ago

Thanks. ok i reckon i wasn't totally clear about it (wanted to sync with you first). The main goal of the ticket following our last zoom is to document how we can add a page or a section to the website and maintain it.

Documenting this will allows people to help the foundation to maintain the website

benoitc commented 3 years ago

superseded by #50. we still need it imo.