diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..da713458e --- /dev/null +++ b/.circleci/config.yml @@ -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 diff --git a/ex/docker_file b/Dockerfile similarity index 89% rename from ex/docker_file rename to Dockerfile index 9a6c211be..1265da147 100644 --- a/ex/docker_file +++ b/Dockerfile @@ -4,4 +4,4 @@ COPY package.json /dist RUN npm install COPY . /dist CMD node server.js -EXPOSE 4000 \ No newline at end of file +EXPOSE 4000 diff --git a/labreports/LAB_NikMourelatos.md b/labreports/LAB_NikMourelatos.md new file mode 100644 index 000000000..114f82fef --- /dev/null +++ b/labreports/LAB_NikMourelatos.md @@ -0,0 +1,33 @@ +# 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: Nik Mourelatos + +GitHub: [NikMourelatos](https://github.com/NikMourelatos) + +# 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: ```ex: https://cis411lab2-nikmourelatos.herokuapp.com/graphql``` +5. Embed _using markdown_ a screenshot of your successful build and deployment to Heroku of your project. + +[Heroku Deployment](images/Deployment.jpg) + +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? + +Containarized version of apps provide a smoother and more efficient deployment, allowing for all DevOps members to view their own application regardless of the computer/Operating System they have. + +Altogether, using a container allows the DevOps team to control the dependencies of an application, have greater efficiency and consistency in deployment, all while increasing the portability of the application as, in a container, it can be ran from an OS. + +2. If we have the ability to publish directory to Heroku, why involve a CI solution like CircleCI? What benefit does it provide? + +CircleCi is used for continuous integration, meaning all members of DevOps publish their code to CircleCI prior to it going to continous deployment in Heroku. By doing this CircleCi is able to run tests on the published code making sure that it is error free and deployed correctly to our Heroku container. With continuous integration in place we are also able to commit code more often all while having a smaller backlog. + diff --git a/labreports/images/Deployment.jpg b/labreports/images/Deployment.jpg new file mode 100644 index 000000000..b3a65bbeb Binary files /dev/null and b/labreports/images/Deployment.jpg differ 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",