Skip to content

CMU-17-356/dronuts2022-group2

Repository files navigation

dronut

DEPLOYED AT https://dronuts-frontend-344820.de.r.appspot.com/drones (don't refresh or our database will die)

Run frontend app

From the /frontend directory:

npm start

Run server

From the root directory:

npm start

Run tests

From the root directory:

npm test

Run linter

From the root directory:

npm run lint
  1. Because NodeJS projects have many dependencies, it is massively beneficial to use a tool to detect dependency updates and alert you as to potential vulnerabilities. Normally, we would recommend using a SaaS tool like GreenKeeper or requires.io. However, if you're repository is private, these tools require payment. If that's the case, you should install npm-check.

    Success Condition:

    $ npm-check
    > ❤️  Your modules look amazing. Keep up the great work. ❤️
    

Docker

  1. Although Docker should already be configured (see Dockerfile and docker-compose.yml) as necessary, you may need to install the Docker Daemon on your machine to properly complete the assignment. Read the get-started guide for downloading Docker locally. If you're on a Linux OS, starting here would be more helpful. MAKE sure you do not install docker via snap. Snap's version of docker is outdated

Deployment

  1. You should have received an email about signing-up/accepting a assignment/lab from Microsoft, related to the class and registering with azure. Let us know if you haven't. We recommend using the Azure Cli to access your account info.

  2. Using your Azure credentials, follow these instructions to manually setup a Virtual Machine suitable for running Docker with the following considerations:

  • Instead of myvm use your project team name as your Docker Machine name.

  • Use "Standard_A1_v2" as the plan name / VM size.

  • Before running docker-create (creating your VM), make sure to additionally add the flag/option --azure-resource-group cmu-17-356 when running the command.

  • The full command you'll run should look something like this:

    docker-machine create -d azure \
    --azure-subscription-id $sub \
    --azure-ssh-user azureuser \
    --azure-open-port 80 \
    --azure-resource-group cmu-17-356 \
    --azure-size "Standard_A1_v2" \
    $repository_name
  • stop before the step "run a container".

  • Copy the IP address of your VM and your $repository_name (i.e. project/machine-name) into your Github Actions .yml

  • If you've set that ENV var, Run cp -r "$DOCKER_CERT_PATH" ./azureto copy your deployment certificates into your repository. Otherwise, you can run cp -r ~/.docker/machine/machines/$repository_name/* ./azure

This should enable automatic deployment via Github Actions!