Skip to content

Latest commit

 

History

History
72 lines (45 loc) · 3.46 KB

File metadata and controls

72 lines (45 loc) · 3.46 KB

Getting a dev instance running

  1. Copy .env.sample to a .env

  2. Install docker onto your machine, if you do not have it.

  3. Build dependencies bash script/deps

  4. Create and migrate your database with the command: bash script/migrate.

  5. Execute docker-compose up in the root of the repo. This starts the database and phoenix servers.

  6. (Optional) execute the database seeds with bash script/seeds.

  7. Download and install ngrok onto your machine if you do not have it. Execute ngrok with the PORT that is configured as an enviornment variable: ngrok http <PORT>. This starts the ngrok reverse proxy so that way we can get the slack bot working over the web. Depending on how you've installed ngrok, you may have to navigate to the directory on your machine where ngrok resides and execute it with a prepended ./.

  8. Open up your Slack app dev dashboard. For Captains Log Dev, this is the current one. If you do not know what this is, you should ask a teammate to add you to it or create a new slack app yourself. NOTE: reach out to the #mojotime-release-notes Slack channel to coordinate development since only one ngrok connection can be live at a time.

  • Under Features on the left, Navigate to Slash Commands.
  • Edit the command the command /captainslogdev.
  • Inside the box for Request URL, paste your ngrok URL and append /captainslog/modal.
  • Click save. You should get redirected back to the home page for the app.
  • Under Features on the left, Navigate to Interactivity & Shortcuts.
  • Inside the box for Request URL, paste your ngrok URL and append /captainslog/interaction.
  • Click Save Changes.
  1. Test to see if everything worked - go into slack and enter the command: /captainslogdev

  2. Checkout the database! Run these commands in the root of the repo:

  • docker-compose exec db psql -U postgres -d release_notes
  • \dt
  • select * from projects;

Troubleshooting

Some common errors:

  1. Failure to execute /captainslogdev This usually means one or two things of the following: a. mix phx.server is not running or had an error

    • Make sure mix phx.server runs successfully b. ngrok is not properly configured with the dashboards
    • Make sure ngrok is running on the same port as the phoenix server.
    • Make sure your alack app dashboards are configured to your ngrok urls.
  2. Anything asdf related can be a headache so just reach out to #mojotime-release-notes

fly.io

This app is deployed on fly.io

Ask a teammate about getting access to the Mojotech fly.io account.

Install flyctl here

Follow this guide to sign into flyctl

See this guide on how to deploy to fly.io

NOTE: Before deploying, you need to

  1. change the name of the .toml file based on what env you are deploying to. ex. cp fly.toml.staging fly.toml
  2. Choose the right app to deploy to. See all apps with: flyctl apps list
  3. use the -a flag to specify the target app name

Input enviornment variables into config/runtime.exs to use on fly.io

Update enviornment variable values with: flyctl secrets set ENV_NAME=value

Remove enviornment variable values with: flyctl secrets unset ENV_NAME=value