Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
992f186
new file: labreports/LAB_jrmakr2123.md
jrmakr2123 Mar 21, 2023
568f2ad
Create config.yml
jrmakr2123 Mar 21, 2023
69bd391
updated lab report
jrmakr2123 Mar 21, 2023
8392f10
updated my lab report
jrmakr2123 Mar 21, 2023
65f9502
updated my lab report
jrmakr2123 Mar 21, 2023
89d3ca3
updated my lab report
jrmakr2123 Mar 21, 2023
5eb8923
Add or update the Azure App Service build and deployment workflow config
jrmakr2123 Mar 22, 2023
a4a2ec8
Add or update the Azure App Service build and deployment workflow config
jrmakr2123 Mar 22, 2023
630d95c
deleted: .github/workflows/purelab_cis411lab4-jrmakr2123.yml
jrmakr2123 Mar 22, 2023
3987a83
modified: package.json
jrmakr2123 Mar 23, 2023
e0f89e6
modified: .gitignore
jrmakr2123 Mar 23, 2023
0005c76
modified: Dockerfile
jrmakr2123 Mar 23, 2023
6a49f11
modified: Dockerfile
jrmakr2123 Mar 23, 2023
8cf2b7a
updated my lab report
jrmakr2123 Mar 23, 2023
db82f70
new file: assets/digital ocean app.png
jrmakr2123 Mar 23, 2023
0830fda
modified: .circleci/config.yml
jrmakr2123 Mar 23, 2023
84f6d0e
updated my lab report
jrmakr2123 Mar 23, 2023
0f11904
new file: assets/digital ocean circleci test.png
jrmakr2123 Mar 23, 2023
72950a1
renamed: ex/LAB_INSTRUCTIONS_DigitalOcean.md -> LAB_INSTRUCTIONS_…
jrmakr2123 Mar 23, 2023
decf72e
modified: LAB_INSTRUCTIONS_DigitalOcean.md
jrmakr2123 Mar 23, 2023
692b42a
modified: .gitignore
jrmakr2123 Mar 23, 2023
0393439
Delete package-lock.json
jrmakr2123 Mar 23, 2023
6ce7a56
modified: .circleci/config.yml
jrmakr2123 Mar 28, 2023
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
46 changes: 46 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 Main to Digital Ocean
command: |
git push https://heroku:$OCEAN_API_KEY@git.OCEAN.com/$OCEAN_APP_NAME.git main

workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: purelab
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:11
WORKDIR /dist
COPY package.json /dist
RUN npm install
RUN npm install --force
COPY . /dist
CMD node server.js
EXPOSE 4000
28 changes: 16 additions & 12 deletions LAB_INSTRUCTIONS_DigitalOcean.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ Lab reports will be submitted by
4. Install Docker on your development environment, either for [Mac](https://docs.docker.com/docker-for-mac/install/), [Windows](https://docs.docker.com/docker-for-windows/install/), or various Linux distributions.
> If you have Windows Home Edition, then you should following these [instructions](ex/Docker_Installation_Win10_Home.md) to navigate the system requirements.
5. [Sign up for an account on Docker Hub](https://hub.docker.com/) and keep track of your username and password (You'll need that later).
6. [Sign up for a Heroku](https://signup.heroku.com) account. Make sure that you get the Heroku for GitHub Students (https://www.heroku.com/github-students) or be prepared to pay. (You'll need that later too).
7. [Download and install the Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli#download-and-install).

6. [Sign up for Digital Ocean](https://www.digitalocean.com).

# Step 1: Fork and clone this repository
1. After logging in, navigate to the [root](https://github.com/trevordbunch/cis411_lab4_CD) of this repository.
Expand Down Expand Up @@ -128,7 +126,7 @@ EXPOSE 4000
> git push
```

# Step 4: Push docker desktop file to docker hub
<!-- # Step 4: Push docker desktop file to docker hub
Docker desktop is different than docker hub, you must push your image to your docker hub account. Do the following from git cli:
1. Tag your image
```docker tag your-local-image your-docker-hub-username/repository-name:tag```<br>
Expand All @@ -138,20 +136,26 @@ Docker desktop is different than docker hub, you must push your image to your do
```docker push your-docker-hub-username/repository-name:tag``` <br>
Example
```docker push rt1252/lab4:tag```
3. Go to [docker hub](https://hub.docker.com/repositories) and view your repo.
3. Go to [docker hub](https://hub.docker.com/repositories) and view your repo. -->


# Step 5: Setup a Digital Ocean application
# Step 4: Setup a Digital Ocean application
There are _lots_ of solutions for providing a CD endpoint including AWS, Google Cloud, Azure, Digital Ocean, etc. For the purposes of this assignment, we're going to use **Digital Ocean** for one reason: it's _relatively_ easy. They provide $200 free credits which must be used in 60 days.

1. Login to Digital Ocean through the web interface and go to manage, apps, create app, docker hub, type in the repo (example: rt1252/lab4), enter 'tag' for tag, click next.
2. Edit any setting such as name if you like.
3. Wait for service to deploy.
4. Click the live app button and append /graphql to the end. You will see graphql running!
1. Login to Digital Ocean through the web interface.
2. Go to manage, apps, create app.
3. Choose github and select your repository and branch; click next.
4. On the Resources page, delete the Lab4-cd2 web service. This is a node compiling service that is generated with your docker web service (Lab4-cd). For this lab we only need the docker service.
![Part to Delete](./assets/digitalOcean_webService_Setup.png)
5. Edit any setting such as **name** if you like.
6. Wait for service to deploy.
7. Click the live app button. You will see an error like _Cannot GET /_.
8. **Append /graphql to the end. You will see graphql running!**

![Live Application](assets/digitalOcean_success.png)
5. **Include this URL in your lab report.**
1. **Include this URL in your lab report.**

# Step 6: Configure CircleCI for CD to Digital Ocean
# Step 5: Configure CircleCI for CD to Digital Ocean

1. From the menu on the digital ocean homepage scroll to the bottom and click API.
2. Name the token and click generate, copy the token.
Expand Down
Binary file added assets/digital ocean app.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/digital ocean circleci test.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/digitalOcean_webService_Setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions labreports/LAB_Template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lab Report: UX/UI
# Lab Report: Continuous Deployment
___
**Course:** CIS 411, Spring 2021
**Course:** CIS 411, Spring 2023
**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch)
**Name:** Your Name
**GitHub Handle:** Your GitHub Handle
Expand All @@ -19,6 +19,7 @@ ___
> Example: ![Successful Build](../ex/trevordbunch_lab2_01.png)
- [ ] Embed _using markdown_ a screenshot of your successful build and deployment to Heroku of your project (with the circleci interface).
> Example: ![Successful Build](../ex/trevordbunch_lab2_02.png)
- [ ] Copy your mutation from your graphql instance here:
- [ ] Answer the **4** questions below.
- [ ] Submit a Pull Request to cis411_lab4_CD and provide the URL of that Pull Request in Canvas as your URL submission.

Expand Down
53 changes: 53 additions & 0 deletions labreports/LAB_jrmakr2123.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Lab Report: Continuous Deployment
___
**Course:** CIS 411, Spring 2023
**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch)
**Name:** Jonah Robinson
**GitHub Handle:** [jrmakr2123](https://github.com/jrmakr2123)
**Repository:** [Continuous Development](https://github.com/jrmakr2123/cis411_lab4_CD)
<!-- **Collaborators:** -->
___

# 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-jrmakr2123-u4el5.ondigitalocean.app/graphql](https://cis411lab4-jrmakr2123-u4el5.ondigitalocean.app/graphql)
- [x] Embed _using markdown_ a screenshot of your successful deployed application to Digital Ocean.
> ![Successful Build](./../assets/digital%20ocean%20app.png)
- [x] Embed _using markdown_ a screenshot of your successful build and deployment to Digital Ocean of your project (with the circleci interface).
> Example: ![Successful Build](./../assets/digital%20ocean%20circleci%20test.png)

<!-- You may want to consider adding this here professor -->

- [x] Copy your mutation from your graphql instance here:
~~~
{
"data": {
"mutateAccount": {
"id": "dd6073cc-2118-4927-8e34-9b369a8d781f",
"name": "Jonah Robinson",
"email": "jr1521@messiah.edu"
}
}
}
~~~
- [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?
> By having a containerized version of an application, the development team can run the same tests on the same containerized hardware. The application may be able to run with no errors on one computer, but on another it may not run. Containers make it possible for developers to have the same set of hardware to make changes.
2. If we have the ability to publish directory to Digital Ocean, why involve a CI solution like CircleCI? What benefit does it provide?
> Where a continuous Integration program like CircleCI would help developers compile, test, and maintain usable code, Continuous Delivery would help developers deliver new codes and programs for more testing in more realistic situations. Were CI would be more focused on creating usable code, CD is more interested in delivering and monitoring that code for future fixes.
3. Why would you use a container technology over a virtual machine(VM)?
> Container technology interfaces with the kernel thus not requiring an additional license to run. In virtual machine instances, licensing is required for each additional virtual machine. Another reason is that container technology does not require as much resources as virtualization. Containerization focusses on using what the computer is already giving in kernel manipulation thus allowing for a faster and lightweight running process. Virtualization focusses on partitioning a certain amount of computer resources. In doing so everything is recopied and ran through a compatibility layer. To get the performance of a container in a virtual machine the virtual machine would need more resources than the container would need in the first place.
4. What are some alternatives to Docker for containerized deployments?
> Some alternatives to docker are . . .
> - Hyper-V Containers,
> - Containerd,
> - Kubernetes,
> - RunC,
> - Buildah,
> - and many more options for developers.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"devDependencies": {
"nyc": "^15.1.0"
}
}
}