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
65 changes: 65 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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: Install dependencies
command: |
sudo apt-get update
sudo apt-get install -y python3-pip
pip3 install awscli
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
- run:
name: Install doctl
command: |
wget https://github.com/digitalocean/doctl/releases/download/v1.64.0/doctl-1.64.0-linux-amd64.tar.gz
tar xf doctl-1.64.0-linux-amd64.tar.gz
sudo mv doctl /usr/local/bin
rm doctl-1.64.0-linux-amd64.tar.gz
- run:
name: Authenticate with DigitalOcean
command: |
doctl auth init --access-token $OCEAN_API_KEY
doctl kubernetes cluster kubeconfig save mycluster
kubectl config use-context do-myapp
- run:
name: Deploy to DigitalOcean
command: |
kubectl apply -f k8s
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: main
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/images/img.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 assets/images/img_1.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 assets/images/img_2.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 assets/images/img_3.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 assets/images/img_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ex/config_AWS.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1
orbs:
node: circleci/node@5.1.0
docker: circleci/docker@2.2.0
node: .circleci/node@5.1.0
docker: .circleci/docker@2.2.0

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion ex/config_DigitalOcean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:11
- image: .circleci/node:11
steps:
- checkout

Expand Down
4 changes: 2 additions & 2 deletions ex/config_GCP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
orbs:
gcp-gcr: circleci/gcp-gcr@0.6.1
cloudrun: circleci/gcp-cloud-run@1.0.0
gcp-gcr: .circleci/gcp-gcr@0.6.1
cloudrun: .circleci/gcp-cloud-run@1.0.0

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
Expand Down
4 changes: 2 additions & 2 deletions ex/config_Heroku.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:11
- image: .circleci/node:11

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
# - image: .circleci/mongo:3.4.4

working_directory: ~/repo

Expand Down
Empty file added git
Empty file.
44 changes: 44 additions & 0 deletions labreports/LAB_aidan-hubley.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Lab Report: UX/UI
___
**Course:** CIS 411, Spring 2021
**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch)
**Name:** Aidan Hubley
**GitHub Handle:** aidan-hubley
**Repository:** [Forked Repository](https://github.com/aidan-hubley/cis411_lab4_CD)
**Collaborators:** ChatGPT - JDAyers - Statmosphere - jp1579 - 02NRA - rt1252
___

# 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:
> Example: [https://cis411lab4-aidan-hubley-lv2ul.ondigitalocean.app/graphql](https://cis411lab4-aidan-hubley-lv2ul.ondigitalocean.app/graphql)
- [X] Embed _using markdown_ a screenshot of your successful deployed application to Heroku.
> ![Successful Build](../assets/images/img.png)
- [X] Embed _using markdown_ a screenshot of your successful build and deployment to Digital Ocean of your project (with the circleci interface).
> ![Successful Build](../assets/images/img_3.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.

- Fixed Build:
![Successful Build](../assets/images/img_4.png)
- Not sure how I managed to use workflow but here is the build-deploy success

## Questions
1. Why would a containerized version of an application be beneficial if you can run the application locally already?
> Containerizing an application offers several advantages over hosting it locally, such as portability, consistency, scalability, and security. Containers provide a self-contained environment that can be easily moved and scaled across various platforms and environments, making them perfect for modern cloud-native applications.
2. If we have the ability to publish directory to Heroku, why involve a CI solution like CircleCI? What benefit does it provide?
> While Heroku's directory publishing feature is convenient, CircleCI offers benefits such as automation, scalability, and integration that can help streamline the build-test-deploy process. This allows developers to focus more on coding and less on managing the deployment process.
3. Why would you use a container technology over a virtual machine(VM)?
> Containers are a better option than virtual machines because they are more efficient, portable, scalable, and consistent. Unlike virtual machines that need a complete operating system to run each instance, containers share the same OS kernel as the host, making them much faster and lightweight to deploy. This means you can run multiple containers on a single machine without having to install a separate OS for each one, which saves time and resources.
4. What are some alternatives to Docker for containerized deployments?
> Kubernetes, LXC/LXD, rkt, and CRI-O are popular containerization technologies that offer different benefits such as higher-level orchestration, more lightweight containerization, and enhanced security.
### Soucres:
1. [https://chat.openai.com/chat](https://chat.openai.com/chat)
2. [https://docs.docker.com/get-started/overview/](https://docs.docker.com/get-started/overview/)
2. [https://circleci.com/](https://circleci.com/)
3. [https://kubernetes.io/](https://kubernetes.io/)
4. [https://www.redhat.com/en/topics/virtualization/containers-vs-vms](https://www.redhat.com/en/topics/virtualization/containers-vs-vms)
5. [https://www.docker.com/resources/what-container](https://www.docker.com/resources/what-container)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "GitHub and CircleCI building a simple GraphQL service",
"engines": {
"node": "11.x",
"npm": "6.4.1"
"npm": "^6.4.1"
},
"main": "server.js",
"scripts": {
Expand All @@ -30,7 +30,7 @@
"dependencies": {
"express": "^4.16.3",
"express-graphql": "^0.6.12",
"graphql": "^14.0.2",
"graphql": "^0.13.0 || ^14.0.2",
"lokijs": "^1.5.5",
"uuid": "^3.3.2"
},
Expand Down