-
Copy
.env.sampleto a.env -
Install docker onto your machine, if you do not have it.
-
Build dependencies
bash script/deps -
Create and migrate your database with the command:
bash script/migrate. -
Execute
docker-compose upin the root of the repo. This starts the database and phoenix servers. -
(Optional) execute the database seeds with
bash script/seeds. -
Download and install ngrok onto your machine if you do not have it. Execute ngrok with the
PORTthat 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 wherengrokresides and execute it with a prepended./. -
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-notesSlack channel to coordinate development since only one ngrok connection can be live at a time.
- Under
Featureson the left, Navigate toSlash 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
Featureson the left, Navigate toInteractivity & Shortcuts. - Inside the box for
Request URL, paste your ngrok URL and append/captainslog/interaction. - Click
Save Changes.
-
Test to see if everything worked - go into slack and enter the command:
/captainslogdev -
Checkout the database! Run these commands in the root of the repo:
docker-compose exec db psql -U postgres -d release_notes\dtselect * from projects;
Some common errors:
-
Failure to execute
/captainslogdevThis usually means one or two things of the following: a. mix phx.server is not running or had an error- Make sure
mix phx.serverruns 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.
- Make sure
-
Anything asdf related can be a headache so just reach out to
#mojotime-release-notes
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
- change the name of the
.tomlfile based on what env you are deploying to. ex.cp fly.toml.staging fly.toml - Choose the right app to deploy to. See all apps with:
flyctl apps list - 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