diff --git a/profile/essentials/devAndProd/devAndProd.md b/profile/essentials/devAndProd/devAndProd.md index 1d2e77eb..4707db76 100644 --- a/profile/essentials/devAndProd/devAndProd.md +++ b/profile/essentials/devAndProd/devAndProd.md @@ -1,6 +1,6 @@ # Development and production environments -When working on a commercial web application, it is critical to separate where you develop your application, from where the production release of your application is made publicly available. Often times there are more environments than this, such as staging, internal testing, and external testing environments. If your company is seeking third party security certification (such as SOC2 compliance) they will require that these environments are strictly separated from each other. A developer will not have access to the production environment in order to prevent a developer from nefariously manipulating an entire company asset. Instead, automated integration processes, called continuous integration (`CI`) processes, checkout the application code, [lint it](https://www.freecodecamp.org/news/what-is-linting-and-how-can-it-save-you-time/), build it, test it, stage it, test it more, and then finally, if everything checks out, push the application to the production environment, and notify the different departments in the company of the release. +When working on a commercial web application, it is critical to separate where you develop your application, from where the production release of your application is made publicly available. Often times there are more environments than this, such as staging, internal testing, and external testing environments. If your company is seeking third party security certification (such as SOC2 compliance) they will require that these environments are strictly separated from each other. A developer will not have access to the production environment in order to prevent a developer from nefariously manipulating an entire company asset. Instead, automated integration processes, called continuous integration (`CI`) processes, checkout the application code, [lint it](https://www.freecodecamp.org/news/what-is-linting-and-how-can-it-save-you-time/), build it, test it, stage it, test it more, and then finally, if everything checks out, **deploy** the application to the production environment, and notify the different departments in the company of the release. ![Complex deployment](essentialsDeploymentComplex.jpg) @@ -8,9 +8,9 @@ For our work, you will use and manage both your _development environment_ (your ![Simple deployment](essentialsDeploymentSimple.jpg) -## Deployment +## Automating your deployment -_Deployment_ means making your code available for use (nearly always using continuous integration). The advantage of using an automated deployment process is that it is reproducible. You don't delete a file, or misconfigure something with an accidental keystroke. Also, having a automated script encourages you to iterate quickly because it is so much easier to deploy your code. You can add a small feature, deploy it out to production, and get feedback within minutes from your users. +The advantage of using an automated deployment process is that it is reproducible. You don't accidentally delete a file, or misconfigure something with an stray keystroke. Also, having a automated script encourages you to iterate quickly because it is so much easier to deploy your code. You can add a small feature, deploy it out to production, and get feedback within minutes from your users. Our deployment scripts change with each new technology that we have to deploy. Initially, they just copy up a directory of HTML files, but soon they include the ability to modify the configuration of your web server, run transpiler tools, and bundle your code into a deployable package. diff --git a/profile/essentials/git/git.md b/profile/essentials/git/git.md index ca3de89c..4e6ebe40 100644 --- a/profile/essentials/git/git.md +++ b/profile/essentials/git/git.md @@ -58,7 +58,7 @@ Untracked files: nothing added to commit but untracked files present (use "git add" to track) ``` -`git status` tells you that it detects a new file named `hello.txt`, but it isn't currently tracking versions for that file. To begin tracking versions you need to add it. Usually you track all files in a repository directory and so you can tell Git to track everything that it doesn't know about with `git add .` (don't forget the period). Follow this with another call to `git status`. +`git status` tells you that it detects a new file named `hello.txt`, but it isn't currently tracking versions for that file. To begin tracking versions you need to add it. Usually you track all files in a repository directory and so you can tell Git to track everything that it doesn't know about with `git add .`. Make sure you include the period at the end of the command. Follow the add command with another call to `git status` in order to see what the repo looks like now. ```sh ➜ git add . @@ -84,9 +84,9 @@ On branch master nothing to commit, working tree clean ``` -Congratulations! You have just committed your first file to a Git repository. It is important to note that we were only working with a single file in this example. However, a commit can represent multiple files. You just need to add them all before you execute the commit. Also, note that the point of the stage (`git add`) step, is so that you can commit some files while still leaving other modified files out of the commit. Only files you've staged will be committed. +Congratulations! You have just committed your first file to a Git repository. It is important to note that we were only working with a single file in this example. However, a commit can represent multiple files. You just need to add them all before you execute the commit. Also, note that the point of the stage, `git add` step, is so that you can commit some files while still leaving other modified files out of the commit. Only files you've staged will be committed. -Let's make an edit to our file and commit it again. This time we will tell Git that we want to add all the tracked modified files to our commit (without having to `git add` them again) by including the `-a` parameter along with our message parameter. +Let's make an edit to our file and commit it again. This time we will tell Git that we want to add all the modified tracked files to our commit, without having to `git add` them again, by including the `-a` parameter along with our message parameter. ```sh ➜ echo goodbye world > hello.txt @@ -131,7 +131,7 @@ HEAD is now at d43b07b initial draft hello world ``` -The above output omits a big message saying that you are no longer looking at the latest version, but the important thing is that you can see that we are now looking at our old version. (Careful: commits made here can do funky things.) To get back to the top of the version chain, use the `checkout` command and reference the branch name, which is by default `master`. +The above output omits a big message saying that you are no longer looking at the latest version, but the important thing is that you can see that we are now looking at our old version. Note that you don't want to make commits at this point since it will create a branch that is not for the latest code. To get back to the top of the version chain, use the `checkout` command and reference the branch name, which is by default `master`. ```sh ➜ git checkout master diff --git a/profile/essentials/gitHub/gitHub.md b/profile/essentials/gitHub/gitHub.md index 04203e03..00c1b09b 100644 --- a/profile/essentials/gitHub/gitHub.md +++ b/profile/essentials/gitHub/gitHub.md @@ -15,7 +15,7 @@ GitHub was launched in 2008 by a small group of developers that wanted to make c We are going to use GitHub for three things. 1. Hosting all of this instruction. Because it is hosted on GitHub you can generate pull requests when you see things that need improvement. -1. Publicly hosting your project repositories. This creates a backup copy of your code, demonstrates your progress with your commit history, allows for reviews of your code, and makes it so you can collaborate with your peers. (It also looks good on a resume!) +1. Publicly hosting your project repositories. This creates a backup copy of your code, demonstrates your progress with your commit history, allows for reviews of your code, and makes it so you can collaborate with your peers. It also looks good on a resume! 1. Keeping notes about what you have learned and things you want to remember. ## Creating a GitHub account @@ -24,13 +24,13 @@ If you do not already have a GitHub account then go and [create one now](https:/ ## Creating and cloning a repository -While you can create a repository in your development environment using `git init` and then connect it to an upstream repository on GitHub, it is always easier to create your repository first on GitHub and then clone it to your development environment. That way your local repository and the GitHub repository are automatically linked to each other. +While you can create a repository in your development environment using `git init` and then connect it to an upstream repository on GitHub, it is always easier to create your repository first on GitHub and then clone it to your development environment. That way your local repository and your GitHub repository are automatically linked to each other. To create a repository in GitHub, log into your account, select the `Repositories` tab, and press `New repository`. You then specify a unique repository name, give a description, indicate that you want it to be public, add a default README.md file, and choose a license. ![GitHub create repository](essentialsGitHubCreateRepo.jpg) -Every repository in GitHub has a unique URL assigned to it. Assuming the repository is public, anyone with the URL can clone it to their development environment. A repository clone is an exact copy of the repository including all of the commits, comments, and SHAs. It also configures the clone to know what the remote source is (in this case, your GitHub repository) so that you can use Git commands to keep them in sync as changes are made. +Every repository in GitHub has a unique URL assigned to it. Assuming the repository is public, anyone with the URL can clone it to their development environment. A repository clone is an exact copy of the repository including all of the commits, comments, and SHAs. It also configures the clone to know what the remote source is so that you can use Git commands to keep them in sync as changes are made. In this case, the remote source is the GitHub repository. ![GitHub clone](essentialsGitHubClone.jpg) @@ -175,7 +175,7 @@ You will also create another Markdown file named `notes.md` to track what you ha ## Forks -A GitHub fork provides the ability to create a copy of a GitHub repository. Usually you [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) to get a copy of an open source code base that you want to experiment with, or contribute to (such as these instuctions). A fork is similar to cloning a repository to your development environment, but it clones to GitHub instead. Then pull the fork down to your development environment to work on it. The fork maintains a link to the upstream (original) repository that allows you to easily pull down updates and merge them with your fork. A fork also allows you to create a pull request in order to push suggested changes to the original repository. +A GitHub fork provides the ability to create a copy of a GitHub repository. Usually you [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) to get a copy of an open source code base that you want to experiment with, or contribute to. For example, the repository containing these instructions. A fork is similar to cloning a repository to your development environment, but it clones to GitHub instead. Then pull the fork down to your development environment to work on it. The fork maintains a link to the upstream (original) repository that allows you to easily pull down updates and merge them with your fork. A fork also allows you to create a pull request in order to push suggested changes to the original repository. If you have never forked a repository before you should go find an open source project that interests you. For example, here is the [Dad Jokes API](https://github.com/DadJokes-io/Dad_Jokes_API). This simple web service provides an endpoint to get a joke. Consider forking this repository in order to experiment with how it works. Don't worry too much about what the code is doing. That will make more sense as the class goes on. @@ -190,7 +190,7 @@ It would be awesome if we can increase the fork count for `Dad Jokes API` into t - [GitHub Pull Requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) - [GitHub pulls from forks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) -GitHub allows you to create a fork of any repository on GitHub. You just push the `Fork` button from the repository's GitHub page. You can then make modifications to the repository fork and push the changes as a "pull request." This notifies the original repository's owner that a request is being made to enhance the original repository. The owner can review your changes and if appropriate commit the changes into the original. This is how open source communities manage development from a volunteer group of global developers. +GitHub allows you to create a fork of any repository on GitHub. You just push the `Fork` button from the repository's GitHub page. You can then make modifications to the repository fork and push the changes as a _pull request_. This notifies the original repository's owner that a request is being made to enhance the original repository. The owner can review your changes and if appropriate commit the changes into the original. This is how open source communities manage development from a volunteer group of global developers. In this class, if you notice something in the instruction that needs to be enhanced, feel free to fork the repo, and make a pull request. This will give you experience with this practice and improve the instruction for others at the same time. Plus your name will be included as a contributor. How cool is that! @@ -198,13 +198,13 @@ In this class, if you notice something in the instruction that needs to be enhan Do the following steps to set up your `Startup application repository` in GitHub and clone it to your development environment. -#### Set up your startup repository +### Set up your startup repository 1. Create a GitHub account if you do not already have one. 1. Create a repository, named `startup`, for your startup application. Your project must be public. Select the option for a default README.md file. This is where you will also keep all of your notes for things that you learn and want to remember. 1. Clone the repository to your development environment, by getting the repository's URL, and using `git clone`. -#### Practice using Git and resolving conflicts +### Practice using Git and resolving conflicts 1. Open up the repository directory in VS Code and create a file named `conflictTest.md`. Add some text to the file. 1. Use the Git functionality of VS Code to add `conflictTest.md` to Git, commit your changes, and push them to GitHub. @@ -215,7 +215,7 @@ Do the following steps to set up your `Startup application repository` in GitHub 1. Attempt to pull the GitHub changes to your development environment. Note and resolve the merge conflict. Commit the merged changes. Push the merge commit. 1. On GitHub observe the resolved merge. -#### Create your notes.md +### Create your notes.md 1. Read the GitHub documentation about the basics of [writing markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax). 1. Create a file in your repository called `notes.md`. You can use the contents of this file while taking the midterm and final exam. As you modify your `notes.md` file throughout the class. Make sure that you keep it organized and clean. You can add multiple `.md` files and reference them from your `notes.md` file in order make it easier to organize your content.