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
53 changes: 24 additions & 29 deletions labreports/LAB_INSTRUCTIONS.md → LAB_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
# CIS 411 Lab 0: GitHub + CircleCI
The purpose of this lab is to both impart/confirm a level of professional comfort working with tools like GitHub and CircleCI as well as to invite a student to consider what precisely is happening conceptually and actually (behind the scenes) in the execution of the lab.
# Lab Instructions

## Submitting work
Lab reports will be submitted by generating a markdown file in the labreports directory under the naming convention: **LAB_[GITHUB HANDLE].md**, and submitting a Pull Request to this repository that include your lab report as well as any accompanying images/files (there are diagrams required in the lab content).

* Throughout these instructions, you'll find that **items marked in bold text** reference content you are to submit in your lab report.
* For the purposes of clear communication, you may base your lab report off of the template found in [LAB.md](LAB.md), but you're also free, welcome, and encouraged to get more creative.
* If you are unfamiliar with markdown, I recommend checking [1000 places on the Interwebs](http://lmgtfy.com/?q=learn+markdown) that will help you close that gap.

# Step 0: Create a GitHub account++
## Step 0: Create a GitHub account++
1. If you don't have a GitHub account already, [create one](https://github.com/join). If you do, **record the name of your handle in your lab report** and **record a link to one repository you either follow or star**.
2. If you don't already have _git_ installed on your development machine, [do so](https://git-scm.com/downloads).
3. Install a text editor or some sort of application for local development. Lately, I'm partial to [Visual Studio Code](https://code.visualstudio.com/) and my instructions assume it's use, but you're welcome to diviate. _Each one should choose their own sword, etc. etc._
4. To run the project in Step 2, you'll need to have [node.js](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/cli/install) installed.

# Step 1: Fork this repository
1. After logging in, navigate to the [root](https://github.com/tangollama/cis411_lab0) of this repository.
## Step 1: Fork this repository
1. After logging in, navigate to the [purelab branch root](https://github.com/trevordbunch/cis411_lab1_CI/tree/purelab) of this repository.
2. Fork this repository to your personal GitHub account (hint: read the page).
3. **Record the URL to your forked repo in your lab report.**
4. **Generate a simple diagram** (in Google Draw or your favorite diagramming tool) that demonstrates the relationship between _this_ repository and my account (tangollama) with your account and your newly forked repository. (i.e. Is this the same thing as a source control branch or is there something unique about a fork in a distributed version control system? _Hint... I'm asking for a reason._ If it's helpful, think about the relationship you and another student who is conducting the fork command each has to this respository.)
4. **Generate a simple diagram** (in Google Draw or your favorite diagramming tool) that demonstrates the relationship between _this_ repository and my account (trevordbunch) with your account and your newly forked repository. (i.e. Is this the same thing as a source control branch or is there something unique about a fork in a distributed version control system? _Hint... I'm asking for a reason._ If it's helpful, think about the relationship you and another student who is conducting the fork command each has to this respository.)

# Step 2: Clone your forked repository from the command line
## Step 2: Clone your forked repository from the command line
1. Navigate to your forked repository in your GitHub account and copy the reference to your repository in from the <button class="btn btn-sm btn-primary">Clone or Download</button> button.
2. Open the terminal or command line interface on your development machine, navigate to your chosen working directory, and execute the following command: ```git clone [YOUR COPIED GITHUB CLONE REFERENCE]```.
3. Navigate to that directory ```cd cis411_lab0```.
2. Open the terminal or command line interface on your development machine, *navigate to your chosen working directory*, and execute the following command: ```git clone [YOUR COPIED GITHUB CLONE REFERENCE]```.
3. Navigate to that directory ```cd cis411_lab1_CI```.

## Step 3: Run the application locally
1. If you haven't already - make sure that you have installed [node.js](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/cli/install)
4. Run ```npm install``` and watch the magic happen.
5. Run ```npm start``` and navigate to http://localhost:4000/graphql.
6. Run the following GraphQL mutation in GraphiQL and **record the response**.
Expand All @@ -41,18 +36,18 @@ mutation {
}
```

# Step 3: Creating a feature branch
## Step 4: Creating a feature branch
[Branching and merging](https://www.atlassian.com/agile/software-development/branching) is a common tactic used in change management and feature development. We're going to use a branch (and eventually a merge) to build our lab report.
1. Create the branch ```git checkout -b labreport```.
2. Create a lab report mardown file (ex. ```cp labreports/LAB.md labreports/LAB_[GITHUB USERNAME].md``` ).
2. Create a lab report mardown file (ex. ```cp labreports/LAB_Template.md labreports/LAB_[GITHUB USERNAME].md``` ).
3. Add your lab report ```git add *```
4. Add the file to your branch ```git commit -a -m "your commit and reference @tangollama in the message"```.
4. Add the file to your branch ```git commit -a -m "your commit and reference @trevordbunch in the message"```.
5. Push the change to GitHub ```git push -u origin labreport```.
6. As you make additional changes to the lab report, commit and push at least one more change to the branch.
7. **Add the output of your git commit log** for your feature branch to your lab report ```git log --oneline```.
8. **Generate a simple diagram** that demonstrates the relationship between your master and feature branch in your forked repository.
8. **Generate a simple diagram** that demonstrates the relationship between your main and feature branch in your forked repository.

# Step 4: Setup a Continuous Integration configuration
## Step 5: Setup a Continuous Integration configuration
1. [Signup for CircleCI](https://circleci.com/signup/) with your GitHub account.
2. Login to CircleCI and add your project to your account (ex. https://circleci.com/add-projects/gh/[YOUR_GITHUB_HANDLE]) by clicking _Add Project_.
3. Follow the setup instructions, including creating the .circleci directory and adding the default config.yml file.
Expand All @@ -65,21 +60,21 @@ mutation {
- When a CI build is successful, what does that philosophically and practically/precisely indicate about the build?
- If you were to take the next step and ready this project for Continuous Delivery, what additional changes might you make in this configuration (conceptual, not code)?

# Step 5: Merging the feature branch
## Step 6: Merging the feature branch
1. Commit your changes to your feature branch ```git commit -a -m "your commit message```.
2. Switch to the master branch ```git checkout master```.
2. Switch to the main branch ```git checkout main```.
3. Merge the changes from your feature branch ```git merge labreport```.
4. **Add the output of your git commit log** from master to your lab report ```git log --oneline```.
4. **Add the output of your git commit log** from main to your lab report ```git log --oneline```.
5. Validate that your CircleCI build is running doing so successfully, **by grabbing a screenshot of the _Jobs_ list in CircleCI and including it in your report**.

# Step 6: Submitting a Pull Request
Once you've completed your report markdown, have ensured that your forked repository is successfully running in CircleCI, and have committed all your changes to your (primary) master branch, initiate a Pull Request in GitHub to submit your Lab Report.
1. Navigate to the root of your forked repository (ex. https://github.com/YOURHANDLE/cis411_lab0).
## Step 7: Submitting a Pull Request
Once you've completed your report markdown, have ensured that your forked repository is successfully running in CircleCI, and have committed all your changes to your (primary) main branch, and `push` your updated main branch back to Github, and then initiate a Pull Request in GitHub to submit your Lab Report.
1. Navigate to the root of your forked repository (ex. https://github.com/YOURHANDLE/cis411_lab1_CI).
2. Click the _New pull request_ button.
3. Choose the base fork _tangollama/cis411_lab0_ is the target and that your fully updated _master_ branch is the source.
3. Choose the base fork _trevordbunch/cis411_lab1_ is the target and that your fully updated _main_ branch is the source.
4. Enter a title and description for the Pull Request (PR), **referencing at least one other student in the content via their GitHub handle**, and submit the PR.

# Step 7: [EXTRA CREDIT] Augment the core project
# Step 8: [EXTRA CREDIT] Augment the core project
For the purposes of gaining 10%, 20% _or even more extra credit_ on the assignment, perform any of the following:
1. Add one or more unit tests to the core assignment project.
2. Configure the CircleCI config.yml to automatically build a Docker image of the project.
Expand Down
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,46 @@
# cis411_lab0
GitHub and CircleCI building a simple GraphQL service
# CIS 411 Lab 1: Continuous Integration
This is the Requirements Lab for CIS 411: Systems Analysis and Design for [Messiah University](http://messiah.edu)

This lab has four purposes:
1. Within Systems Analysis and Design, you are going to need to articulate a DEVOPs process that includes **Continuous Integration (CI)**, practice of merging all developers' working copies to a shared mainline several times a day,[^1] and be able to describe what is conceptually happening behind the scenes.
2. Develop a comfort using CI tools, such as CircleCI.
3. Read installation requirements to get a system running locally, so that you learn how to contribute and test locally.
4. To ensure that you are only accepting code that works within your repository, you will apply knowledge of spinning up a local environment into CI test condition.

# Doing the Lab
- Here's the [link to the lab instructions](labreports/LAB_INSTRUCTIONS.md).
- Here's the [link to the lab template](labreports/LAB.md).
## 1. Pre-Requisites
1. GitHub account
2. Git is installed on your development machine.
3. Text editor or other integrated development environment (IDE) for modifying code.
4. Install [node.js](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/cli/install) (STEP 3 in the Lab Instructions).
5. CircleCI account (STEP 5 in the Lab Instructions)

## 2. Lab Description
Within this lab, you will need to fork a repository that has a simple node / graphql application. After confirming that you can successfully run and perform simple actions within the applicaiton, then you will configuration CircleCI to perform a test that the application did not break with any changes in the commit before allowing the code into the repository.

Detailed instructions are [here](labreports/LAB_INSTRUCTIONS.md), and you are expected to compile your findings into a labreport following this [template](labreports/LAB_TEMPLATE.md).

## 3. Submissions
You are expected to create a lab report as a markdown file under the labreports directory using the **LAB_[GITHUB Handle].md** naming convention in your forked repository. After you have reviewed your work, then you should submit a `Pull Request` to this repository with your lab report and any accompanying images/files (e.g., required diagrams). Add the `Pull Request` URL into the courseroom LMS (Canvas) for grading.

# Resources
Lab Specific Help.
- [Detailed instructions](LAB_INSTRUCTIONS.md)
- [Lab template](labreports/LAB_Template.md)

Node
- Node Download [https://nodejs.org/en/download/](https://nodejs.org/en/download/)
- Node Package Manager [https://docs.npmjs.com/cli/install](https://docs.npmjs.com/cli/install)
- Checking Node Versions [https://docs.npmjs.com/downloading-and-installing-node-js-and-npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)

Footnotes
[^1]: Fowler, M. C*ontinuous Integration.* Retrieved from https://martinfowler.com/articles/continuousIntegration.html

CircleCi
- [CircleCI Documentation](https://circleci.com/docs/)
- [Writing YAML](https://circleci.com/docs/2.0/writing-yaml/)
# License
This content is provided under the `MIT` [license](LICENSE).

Go forth and follow the instructions!
# Credits
Special thanks to Joel Worrall, aka [tangollama](https://github.com/tangollama), for co-developing this course and writing the original version of this lab [https://github.com/tangollama/cis411_lab0](https://github.com/tangollama/cis411_lab0).
Binary file added assets/circleci_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 0 additions & 58 deletions labreports/LAB.md

This file was deleted.

79 changes: 79 additions & 0 deletions labreports/LAB_Template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Lab Report: Continuous Integration
___
**Course:** CIS 411, Spring 2021
**Instructor(s):** [Trevor Bunch](https://github.com/trevordbunch)
**Name:** Your Name
**GitHub Handle:** Your GitHub Handle
**Repository:** Your Forked Repository
___

# Step 1: Fork this repository
- The URL of my forked repository: ENTER URL HERE
- The accompanying diagram of what my fork precisely and conceptually represents...

# Step 2: Clone your forked repository from the command line
- My local file directory is...
- The command to navigate to the directory when I open up the command line is...

# Step 3: Run the application locally
- My GraphQL response from adding myself as an account on the test project
``` json
{
"data": {
"mutateAccount": {
"id": "5c345bb5-0c54-44ae-8e57-f5f00b0eddbb",
"name": "TREVOR BUNCH",
"email": "[email protected]"
}
}
}
```

# Step 4: Creating a feature branch
- The output of my git commit log
```
Insert the logs here.
```
- The accompanying diagram of what my feature branch precisely and conceptually represents...

# Step 5: Setup a Continuous Integration configuration
- What is the .circleci/config.yml doing?


- What do the various sections on the config file do?


- When a CI build is successful, what does that philosophically and practically/precisely indicate about the build?


- If you were to take the next step and ready this project for Continuous Delivery, what additional changes might you make in this configuration (conceptual, not code)?


# Step 6: Merging the feature branch
* The output of my git commit log
```
Trevors-MBP:cis411_lab0 trevorbunch$ git log --oneline
dbf826a (HEAD -> labreport, origin/labreport) Answer Step 4
a9c1de6 Complete Step 1, 2 and 3 of LAB_TREVORDBUNCH
1ead543 remove LAB.md
8c38613 Initial commit of labreport with @tangollama
dabceca (upstream/main, origin/main, origin/HEAD, main) Merge pull request #24 from tangollama/circleci
a4096db Create README.md
...
44ce6ae Initial commit
(END)
```

* A screenshot of the _Jobs_ list in CircleCI
![CircleCI Success](../assets/circleci_success.png)

# Step 7: Submitting a Pull Request
_Remember to reference at least one other student in the PR content via their GitHub handle._



# Step 8: [EXTRA CREDIT] Augment the core project
PR reference in the report to one of the following:
1. Add one or more unit tests to the core assignment project.
2. Configure the CircleCI config.yml to automatically build a Docker image of the project.
3. Configure an automatic deployment of the successful CircleCI build to an Amazon EC2 instance.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cis411_lab0",
"name": "cis411_lab1_CI",
"version": "0.0.1",
"description": "GitHub and CircleCI building a simple GraphQL service",
"main": "server.js",
Expand All @@ -9,7 +9,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/tangollama/cis411_lab0.git"
"url": "git+https://github.com/trevordbunch/cis411_lab1_CI.git"
},
"keywords": [
"git",
Expand All @@ -20,9 +20,9 @@
"author": "Joel Worrall <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/tangollama/cis411_lab0/issues"
"url": "https://github.com/trevordbunch/cis411_lab1_CI/issues"
},
"homepage": "https://github.com/tangollama/cis411_lab0#readme",
"homepage": "https://github.com/trevordbunch/cis411_lab1_CI#readme",
"dependencies": {
"express": "^4.16.3",
"express-graphql": "^0.6.12",
Expand Down