简体   繁体   中英

Integrate RPGLE from GitHub to iSeries (IBM i)

We are looking at using Git for all our sources. We have different languages (PHP, SQL, RPGLE, JavaScript, etc), and want to try to centralize the source locations. Also, Git offers a plethora of other advantages over the iSeries based SCM.

Getting the sources to Git is fairly straight forward, what I am struggling with is how to move the code from the Git repos to the iSeries.

We use RDi for our IDE, and I have installed the eGit plugin, but I am struggling on how to move the modified sources from my local PC to the iSeries (developer's personal libraries).

Has any one done this? Can you assist me in getting this setup running?

One thing to keep in mind is the fact that 'change control' on IBM i means a lot more than just source change management.

Recompilation, object attribute retention, remote deployment, file data retention, object relationships, etc, all need to be considered for a serious change control system.

If all you're concerned with is source code change control, then GIT in PASE (or SVN) might be sufficient ... but if you're trying to satisfy auditor requirements, you will probably need something much more robust.

For RDi, the easiest interface is iProjects.

There is a writeup of interfacing SVN with iProjects at http://www.taskforce-it.de/en/download.html No, it's not Git, but the pdf describes the general mechanism for how you edit and push changes back to IBM i.

You WILL lose your source change date and sequence numbers.

OK, I think I got this solved. Here is what I did:

Install eGit

Projects: To get this working, you will need to use projects. This part will be a slight learning curve, but it is really easy once you get the hang of it.

Configure I Projects: We do not want line numbers and dates (causes errors on push/pulls).
Navigate to Window > Preferences > I Projects Click 'Remove sequence number and date fields on download' Click 'Enable add and remove sequence number actions'

Create iSeries Project: Click File > New > Project Search for IBM Select the IBM I Project Click Next Name the project Click Next Select your connection to your remote server Select an associated Library (your PD lib is best) Click finish

You should see a project in the Project explorer.

Navigate to the Remote System Explorer Create an object filter for your Q* source files In the context of the filter, right click and select 'Add to I Project'

Now you should have the entire Qblah source file in the project

Create Git Project Right click in the project explorer and select import. (May need to pick Import > Import) Type Git Select Projects from Git Click Next

Here you can use an existing local checkout, or clone a new repo.
Select clone URI Click next Enter the protocol/URI (just like in the wiki you visited earlier) Select branch(s) you want to import (recommend Master) Click Next Select destination folder Click Next Make sure 'Import as a general project' and click next Name your project (Recommend Git-repoName) Click finish

You should now see two projects listed.

Editing You can select the source and edit in the Git project. It will open the correct lpex editor and you are good to go.

Sending to iSeries This is where things get a bit tricky.
When it is time to send to the iSeries and compile, right click on the modified source in the Git repo Select Copy Right click on the appropriate Q* in your IBM project source file and select paste

Next go to the remote reconciler tab Right click on the source or file and select 'push to', then select the remote entry

BAM! Code is on the iSeries, ready for compilation.

Commit back to Git In the Git project, right click and select Team > Commit. Select/de-select the desired changed sources Enter message Click commit (local commit only) or commit and push (commit to remote repo)

Done! Now you can start importing the iSeries based code to Git!

jgriffin , I'm doing exactly this as an experiment for my projects, not for the entire enterprise sources.

This is what I've learned:
1. Create a connection on RDi to your sources.
2. Create an iSeries project on your local machine.
3. Create a folder on your project. This will be your sources location.
4. Init a git repository in this folder.
5. Use your iSeries connection to import your sources to your local folder.
6. Make a your first commit and that's it! You have now your codebase to your projects.

Work on your sources as usual on your iseries. Then when you consider a new commit shoul be done, use the Remote Reconcilier view on your RDi or just import the modified code into your folder and make a new commit using git.

I haven't tested rollbacks, checkouts and other things. When the time comes I will. Let me know how this work for you.

Good Luck.

JF.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM