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 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
45 changes: 45 additions & 0 deletions labreports/LAB_JostonChan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Lab Report Template for CIS411_Lab2
Course: Messiah College CIS 411, Fall 2020

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

Name: Joston Chan

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

# 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.
![GraphQL.png](image/GraphQL.png)
![CircleCi.png](image/CircleCi.png)

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.
![Docker.png](image/Docker.png)

4. Write the URL of your running Heroku app here: ```http://cis411lab2-jostonchan.herokuapp.com/graphql``` (Heroku does not allow capitalized letters so I can't my GitHub handle, `JostonChan`, so I use `jostonchan`.)
![Heroku.png](image/Heroku.png)

5. Embed _using markdown_ a screenshot of your successful build and deployment to Heroku of your project.
![HerokuSuccess.png](image/HerokuSuccess.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?

A containerized version of an application is more beneficial than running it locally because if we build more than one application, the container isolates an application from the host system and from other applications. Not only that, a container provides a consistent environment that allows developers to spend less time debugging the application and more time on creating new functionalities for its users.

2. If we have the ability to publish directory to Heroku, why involve a CI solution like CircleCI? What benefit does it provide?

CircleCI provides continuous integration and continuous deployment of a program. CircleCI test codes that we committed and deem whether the codes are failures or success. If the codes fails, CircleCi prevent the deployment of the program and will allow deployment if it is a success. This relieves developers of their stress of committing new codes to the program because CircleCI provides a layer of security testing. Thus, this helps ensure the integrity of a program and pinpoint errors.

## Error in Lab instructions:
For the Heroku section, the URL should be

http://cis411lab2-[GITHUB_HANDLE].herokuapp.com/graphql

not

http://[GITHUB_HANDLE].herokuapp.com/graphql
Binary file added labreports/image/CircleCi.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/image/Docker.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/image/GraphQL.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/image/Heroku.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/image/HerokuSuccess.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading