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
55 changes: 55 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: 2.1
orbs:
node: circleci/node@5.1.0
docker: circleci/docker@2.2.0
aws-cli: circleci/aws-cli@3.1.1

jobs:
test:
executor: node/default
steps:
- checkout
- node/install-packages:
pkg-manager: yarn
- run:
command: yarn test
name: Run tests
build-and-push:
executor: docker/docker
steps:
- setup_remote_docker
- checkout
- docker/check
- docker/build:
image: ${DOCKER_LOGIN}/lab4
tag: latest
- docker/push:
digest-path: /tmp/digest.txt
image: ${DOCKER_LOGIN}/lab4
tag: latest

deploy:
machine:
enabled: true
steps:
- checkout
- run:
name: Connect and deploy through SSH
no_output_timeout: 30s
command: ssh -o "StrictHostKeyChecking no" ec2-user@${AWS_DOMAIN} "
sudo service docker start;
bash script.sh;"

workflows:
lab4-CICD-pipeline:
jobs:
- test
- build-and-push:
requires:
- test
- deploy:
requires:
- build-and-push
filters:
branches:
only: main
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:15
WORKDIR /dist
COPY package.json /dist
RUN npm uninstall graphql
RUN npm install express express-graphql
RUN npm install graphql
COPY . /dist
CMD node server.js
EXPOSE 4000
9 changes: 9 additions & 0 deletions Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:15
WORKDIR /dist
COPY package.json /dist
RUN npm uninstall graphql
RUN npm install express express-graphql
RUN npm install graphql
COPY . /dist
CMD node server.js
EXPOSE 4000
Binary file added labreports/Images/AWS_Running.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/Images/Real Success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions labreports/LAB_xzepiora.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Lab Report: CD
___
**Course:** CIS 411, Spring 2023

**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch)

**Name:** Xavier Zepiora

**GitHub Handle:** xzepiora

**Repository:** https://github.com/xzepiora/cis411_lab4_CD

**Collaborators:** Ray Truex (rt1252) Mike Shoul (mshoul)
___

# 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: http://ec2-18-117-10-161.us-east-2.compute.amazonaws.com:4000/graphql

- [x] Embed _using markdown_ a screenshot of your successful deployed application to AWS.
![AWS Deployment](Images/AWS_Running.png)


- [x] Embed _using markdown_ a screenshot of your successful build and deployment to AWS of your project (with the circleci interface).
![CircleCI Deployment](Images/Real%20Success.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?
> A containerized version of an application can be helpful because containers do not require operating systems to be the same. This allows people with different OSs to run a program with no problem. So while locally you might be able to run it no problem when it is running for someone else there might be issues. Containers fix this problem.
2. If we have the ability to publish directory to AWS, why involve a CI solution like CircleCI? What benefit does it provide?
> CircleCI allows for continuous integration as implied by the name. This process of integration means that everytime there is a change you do not need to restart the cloud provider the CI will do the change automatically. This is great in todays industry in which services constantly need to be up. CIs make it much easier to accomplish that.
3. Why would you use a container technology over a virtual machine(VM)?
> A big reason to use a container over a VM is that they are a lot less resource intensive. They also do not require their own OS to run. Each VM needs to be on an OS while containers do not need that and they work across all OSs.
4. What are some alternatives to Docker for containerized deployments?
> Kubernetes, Podman, LXC/LXD, Singularity, and Containerd. All of these have very similar functionalities to Docker but are specialized for different things. When picking a service it is important to know what you want out of your container.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "GitHub and CircleCI building a simple GraphQL service",
"engines": {
"node": "11.x",
"node": "18.x",
"npm": "6.4.1"
},
"main": "server.js",
Expand All @@ -28,9 +28,9 @@
},
"homepage": "https://github.com/trevordbunch/cis411_lab4_CD#readme",
"dependencies": {
"express": "^4.16.3",
"express": "^4.18.2",
"express-graphql": "^0.6.12",
"graphql": "^14.0.2",
"graphql": "^16.6.0",
"lokijs": "^1.5.5",
"uuid": "^3.3.2"
},
Expand Down