Using version control with APEXcl
APEXcl is best used in conjunction with a version control system. A version control system, like Git or SVN, allows you to track changes made to source code over time. Code under version control is bundled into a repository.
Repositories need to be hosted somewhere. A popular option is to use a hosting platform like GitHub, Bitbucket, GitLab, etc.
This document explains how to setup an APEXcl project in a GitLab environment for an APEXcl export of an APEX application for a team of developers.
We chose GitLab as an example because it has a free private plan, but you could swap GitLab for another platform. If you already have a repository set up for your APEX project, then the steps below may not apply to you.
This is for the person who is responsible for setting up the GitLab Project and the APEXcl Repository for the APEX Application in the first place.
This person may also be responsible for running a periodic export of the APEX Application to the Git Repository on behalf of all the developers.
Creating a GitLab repository
You need to create a project and commit and push the APEXcl Export Git Repository from your local workstation to GitLab so other developers can have access.
As the GitLab project creator, you can invite members as developers. They will be able to clone the repository, commit and push changes to GitLab.
Invited members will receive an email with a link to accept the invitation. If it’s their first time using GitLab they will need to activate their GitLab account.
This section is for any member of the development team that uses APEXcl and wishes to check in their code to GitLab so that others can see the changelog.
If you don’t have Git installed on your workstation, you will need to install it.
Pull the GitLab repository locally
Go to your GitLab repository and copy the HTTPS link:
Then go to your command line and identify yourself:
git config --global user.name "Vincent Morneau" git config --global user.email "firstname.lastname@example.org"
Then clone the repository from GitLab with the HTTPS link:
git clone https://gitlab.com/vincentmorneau/apexcl-repository.git cd apexcl-repository
Run APEXcl export
Now that you have cloned the GitLab repository on your workstation, you can start exporting your application periodically to check-in your new code.
apexcl export --app
apexcl export --page 20
apexcl export --user vmorneau
You decide when to export your application, but generally good times would be:
- At the end of a work day
- When a new functionality is completed
View files in a Git-supported code editor
apexcl export has been executed, a good practice is to review the new files. A good way to do this is with Visual Studio Code (VSCode), which will identify everything that has changed since the last export.
In the example above, VSCode tells me that:
- On page 1, I changed the SQL query of the Dashboard report
- On page 1, I changed the label of the button VIEW_MONTH_ORDERS
Stage, commit & push to GitLab
Now that we have reviewed what has changed, we want to commit and push these new files to GitLab. There are many ways to do this, and we will highlight two of them here:
- On the command line, pointing the project directory:
git add . git commit -m "this code fixes issue #123" git push -u origin master
- You can use VSCode to stage, commit and push the changes to GitLab directly.
Now GitLab sees those changes.