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
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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:
working_directory: ~/repo
docker:
- image: circleci/node:11
steps:
- checkout
- run:
name: Configure Github credentials
command: |
git config user.email $GITHUB_EMAIL
git config user.name $GITHUB_USERNAME
- add_ssh_keys:
fingerprints:
- $GITHUB_FINGERPRINT
- run:
name: Deploy to Azure Web App Using Azure Container Registry Task
command: npm run deploy
workflows:
version: 2
build:
jobs:
- build
- deploy:
requires:
- build # only deploy once build job has completed
filters:
branches:
only: purelab # only deploy on the main branch
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
Binary file added labreports/1st_succesful_build.png
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 labreports/1st_successful_build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions labreports/LAB_BenOfTheOneRing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Lab Report: UX/UI
___
**Course:** CIS 411, Spring 2021
**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch)
**Name:** Ben Clarke
**GitHub Handle:** BenOfTheOneRing
**Repository:** [My Forked Repository](https://github.com/BenOfTheOneRing/cis411_lab4_CD.git)
**Collaborators:** Mike Shoul, Grace Taylor via Pull request
___

# 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:
[Azure URL](https://labcd4app.azurewebsites.net/graphql)
- [x] Embed _using markdown_ a screenshot of your successful deployed application to Azure.
![Successful Build](1st_successful_build.png)
- [x] Embed _using markdown_ a screenshot of your successful build and deployment to Azure of your project (with the circleci interface).
![Successful Deployment](build_2.png)
- [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?

> Because containerized applications contain all of their own data and app/file versions. This way if two devs have different versions of npm, git, or some other necessary file or service, those differences do not leak into errors with the app if the app is deployed to a different environment.
2. If we have the ability to publish directory to Heroku, why involve a CI solution like CircleCI? What benefit does it provide?
> It checks for errors and makes sure the app can actually run. This saves valuable time in troubleshooting, and also acts as a fail-safe in-case a dev accidentally sends a broken build to the deployed server. CircleCI would block that type of dangerous deployment.
3. Why would you use a container technology over a virtual machine(VM)?
> Because a virtual machine, while it would stop your personal device from being harmed from errors, would still have environments that would most likely not match with every user's systems and environments. If an app fully contains its own dependencies then it does not matter what device it is used on.
4. What are some alternatives to Docker for containerized deployments?
> Cloud Foundry, Containerd, CoreOS rkt, Kubernetes
33 changes: 0 additions & 33 deletions labreports/LAB_Template.md

This file was deleted.

Binary file added labreports/build_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"main": "server.js",
"scripts": {
"run": "node server.js",
"test": "exit 0"
"test": "exit 0",
"deploy" : "npx gh-pages -b deploy --message '[skip ci] Updates' -d ./"
},
"repository": {
"type": "git",
Expand All @@ -35,6 +36,7 @@
"uuid": "^3.3.2"
},
"devDependencies": {
"gh-pages": "^5.0.0",
"nyc": "^15.1.0"
}
}