lab01 : First Production Deployment

num ready? description assigned due
lab01 false First Production Deployment Tue 04/21 04:00PM Fri 04/24 05:59PM

In this group lab, your entire team will collaborate on making a production deployment of your CS48 web app.

The production deployment is the one that should always be running the latest version of the master branch of your repo.

You should NOT do development on the master branch going forward, but instead should use a “feature branch / Pull Request” workflow (we’ll discuss this in lecture).

Step 1: Create Heroku Account (every team member)

Every member of the team will need a Heroku Account.

If you don’t have a Heroku Account yet, please create a Heroku account by logging in at https://heroku.com

Click the “Sign up for Free” link.

You’ll be asked for:

NOTE for folks with existing Heroku Accounts: If you already have a Heroku account on the free tier from CS56, you might need to delete old apps to make space for new ones. There is a limit of five apps on the free tier of Heroku (unless/until you enter a credit card.)

Step 2: Install Heroku CLI (every team member)

CLI stands for Command Line Interface. The Heroku CLI gives you the ability to type heroku as a command at the shell/terminal prompt.

If you haven’t already done so, install the Heroku CLI on your system (it’s already installed on CSIL).

Instructions are here: https://devcenter.heroku.com/articles/heroku-cli

Step 3: Create Heroku App (one team member)

One member of the team should:

Step 4: Add Collaboarators to prod (one team member)

Now go back to the cs48-s20-s0-t0-prod app.

Go to the “Access” tab.

Add each member of your team by the email address they use to login to Heroku.

Then additionally, add these emails as collaborators:

You may, from time-to-time, also find it helpful to add one or more of the LAs as collaborators if you are asking for help with debugging an application problem. This gives us visibility to the logs as well as the values of the “Config Vars”, each of which is helpful in debugging.

Step 5: Add collaborators to qa (two team members)

The person that created the qa app should now

Step 6: Deploy App (another team member)

Now pivot to another team member; not the one that did steps 3,4 or the second half of step 5).

This team member should share their screen and then:

The next step depends on where you are in the process of building your app.

Step 7: Establish a starting point for your app

If you don’t yet have any code for the starting point for your app, here is a way to get started quickly.

Now, it depends on whether your app requires OAuth.

Step 8: Configure OAuth on Production

At this point, you may need to do additional configuration, depending on your tech stack to get the app to come up.

(Note: If your minimum viable product does not require OAuth, then this step might not be necessary.)

Then, proceed to Step 9 to update the Config Vars.

Step 9: Update Config Vars

At this point, you may need to do additional configuration, depending on your tech stack to get the app to come up.

For next.js

For Spring Boot:

Step 10: Your app should now work!

At this point, you shoudl have a working production app.

Visit the apps URL in this table to see if it works.

If it doesn’t, then work as a team to resolve the problem.

team production
s0-t1-budget https://cs48-s20-s0-t1-prod.herokuapp.com
s0-t2-env https://cs48-s20-s0-t2-prod.herokuapp.com
s0-t3-iv-housing https://cs48-s20-s0-t3-prod.herokuapp.com
s0-t4-new-city https://cs48-s20-s0-t4-prod.herokuapp.com
s1-t1-music-queue https://cs48-s20-s1-t1-prod.herokuapp.com
s1-t2-music-queue https://cs48-s20-s1-t2-prod.herokuapp.com
s1-t3-expense https://cs48-s20-s1-t3-prod.herokuapp.com
s1-t4-missile https://cs48-s20-s1-t4-prod.herokuapp.com
s2-t1-care https://cs48-s20-s2-t1-prod.herokuapp.com
s2-t2-free https://cs48-s20-s2-t2-prod.herokuapp.com
s2-t3-slack-bot https://cs48-s20-s2-t3-prod.herokuapp.com
s2-t4-mafia https://cs48-s20-s2-t4-prod.herokuapp.com
s3-t1-accountant https://cs48-s20-s3-t1-prod.herokuapp.com
s3-t2-meal-plan https://cs48-s20-s3-t2-prod.herokuapp.com
s3-t3-poker https://cs48-s20-s3-t3-prod.herokuapp.com
s3-t4-textbooks https://cs48-s20-s3-t4-prod.herokuapp.com

Step 11: Set up the QA app as well

Now repeat these steps so that the QA app also works.

You’ll be able to use the QA app to deploy other branches of your app before accepting pull requests to the master branch.

team qa
s0-t1-budget https://cs48-s20-s0-t1-qa.herokuapp.com
s0-t2-env https://cs48-s20-s0-t2-qa.herokuapp.com
s0-t3-iv-housing https://cs48-s20-s0-t3-qa.herokuapp.com
s0-t4-new-city https://cs48-s20-s0-t4-qa.herokuapp.com
s1-t1-music-queue https://cs48-s20-s1-t1-qa.herokuapp.com
s1-t2-music-queue https://cs48-s20-s1-t2-qa.herokuapp.com
s1-t3-expense https://cs48-s20-s1-t3-qa.herokuapp.com
s1-t4-missile https://cs48-s20-s1-t4-qa.herokuapp.com
s2-t1-care https://cs48-s20-s2-t1-qa.herokuapp.com
s2-t2-free https://cs48-s20-s2-t2-qa.herokuapp.com
s2-t3-slack-bot https://cs48-s20-s2-t3-qa.herokuapp.com
s2-t4-mafia https://cs48-s20-s2-t4-qa.herokuapp.com
s3-t1-accountant https://cs48-s20-s3-t1-qa.herokuapp.com
s3-t2-meal-plan https://cs48-s20-s3-t2-qa.herokuapp.com
s3-t3-poker https://cs48-s20-s3-t3-qa.herokuapp.com
s3-t4-textbooks https://cs48-s20-s3-t4-qa.herokuapp.com

Step 12: Submit on Gauchospace

Submission on Gauchospace is per group

You should be assigned on Gauchospace to a group that matches your project group.

If you are not, please contact the instructor.

Only one submission per group is needed, but each group member is responsible to make sure that a submission for the group has been made.

I recommend taking a screen shot of the submission and posting it to the group’s slack channel so that everyone can be confident that it was done.

To submit, visit: https://gauchospace.ucsb.edu/courses/mod/assign/view.php?id=3821278&forceview=1

Useful hints

next.js

If someone configured the .env values for your app and did a npx heroku-dotenv push --app cs48-s20-s0-t0-prod to push those values, other members of your team can also do npx heroku-dotenv pull --app cs48-s20-s0-t0-prod to load those values into their .env file