Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:11
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: yarn test
deploy:
docker:
- image: buildpack-deps:trusty
steps:
- checkout
- run:
name: Deploy Main to Digital Ocean
command: |
git push https://heroku:$OCEAN_API_KEY@git.OCEAN.com/$OCEAN_APP_NAME.git main
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: main
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:11
WORKDIR /dist
COPY package.json /dist
RUN npm install
COPY . /dist
CMD node server.js
EXPOSE 4000
2 changes: 1 addition & 1 deletion LAB_INSTRUCTIONS_DigitalOcean.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ EXPOSE 4000
5. Build and run the Docker image using the following commands from _within_ the cis411_lab4_CD directory:
```
> docker build -t lab4 .
> docker run -p 4000:4000 lab4 &
> docker run -p 4000:4000 lab4
```
> Tip: the period (`.`) at the end of the command is important!
6. Navigate to http://localhost:4000/graphql and verify that you can access GraphQL.
Expand Down
Binary file added assets/CircleCI.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/GraphQL.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions labreports/LAB_jp1478.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Lab Report: UX/UI
___
**Course:** CIS 411, Spring 2023
**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch)
**Name:** Joshua Phillips
**GitHub Handle:** jp1478
**Repository:** https://github.com/jp1478/cis411_lab4_CD
**Collaborators:** 02NRA, aidan-hubley
___

# Required Content

- [x] Generate a markdown file in the labreports directory named LAB_[GITHUB HANDLE].md. Write your lab report there.
- [x] Create the directory ```./circleci``` and the file ```.circleci/config.yml``` in your project and push that change to your GitHub repository.
- [x] Create the file ```Dockerfile``` in the root of your project and include the contents of the file as described in the instructions. Push that change to your GitHub repository.
- [x] Write the URL of your app hosted on Heroku or other Cloud Provider here:
> [https://cis411lab4-jp1478-os7gv.ondigitalocean.app/graphql](https://cis411lab4-jp1478-os7gv.ondigitalocean.app/graphql)
- [x] Embed _using markdown_ a screenshot of your successful deployed application to Digital Ocean.
> Example: ![Successful Build](../assets/GraphQL.JPG)
- [x] Embed _using markdown_ a screenshot of your successful build and deployment to Heroku of your project (with the circleci interface).
> Example: ![Successful Build](../assets/CircleCI.JPG)
- [x] Answer the **4** questions below.
- [x] Submit a Pull Request to cis411_lab4_CD and provide the URL of that Pull Request in Canvas as your URL submission.

## Questions
1. Why would a containerized version of an application be beneficial if you can run the application locally already?
> Containers allow the application to be run in any environment.
> [checkpoint.com](https://www.checkpoint.com/cyber-hub/cloud-security/what-is-container-security/what-is-containerization/#:~:text=Containerization%20is%20a%20type%20of,and%20highly%20conducive%20to%20automation.)
2. If we have the ability to publish directory to Heroku (Digital Ocean), why involve a CI solution like CircleCI? What benefit does it provide?
> It automates the process of testing and deployment by automatically running a series of tests and deploying to Digital Ocean if the tests succeed. This can catch nonfatal errors as well as errors in multiple branches.
> [circleci.com](https://circleci.com/why-circleci/)
3. Why would you use a container technology over a virtual machine(VM)?
> Containers are less resource intensive than VMs, making them easier to create and destroy, and you can use more of them at a time.
> [diva-portal.org](https://www.diva-portal.org/smash/get/diva2:1412070/FULLTEXT01.pdf)
4. What are some alternatives to Docker for containerized deployments?
> Alternatives include Cloud Foundry, Containerd, CoreOS rkt, Hyper-V Containers, and more. Docker can only run on Linux systems, so one of these alternatives may be preferable for a Windows or Mac-OS system.
> [simplilearn.com](https://www.simplilearn.com/docker-alternatives-article)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"express": "^4.16.3",
"express-graphql": "^0.6.12",
"graphql": "^14.0.2",
"graphql": "^0.13.0 || ^14.0.2",
"lokijs": "^1.5.5",
"uuid": "^3.3.2"
},
Expand Down