ltong2 / dataplatform-devops-exercises

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exercise Repository for Database DevOps Training

This is the repository for all class related exercises.

Forking this repository

To get started, create a copy of this repository by forking it to your own GitHub account. To do that, follow these steps:

  1. Sign in to your own GitHub account.

  2. Open the original repository in your browser.

    image
  3. Click the Fork button top right:

    image
  4. After a few second, the repository will show up in your account:

    image

    As you can see, the original source of your fork is indicated. You can also find information about how your fork compares to the original a little further down the page:

    image

Pulling changes from the upstream repository

If the original repository that you forked (the "upstream" repository) changes, you will be able to merge those changes into your own repository:

  1. Open your fork in GitHub.

  2. Confirm that there are changes to pull by clicking the compare link:

    image
  3. CAREFUL! This will lead you to the upstream repository. To get back to your own repository, we need to change the merge direction:

    1. Select your repository in the top dropdown:

      image
    2. This will remove both repository dropdowns. Click the "compare across forks" link to get them back:

      image
    3. Finally, select the upstream repository in the bottom dropdown:

      image
  4. You are in the right place if the small merge direction arrow points from the upstream repository to your own:

    image

    You can inspect the actual changes by scrolling down on this page.

  5. Transfering changes from one repository to another related one always requires the use of a pull request. Usually a pull request is made to ask the maintainer of the upstream repository to incorporate changes that were made in a fork. But in this case, we are moving changes in the other direction. Yet, we are still going to use a pull request. Do that by clicking on the "Create pull request" button:

    image
  6. Now you can review the changes and write a comment. Finally you need to click the "Create pull request" button one more time:

    image
  7. Now you have a new pull request in your repository, but the changes have not yet been incorporated. For that you need to merge the pull request.

Merging a pull request

To incorporate the changes of a pull request in your repository, you first need to review it. Do everything that you need to feel comfortable with the changes and then merge them in by approving the pull request. The process is the same, no matter in which direction the pull request is going.

  1. First open the pull request by clicking on the "pull requests" menu item and then on the pull request itself:

    image
  2. Now you can see the pull request comments and check the commits and file changes that are included within:

    image
  3. When you are ready to incorporate the changes into your own repository, find the merge button but don't click it. Instead click on the small arrow next to it:

    image
  4. This allows you to pick the merge method. Depending on the number of changes applied to either repository you'll make your choice here. Usually you'll want to "squash and merge", but which one is the right way to go is dependent on the situation and beyond what we can cover here. For the purpose of this class, you can use the default "merge commit":

    image
  5. Selecting the merge choice above does not yet execute the merge. Instead, you still have to click the button.

  6. Afterward, provide a comment and "confirm merge":

    image
  7. Now the changes of the upstream repository have been incorporated in your own fork. If you have a clone of the repository on your own machine, don't forget to "pull" those new changes.

Setting the SQLCMD_HOME Windows environment variable

⚠️ In order to successfully run the exercises in this repository, you must have sqlcmd installed locally.

Follow the steps below to set up the SQLCMD_HOME Windows environment variable.

  1. Open up a command prompt in Windows by typing cmd in the Start Menu
  2. Change directory to C:
    cd c:\
    
  3. Use the following command to find an installation of the sqlcmd.exe utility
    dir /s sqlcmd.exe
    
  4. Once you have identified the location of sqlcmd.exe, create a new environment variable called, "SQLCMD_HOME". If you get multiple results back, use the one that has the highest version number.
    SETX SQLCMD_HOME "<YOURPATHGOESHERE>"
    
    image
  5. ⚠️ You must now restart SQL Server Management Studio (SSMS)

About


Languages

Language:TSQL 57.4%Language:Batchfile 42.6%