Only in Mage Pro.Try our fully managed solution to access this advanced feature.
- Deployments App: Deploy code from Git commits to your Mage Pro cluster
- 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.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.
- If you have a nested GitHub project, you may want to set the target directory to
/home/src
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
- After authenticating you will return to the Mage-Pro deployment app
- You should now see that you are connected to GitHub
- If there are no organizations listed, add an organization to the text field below and click the Set organization button
- You should see all your GitHub repos here if you authenticated correctly
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.
- This will take you to the BitBucket sign-in authentication
- After authenticating you will return to the Mage-Pro deployment app
- You should now see that you are connected to BitBucket
- If there are no organizations listed, add an organization to the text field below and click the “Set organization” button
- You should see a list of all the repositories that were created in the workspace.
- The production branch is the primary branch that your production code will mirror.
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.
- This will take you to the GitLab sign-in authentication
- After authenticating you will return to the Mage-Pro deployment app
- You should now see that you are connected to GitLab
- If there are no groups listed, add a group to the text field below and click the “Set group” button
- You should see a list of all the repositories that were created in the group.
- 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:- 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
- 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.
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.)
2.3 Troubleshooting Git Commands
When trying to connect to GitHub, you may run into a few roadblocks along the way:- Make sure you are in the correct folder
/home/src/<Your user code path>
- You may need to globally configure your email and username to your GitHub:
git config --global user.email "your_email@example.com"
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
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