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
45 changes: 45 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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 Master to Heroku
command: |
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master

workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
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 assets/screenshot_builddeploy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions labreports/LAB_tannerstern.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Lab Report Template for CIS411_Lab2
Course: Messiah College CIS 411, Fall 2018

Instructors: [Joel Worrall](https://github.com/tangollama) & [Trevor Bunch](https://github.com/trevordbunch)

Name: Tanner Stern

GitHub: [tannerstern](https://github.com/tannerstern)

# Required Content

1. Generate a markdown file in the labreports directoy named LAB_[GITHUB HANDLE].md. Write your lab report there.
2. Create the directory ```./circleci``` and the file ```.circleci/config.yml``` in your project and push that change to your GitHub repository.
3. 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.
4. Write the URL of your running Heroku app here: https://cis411lab2-tannerstern.herokuapp.com/graphql
5. Embed _using markdown_ a screenshot of your successful build and deployment to Heroku of your project.
![Build and Deploy](../assets/screenshot_builddeploy.png)
6. Answer the questions below.
7. Submit a Pull Request to cis411_lab2 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?
* Containterizing the application allows us to strictly and standardly define the environment in which the application is to run. While a local instance of the application will work, you cannot guarantee a consistent environment each time you build or deploy it.
* A containerized version of an application can also be made to simulate the delivery endpoint. If you are testing on a Windows machine but the system the application will eventually be deployed on is Linux-based, how can you tell if it will work as epxected? With a container, we have that kind of control.
2. If we have the ability to publish directory to Heroku, why involve a CI solution like CircleCI? What benefit does it provide?
* Continuous Integration (CI) has the end-goal of improving software quality. When you have multiple developers (or even just one) working on multiple parts of the code-base, you introduce the possibility for bugs and errors that affect other parts of the system. Git helps to coordinate versioning efforts, but it does not solve this problem. Hence, a CI solution like CircleCI is needed to automate testing across multiple stages of development. With CI, errors are detected quickly and can be solved before they are pushed out to production.
11 changes: 8 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions tutorial/Docker_Installation_Win10_Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Docker Installation on Windows 10 Home
Written by Tanner Stern<br>
GitHub: [tannerstern](https://github.com/tannerstern/)<br>
Last updated: 04/07/2020

Sources: [hessi9's post](https://forums.docker.com/t/installing-docker-on-windows-10-home/11722/25) and [mapk's post](https://forums.docker.com/t/installing-docker-on-windows-10-home/11722/29) on the [Installing Docker on Windows 10 Home discussion](https://forums.docker.com/t/installing-docker-on-windows-10-home/11722/)

# Pre-Installation Notes
* Follow these instructions **in order** because the order matters
* Pay attention to **details**; this is not a hard tutorial to follow, but it is complicated
* If you run into problems, do not despair! Contact the professor and patiently troubleshoot

# Step 1: Install Hyper-V and Container
1. Save and close any open documents or projects
* Your computer will restart multiple times throughout this installation
1. Download [hyperv.bat](hyperv.bat) and [containers.bat](containers.bat)
* Instructions for downloading:
1. Follow one of the links above
1. Click "Raw" on the right side of the page
1. On the page that appears, right-click and "Save Page As..."
1. In the dialog that appears, navigate to your desired folder and add **.bat** to the end of the file name
1. Save the file and repeat the process for the other file
* Put them in an easily accessible folder
* These files are Windows Batch files. They will install Windows Components necessary to make Docker run.
* If you get a warning from **Windows Smartscreen**, click "More info" and then "Run anyway." This is your computer recognizing these files as downloaded from the internet and being cautious about running them.
1. Right-click on the **hyperv.bat** and select "Run as administrator"
* The command prompt will open
* You will see several progress bars flash in the window
* This installation will take a few minutes
1. When prompted, type **y** to restart your computer
* This prompt will appear in the command prompt after the batch file runs
1. When the restart is completed, do the same for **container.bat**
* Remember to right-click and "Run as administrator"
* When prompted, type **y** to restart your computer

# Step 2: Make Registry Changes
1. Note: Be **very careful** in this next section
* Editing the Windows registry is like performing open-heart surgery
* Follow these directions exactly and make **only** those changes described here
* **Do not** restart your computer until this tutorial is over (as a precaution)
1. Open the Windows registry editor tool
* This can be done by clicking the Start button and typing "regedit" or searching for "Registry Editor"
1. Navigate to **\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion**
* Use the folder tree on the left side of the window
* When you get to **CurrentVersion**, make sure you have clicked on (selected) the CurrentVersion **folder** and not one of its subfolders
1. Find the **EditionID** key
* After you have selected **CurrentVersion**, you will see keys and values on the right side of the window
* The keys are arranged alphabetically by default
1. Right-click and "Modify..." the EditionID; change it from "Core" to "Professional"
* The initial value of the key should be "Core"
* We want to change this value to "Professional" (case-sensitive)
* We will undo this change after we install Docker
1. Click "OK" but leave the Registry Editor window open

# Step 3: Install Docker
1. If you haven't already, download the Docker [installer](https://www.docker.com/products/docker-desktop)
1. Run the installer as you would any other installer
* The default settings are fine
* If you encounter any errors that reference "Hyper-V" or "Containers" as missing, you might have missed something in Step 1. Go back and check.
* If you encounter any errors that reference how you need Windows Pro, you might have missed something in Step 2. Go back and check.
1. The installer will notify you when it has installed successfully
* You are almost done!
1. Go back to the Registry Editor and **change EditionID back to "Core"**
* This is a very important step, do not skip it!
* Make sure you click "OK" and close the Registry Editor when you are done

# Final Notes
* Docker can take a long time to start up, so if it seems like it is not opening, be patient
* Docker may be running after the installation
* You can tell if Docker is running by looking at your system tray
* This is the area of your taskbar by the clock (bottom-right)
* Docker might be hidden; click the arrow to expand the tray to see all icons
6 changes: 6 additions & 0 deletions tutorial/containers.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause
6 changes: 6 additions & 0 deletions tutorial/hyperv.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause