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
67 changes: 67 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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: purelab
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/MyScreenShots/CircleCiSuccess.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/MyScreenShots/DigitalOceanAppSuccess.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/MyScreenShots/Graphql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions labreports/LAB_JDAyres.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Lab Report: UX/UI
___
**Course:** CIS 411, Spring 2021 <br>
**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch) <br>
**Name:** Justin Ayres <br>
**GitHub Handle:** JDAyres<br>
**Repository:** https://github.com/JDAyres/cis411_lab4_CD <br>
**Collaborators:** Batman works alone...
___

# 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: [https://cis411lab4-jdayres-srn5x.ondigitalocean.app/graphql](https://cis411lab4-jdayres-srn5x.ondigitalocean.app/graphql)
- [x] Embed _using markdown_ a screenshot of your successful deployed application to DigitalOcean.
![Successful Build](../assets/MyScreenShots/DigitalOceanAppSuccess.png)
- [x] Embed _using markdown_ a screenshot of your successful build and deployment to DigitalOcean of your project (with the circleci interface).
![Successful Build](../assets/MyScreenShots/CircleCiSuccess.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?
> There are a few reasons why a containerized version of an application would be more beneficial than a locally run application: <br>
> * Containers encapsulate all dependencies and configurations, ensuring a consistent environment across different stages of the development pipeline and between different team members.
> * Containers are lightweight and start up faster than traditional virtual machines, making them ideal for scaling and deploying applications quickly.
> * They enable easy deployment on various platforms, as long as the platform supports container technology (e.g., Kubernetes, AWS ECS, Google Kubernetes Engine).
> * Containers help in implementing microservices architecture, which can improve application maintainability and scalability.
2. If we have the ability to publish directory to DigitalOcean, why involve a CI solution like CircleCI? What benefit does it provide?
> There are a few reasons as to why we should involve a CI solution like CircleCI even when we have the ability to publish a directory to DigitalOcean:
> * CircleCI tests your code before deployment with automated testing, which helps reduce risk of sending out broken code to consumers.
> * CircleCI allows you to build and test multiple branches, commits, and pull requests concurrently, this can help speed up the development process and improve resource utilization.
> * CircleCI lets you integrate with a wide range of tools and services, which enables you to automate additional tasks such as notifications, artifact storage, and performance monitoring.
> * CircleCI allows you to create custom workflows that define the steps, dependencies, and conditions for your build and deployment process. This flexibility allows you to tailor the CI/CD process to your project's specific needs.
3. Why would you use a container technology over a virtual machine(VM)?
> There are a number of advantages to using containers over virtual machines, here are some:
> * Resource efficiency: Containers share the host OS kernel and utilize resources more efficiently than VMs, which run a full OS stack for each instance.
> * Startup speed: Containers start up faster than VMs, as they don't require booting an entire OS.
> * Portability: Containers encapsulate dependencies, making it easy to deploy applications consistently across different environments.
> * Easier management and orchestration: Container orchestration tools like Kubernetes make it easier to manage, scale, and maintain containerized applications compared to VM-based deployments.
4. What are some alternatives to Docker for containerized deployments?
> * Podman, is a daemonless container engine for developing, managing, and running OCI Containers on Linux systems.
> * rkt (also known as Rocket), is a security-minded, standards-based container engine developed by CoreOS, now an archived project.
> * LXD, A system container manager that offers a VM-like experience with the performance and resource efficiency of containers.
> * OpenVZ, is a container-based virtualization solution for Linux, focused on running multiple, isolated Linux instances on a single host.
> * Singularity, A container platform designed for use in high-performance computing and enterprise performance computing environments, with a focus on security and reproducibility.