[go: up one dir, main page]

Skip to main content
Mage Pro provides two main applications for version control and deployment:
  1. Deployments App: Deploy code from Git commits to your Mage Pro cluster
  2. Version Control Terminal: Push/pull code and manage branches using Git commands

1. Deployments App

The Deployments App is your primary tool for deploying code from Git commits to your Mage Pro cluster. It provides a visual interface for managing deployments across different environments.

1.1 Authentication

First, authenticate with your Git provider in the Deployments application to enable version control and deployment features.

Access Deployments

From the Home page, select Deployments in the left-hand navigation menu to access the Deployments interface. Click the Setup connection button to begin syncing with your code repository.
Mage Pro deployments button

Configure Repository Settings

Once you are in the connect repository UI, take the following steps: Step 1: Set your directory as the user code path you intend to use for your project.
  • In Mage Pro the default directory will be /home/src/default_repo.
  • If you changed the USER_CODE_PATH environment variable in the Mage Cloud Management Portal, your directory will need to reflect that change.
Step 2 (optional): Set your target directory for your deployment if it will be different from your top level directory.
  • If you have a nested GitHub project, you may want to set the target directory to /home/src
Mage Pro deployments button

GitHub Authentication

Step 1: Click the “Connect” button to the right of the GitHub connection
  • This will take you to the GitHub sign-in authentication
Step 2: Sign in with your GitHub login credentials
  • After authenticating you will return to the Mage-Pro deployment app
  • You should now see that you are connected to GitHub
Step 3: Select your GitHub organization from the dropdown list.
  • If there are no organizations listed, add an organization to the text field below and click the Set organization button
Step 4: Select the repo you want to commit code to by clicking the repository drop down box
  • You should see all your GitHub repos here if you authenticated correctly
Step 5: Select your branch (usually main or master) to commit your code to by clicking the dropdown box and selecting the branch name Step 6: Click the “Deployments” button to see a list of commits from your Git hosting vendor, and deploy from the most recent or any specific commit.
Mage Pro install app button
If you need to connect deployments to a private GitHub repo, provide an organization then click the Install Mage Pro app on GitHub button.

BitBucket Authentication

Mage Pro supports integration with BitBucket repositories for version control, collaboration, and deployments. Connect to BitBucket using OAuth tokens: Step 1: Set your directory as the user code path you intend to use for your project.
  • In Mage Pro the default directory will be /home/src/default_repo.
  • If you changed the USER_CODE_PATH environment variable in the Mage Cloud Management Portal, your directory will need to reflect that change.
Connect repository
Step 2: Click the “Connect” button to the right of the BitBucket connection
  • This will take you to the BitBucket sign-in authentication
Step 3: Sign in with your BitBucket login credentials
  • After authenticating you will return to the Mage-Pro deployment app
  • You should now see that you are connected to BitBucket
Connect Button
Step 4: Select your BitBucket workspace from the dropdown list.
  • If there are no organizations listed, add an organization to the text field below and click the “Set organization” button
Step 5: Select the repository from the dropdown menu.
  • You should see a list of all the repositories that were created in the workspace.
Step 6: Finally, select the production branch from the dropdown list
  • The production branch is the primary branch that your production code will mirror.
Bitbucket workspace

GitLab Authentication

Mage Pro supports integration with GitLab repositories for version control, collaboration, and deployments. Connect to GitLab using OAuth tokens: Step 1: Set your directory as the user code path you intend to use for your project.
  • In Mage Pro the default directory will be /home/src/default_repo.
  • If you changed the USER_CODE_PATH environment variable in the Mage Cloud Management Portal, your directory will need to reflect that change.
Step 2: Click the “Connect” button to the right of the GitLab connection
  • This will take you to the GitLab sign-in authentication
Step 3: Sign in with your GitLab login credentials
  • After authenticating you will return to the Mage-Pro deployment app
  • You should now see that you are connected to GitLab
Connect Button
Step 4: Select your GitLab group from the dropdown list.
  • If there are no groups listed, add a group to the text field below and click the “Set group” button
Step 5: Select the repository from the dropdown menu.
  • You should see a list of all the repositories that were created in the group.
Step 6: Finally, select the production branch from the dropdown list
  • The production branch is the primary branch that your production code will mirror.
Currently the deployments application is only available for GitHub, GitLab, and Bitbucket users.

1.2 Deploy Code

Deploy code from Git commits to your Mage Pro cluster or workspace using the Deployments application.

Merge Pull Request

Once you push code to your Git branch, head to your Git provider and merge the pull request. Once the pull request is merged your deployment will be available in the deployments application interface.

Deploy Code

Mage simplifies the deployment of code to production pipelines. Follow these steps to deploy your pipeline’s CI/CD Git branches:
  1. Once you have merged the pull request in your Git provider, navigate back to the deployments tab and click deployments highlighted in green in the top
  2. Click the Deploy button to deploy the current version you just merged
    • To revert to a previous version, simply click the “Rollback” button to deploy the desired version.
Mage Pro deployments page

2. Version Control Terminal

Once authenticated with a Git provider, you can manage your codebase by pushing and pulling files directly from the terminal. Use standard Git commands to perform various version control operations.
If you haven’t authenticated with a Git provider yet, see the Authentication section above to set up GitHub, BitBucket, or GitLab integration first.

2.1 Access Version Control Terminal

To access the Version Control Terminal in Mage Pro:
  • From the Home page, select Version control in the left-hand navigation menu to access the Version control terminal.
  • Once the version control terminal page is open, you can enter the git commands in the terminal page and press enter to run it.

2.2 Essential Git Commands

git checkout -b <branch-name> (Creates and switches to a new branch named <branch-name>, enabling isolated development for features or fixes.) git status Displays the current state of the working directory and staging area, highlighting modified, staged, and untracked files. git add . (Stages all changes in the current directory and its subdirectories, preparing them for the next commit.) git commit -m "<commit-message>" (Records the staged changes in the repository with a descriptive message <commit-message>, creating a new commit in the current branch.) git push origin <branch-name> (Uploads the commits from the local <branch-name> to the corresponding remote branch on GitHub, making the changes available to collaborators.)
Mage Pro install app button

2.3 Troubleshooting Git Commands

When trying to connect to GitHub, you may run into a few roadblocks along the way:
  1. Make sure you are in the correct folder
    1. /home/src/<Your user code path>
  2. You may need to globally configure your email and username to your GitHub:
    1. git config --global user.email "your_email@example.com"
    2. git config --global user.name "Your Username"

Summary

Mage Pro provides a complete version control and deployment workflow with two main applications:
  • Deployments App: Primary tool for deploying code from Git commits to your Mage Pro cluster
  • Version Control Terminal: Use Git commands to push/pull code and manage branches
This enables seamless version control for data pipelines, allowing teams to use both the visual Mage Pro interface and standard Git commands across all platforms, ensuring robust collaboration and deployment workflows for production data systems.

Best Practices for Environment Management

Development Environment

  • Primary Tool - Version Control Terminal:
    • Create feature branches, develop code, commit changes, push to Git
    • Switch between branches, merge changes
  • Secondary Tool - Deployments App:
    • Deploy to dev environment for testing and validation
    • Rollback changes or switch to another feature branch (can also be done via terminal)
  • Workflow: Develop locally → Commit to feature branch → Deploy to dev environment for testing

Staging Environment

  • Primary Tool - Deployments App:
    • Pull changes from Git (staging/main/master branch)
    • Deploy to staging environment and run testing
  • Secondary Tool - Version Control Terminal:
    • Make hotfixes and push changes to Git
    • Merge feature branches and prepare releases
  • Workflow: Pull from Git → Deploy to staging → Run integration tests → Make hotfixes if needed

Production Environment

  • Primary Tool - Deployments App:
    • Deploy commits from main/master branch
    • Rollback changes if issues occur
    • Monitor deployment status
  • Secondary Tool - Version Control Terminal:
    • Emergency patches and hotfixes only
  • Workflow: Deploy from main/master → Monitor → Rollback if needed
I