Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Module 4 - Prep

Learning Objective: Prep for Module 4

Helpful Links:

Instructions for Module 4 - Prep

The goal of this exercise is to use set up the required repository secrets to enable you to connect to Spawn data-containers.

You will use Gitpod to create a temporary development environment. In that development environment, you will authenticate to Spawn, onboard, and then generate a token. That token must be saved as a repository secret in your GitHub repo.

  1. In a new tab or browser window, open this url https://gitpod.io/#https://github.com/sqlity-net/dataplatform-devops-exercises

    gitpod link
    image
  2. Login by clicking on "Continue with GitHub"

    gitpod login
    image
  3. Click the green "Authorize gitpod-io" button.

    gitpod login 2
    image
  4. Wait for a couple of minutes while Gitpod processes the request.

    wait for pod creation
    image
  5. Gitpod will create a new development environment for you. In the bottom right-hand section, open the "TERMINAL" tab.

    open terminal and increase its size
    image
  6. To login to Spawn, run the spawnctl auth command in the TERMINAL area.

    spawnctl auth
    image
  7. This will print a link. You must manually click this link to complete the authorization process.

    spawnctl auth link
    image
  8. Click on the "Open" button in the confirmation dialog.

    spawnctl auth link confirm
    image
  9. Click "Submit" in the new window. Do not change the displayed code.

    github authentication 1
    image
  10. This will take you to an authorization page. Click the green "Authorize red-gate" button.

    github authentication 2
    image
  11. You should now see a "Login Successful for spawnctl" screen. Please close this tab. It is not needed.

    github authentication success
    image
  12. In the Gitpod terminal, you may need to wait for 10-20 seconds until "Authenticated successfully." appears. Now enter the spawnctl onboard command to accept license and terms of use agreements.

    spawnctl onboard
    image
  13. Follow the three prompts as shown.

    y,accept,accept
    image
  14. Create the access token by using the command spawnctl create access-token --purpose "tSQLt Class"

    spawnctl create access-token
    image
  15. Highlight and copy the displayed access token.

    copy token
    image
  16. Back in your GitHub repository, click on the "Settings" tab.

    github repository settings
    image
  17. On the left-hand navigation near the bottom, click on "Secrets".

    github repository secrets
    image
  18. Click the "New repository secret" button on the top-right.

    new repository secret
    image
  19. Create a new token with the Name, "SPAWNCTL_ACCESS_TOKEN", and paste the access token from Step #15 into the Value field. Click "Add Secret" to confirm.

    SPAWNCTL_ACCESS_TOKEN
    image
  20. You should now see the "SPAWNCTL_ACCESS_TOKEN" displayed in the Repository secrets list.

    done
    image

Delete the Gitpod Development Environment

Now that you have successfully created and saved the access token required for Spawn, you should delete the Gitpod development environment.

  1. Navigate to https://gitpod.io/workspaces in a new tab or browser window.

    gitpod workspaces
    image
  2. Hover over the listed Workspace; click on the three vertical dots; and then select "Delete".

    delete
    image
  3. Confirm by clicking the red "Delete Workspace" button.

    confirm
    image
  4. You might have to refresh the page after 10-30 seconds to confirm that the deletion was successful and that you no longer have any active Workspaces.

    refresh page
    image