Tutorial: Integrate a project with Github

This tutorial provides step-by-step instructions for integrating your Snoweaver project with Github by using the Snoweaver CLI client.

Prerequisites

Before continuing with this tutorial, ensure you have completed the following prerequisites:

Export Resources from the Project

  1. Open the LEARN_DEV project in Snoweaver with the LEARN_DEV_DEVELOPER role.

  2. Click Export on the Home page with Resource Type set to All.

    ../_images/116.png
  3. Once the export is complete, you’ll find several YAML files generated for the project resources within the CODE stage of LEARN_DEV. The specific files generated will depend on the resources you’ve created in your project.

    ../_images/28.png

Create and connect to a Github repository

  1. If you don’t already have an account, sign up for a free GitHub account.

  2. Create a new repository named learn_sw.

    ../_images/35.png
  3. Set up a connection to LEARN_DEV in SnowSQL if you haven’t done so already.

    Please refer to this page: Configure a connection to a Snoweaver project

  4. Launch a command-line terminal (Linux, macOS) or Git Bash (Windows) on your client machine.

  5. Select your preferred method for authenticating your Github account with the Git command line tool.

  6. Run the following commands to clone the new repository and download the LEARN_DEV project:

    cd ~
    git clone https://github.com/<Your Org>/learn_sw.git
    cd learn_sw
    sw get all -c learn_dev
    
    ../_images/48.png
  7. Run the following commands to push the changes to your repository:

    git add .
    git commit -m 'first commit'
    git push -u origin main
    
    ../_images/56.png

Warning

The commands and steps in this tutorial are intended to demonstrate the basic integration of Snoweaver with a version control system. In a production environment, it’s crucial to adhere to your organization’s established workflows and best practices for version control. This may include using feature branches, pull requests, code reviews, and other collaborative development practices. Always consult with your team or IT department to ensure your actions align with your organization’s standards and security policies.

Update the project and commit the change

  1. Open the LEARN_DEV project in Snoweaver with the LEARN_DEV_DEVELOPER role.

  2. Add a new project variable on the Home page. as follows:

    Name:     test_var
    Type:     Text
    Value:    test
    ../_images/63.png
  3. Save the changes.

  4. Return to your comand line terminal.

  5. Re-export the project to the CODE stage and then synchronize your local project copy:

    sw export all -c learn_dev -d
    sw get all -c learn_dev -d
    
    ../_images/76.png
  6. Commit your changes to the repository and review the details of the second commit on GitHub.

    git add .
    git commit -m 'add project var test_var'
    git push -u origin main
    
    ../_images/86.png