john-hu / untitled

0 stars 0 forks source link

auto deployment - silver plate #55

Closed john-hu closed 2 years ago

john-hu commented 2 years ago

depends on #47

john-hu commented 2 years ago

The flow could be

  1. to use git pull from a specific github branch, production
  2. check the version hash from the file and the latest commit of production branch
  3. if the hash is different, do the followings:
    1. copy ~/recipe to `/opt/silverplate{hash}/
    2. move /opt/silver_plate/version to /opt/silver_plate_{hash}/old_version
    3. create version file /opt/silver_plate_{hash}/version with the hash as its content
    4. run python manage.py collectstatic for build static files
    5. run python manage.py migrate for update DB if we need it.
    6. run python manage.py runscript create_schema --script-args http://localhost:8983/ recipe for update cutting board schema
    7. relink /opt/silver_plate to `/opt/silverplate{hash}
    8. remove /opt/silver_plate_{old_hash}
john-hu commented 2 years ago

deployed to AWS