GIT:Getting Started
Getting Started
Introduction
Welcome to the Git - TD/OMS manual. This guide provides information on the setup and usage of the Git interface.
- The Git interface will be used to manage sources with Git but use TD/OMS to compile and deploy these sources and the associated objects with TD/OMS.
- The Git interface is controlled by the TD/OMS Client or from the Rational tooling and TD/OMS uses the Task to associate a Git branch with the Task. Once associated, TD/OMS knows to which task the source must be connected and will manage the change management administration in the background.
- Every developer must have a separate development environment with a personal IFS directory to receive the Git sources.
- When sources are uploaded to the IFS, they can be automatically converted to source members. With the source, the associated object is located and attached to the Task. * It is also possible to only manage the IFS sources and not manage any objects. The objects are then compiled from the IFS source directly. This has a restriction that some object types cannot be compiled from an IFS source.
Non IBM i
The first part deals with managing the deployment of Git controlled artifacts of non-native IBM i components. For example, you want to deploy PHP components throughout the servers on your network. For this, you want to use the TD/OMS Tasks and maybe the TD/OMS Mylyn interface to control the commit messages that you use the check-in source code.
Finally, when your Task is done you will use the TD/OMS Git interface to identify the components that you want to deploy.
IBM i
It is also possible to manage your IBM i sources with Git and TD/OMS. For this, we help you to first move your sources to the IFS and then check-in these sources into the Git master repository as an initial commit. For this, you can use the INZGITOMS command which will be discussed later.
Steps to Git
To configure your application for Git, you need to execute the following steps.
- Create IFS Routes
- In the TD/OMS environment maintenance screen, you must define a Route to define the place where TD/OMS may place sources from the Git repositories. It is possible to manage various Git repositories in one application. You must also define a Route for your native sources (DDS, RPGLE, etc..)
- Create Git Repositories
- In your Git server, you must create your master Git repositories. You can use various free alternatives to host your sources in the cloud. Popular sources are GitHub which provides free public hosting and paid private hosting or GitLab which provides free private and public hosting. You may also install your own Git Server. Popular open source alternatives are GitBlit (which can be installed on the IBM i) or GitBucket.
- Configure Git
- You must link the master Git repository location to the each of the Routes you want to manage with Git. You must also define which Route is used to manage native IBM i sources.
- Setup TD/OMS Git Scripting
- We provide the INZGITOMS command to make it easy for you to copy your sources to the IFS and upload them to a repository. You must also install our Git script code that will automate this process to some extent. The TD/OMS Git scripting code is installed by using the INZOMSSRV *GIT command
- Convert your application to Git
- If you also want to work with Git for your native IBM i objects then you can convert your sources to the IFS using the INZGITOMS command.
- Configure GitHub
- Optionally, if you want to store your sources on GitHub, you can configure the TD/OMS GitHub interface to be able to track issues and pull requests.
- Configure Branching
- Optionally, if you want to store your Git work in a separate branch on the IBM i then you have to set up TD/OMS Branching.
Work with Git
After Git has been setup you can start working.
- Create a Task
- As usual you create a Task.
- Clone a Repository
- If not already done, select the Task in the work management or in the TD/OMS Git view, select the repository you want and click the clone button.
- Start a Task
- After the repository is cloned, you have to create a branch in Git for that task, usually from the master branch. This is done by clicking the create branch link in the TD/OMS Git view.
- Code
- Start working on your files and any changed files will be detected automatically from the TD/OMS Git view in order to be pushed to Git and TD/OMS.
- Fetch and Rebase/Merge or Pull
- Fetch changes from your colleagues often in order to be synchronized with everyone's work and rebase or merge (incorporate) them into your task. You can also pull changes from the remote branch of the task (if there is one).
- Push to TD/OMS
- Push your changes to TD/OMS and find the impacted objects for recompilation. If the Impacted objects fail you need to change them as well and jump back to Code.
- Finish Task
- After you are done with your changes for this task you can finish it. This enables you to connect the changed sources to your task so that they can be compiled. If you find problems, resume coding.
- Merge into Master
- Merge your changes back into the master branch (Finish Task can do this for you).
- Push to Repository
- Push all changes back to the repository (Finish Task can do this for you).
- Deploy your changes
Client Installation
The Git interface is included in the base install. Please follow the installation instructions for the Rich Client or the RDi to install TD/OMs with the Git interface.
Note that RDi may not play nice when connecting to GitHub. The minimum cryptographic standard Git will accept for an HTTPS connection is TLSv1.2 anything lower will result in a Git TransportException or an alert protocol version, RDi's default is TLSv1.1. If you are experiencig this error you will need to set the following java property in the eclipse.ini file: -Dhttps.protocols=TLSv1.2
Server Installation
The server-side tools are provided in the TD/OMS installation library. Please upgrade to the latest stable version higher or equal to V10.1.
Overview of Setup Workflow for IBM i native sources
Before a developer can start developing native IBM i sources, the following setup workflow needs to run.
- TD/OMS: TD/OMS provides commands to copy native from source files to the IFS;
- GIT: The sources are pushed to a remote repository;
- TD/OMS: The matching TD/OMS Route is associated with the Git repository;
- TD/OMS: The route is marked as a special source route (additional actions take place while editing);
Overview of Setup Workflow for other IFS sources (PHP, JS, etc..)
Before a developer can start developing sources, the following setup workflow needs to run.
- GIT: The sources are pushed to a remote repository;
- TD/OMS: The matching TD/OMS Route is associated with the Git repository;
Overview of Setup Workflow for other NON-IFS sources (PHP, JS, etc..)
Before a developer can start developing sources, the following setup workflow needs to run.
- GIT: The sources are pushed to a remote repository;
- TD/OMS: The matching TD/OMS Application is associated with the Git repository;
Main Workflow
The TD/OMS Git workflow is based on the TD/OMS Task system. The main steps are:
- TD/OMS: The developer is assigned to a Task;
- TD/OMS: The developer clones the source repository;
- GUI: The developer imports the projects;
- GUI: The developer edits and commits sources;
- TD/OMS: The developer finishes the task;
- Git: The developer pushes the changes
- TD/OMS: The developer deploys the sources to the next environments;
Task Switching
The developer is able to work in teams or work on more than one Task.
- The developer switches to another Task
- The developer switches back to the original Task
Team Programming
The developer is able to work in teams of work on more than one Task.
- The developer starts working on a Task.
- The developer prepares a team repository
- The developer invites team members to work on the same Task
- The developer merges other changes in the local repositories
- The developer commits changes