Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install heroku CLI on my Mac

  2. Run heroku login to auth heroku CLI on my local machine

  3. Create scihist-digicoll app in heroku dashboard

  4. Provision heroku postgresadd-on. For now we’re going to do a hobby-basic at $9/month, although this won’t be enough for production, we plan a standard-0 at $50/month eventually. https://elements.heroku.com/addons/heroku-postgresql

  5. Import database from our staging instance to our heroku db (https://devcenter.heroku.com/articles/heroku-postgres-import-export)

    1. Do a new export on staging, since heroku asks for a certain format

      1. Tricky cause pg_dump doesn’t live on staging jobs server! Need to figure out how to ssh to database server maybe… ok can find it in EC2 console, and ssh there as jrochkind. Now need to figure out how to connect to database… can’t find database backup cronjob on database server, what user does it run under? not in ansible… but managed to pg_dump using credentials from local_env.yml on staging.

      2. Per heroku instructions, we need to put it on a private S3 bucket. We’ll use chf-hydra-backup, file digcol-for-heroku.dump. (Pretty slow to upload from my local network, figuring out how to put it in private bucket from the database server itself is beyond me right now though)

        1. Having trouble getting a properly signed URL to that location! hackily reverse engineered from S3 console, not the right way, but getting me there.

      3. Succesfully imported! heroku pg:psql -a scihist-digicoll drops me into PSQL console where I can see tables and data to confirm. Deleted extra backup from our S3 bucket.

  6. Try to deploy app to heroku?

    1. add heroku remote to my local git, in local git directory: heroku git:remote -a scihist-digicoll, verify what it did with git remote -v

    2. git push heroku

      1. Asset compilation failed, “TypeError: No value was provided for app_url_base “. We need that local_env config value for asset compilation apparently? (Based on stack trace, cause in order to boot the app, it tries to look it up to set config.action_mailer.default_url_options. We could make that be okay if the value isn’t present…). Anyway, we can add the config var in heroku dashboard to our current heroku non-custom url, APP_URL_BASE=https://scihist-digicoll.herokuapp.com/, and try again.

      2. Failed again cause it needs a local_env solr_url value. I can see this is going to be a slow process of discovering additional ones, as it takes a couple minutes to fail each time. But we’ll try adding a heroku config SOLR_URL=http://localhost/dummy/nonexisting

      3. “Lockbox master key is missing in production.” – there’s a lot of ENV we need just to get assets to compile! Try LOCKBOX_MASTER_KEY=000000000000000000000000000000000000000000000000000000000000000

Mon Oct 5

Heroku has a LOT of docs, usually well-written. It is pretty well googled. Some heroku overview and getting started docs:

...