diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..f221a8fdf --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,24 @@ +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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9a6c211be --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:11 +WORKDIR /dist +COPY package.json /dist +RUN npm install +COPY . /dist +CMD node server.js +EXPOSE 4000 \ No newline at end of file diff --git a/HerokuDeployment.png b/HerokuDeployment.png new file mode 100644 index 000000000..0a6804118 Binary files /dev/null and b/HerokuDeployment.png differ diff --git a/SS-configyml.png b/SS-configyml.png new file mode 100644 index 000000000..cb7b63fd9 Binary files /dev/null and b/SS-configyml.png differ diff --git a/labreports/LAB_wesleycqy.md b/labreports/LAB_wesleycqy.md new file mode 100644 index 000000000..5f3859019 --- /dev/null +++ b/labreports/LAB_wesleycqy.md @@ -0,0 +1,28 @@ +# Lab Report Template for CIS411_Lab2 +Course: Messiah College CIS 411, Spring 2020 + +Instructors: [Joel Worrall](https://github.com/tangollama) & [Trevor Bunch](https://github.com/trevordbunch) + +Name: Wesley Chong + +GitHub: [wesleycqy](https://github.com/wesleycqy) + +# 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. +For my .circleci/config.yml file, it does not reflect in my finder. I am not sure if that is a problem, but I know for sure it does exist because it is there when I work with my Terminal. (Eg. If I "cd .circleci" and then "open config.yml", the config.yml file opens for me to populate.) +![configymlScreenshot](../SS-configyml.png "configymlScreenshot") +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: ```http://cis411lab2-wesleycqy.herokuapp.com/graphql``` +5. Embed _using markdown_ a screenshot of your successful build and deployment to Heroku of your project. +![HerokuDeployment](../HerokuDeployment.png "Heroku Deployment") +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? +Just because it is running on my machine and system does not mean it will run on another computer's machine and system. A containerized version allows all machines to access and run an application regardless of OS or system. + +2. If we have the ability to publish directory to Heroku, why involve a CI solution like CircleCI? What benefit does it provide? +To constantly check if the code that wants to be published actually is compatible with the code already in Heroku. If not, people would be pushing code that possibly does not work which would be very bad. diff --git a/package-lock.json b/package-lock.json index 485e285fb..f72acc3a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2857,6 +2857,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -3181,7 +3182,8 @@ "is-buffer": { "version": "1.1.6", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "is-builtin-module": { "version": "1.0.0", @@ -3265,6 +3267,7 @@ "version": "3.2.2", "bundled": true, "dev": true, + "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -3311,7 +3314,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "lru-cache": { "version": "4.1.3", @@ -3577,7 +3581,8 @@ "repeat-string": { "version": "1.6.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "require-directory": { "version": "2.1.1",