Creating RDi User Action Options for Git and IFS Files

<< Click to Display Table of Contents >>

Navigation:  Hooking Up to PDM and RDi  >

Creating RDi User Action Options for Git and IFS Files

If you are a Rational Developer for i (RDi) user and your source is already stored in the IFS, you can easily commit files with the GITCMD CL command and you can also send source copies to a library for building/compiling.

 

By creating User Actions in RDi, you can have the same PDM-like functionality that PDM users enjoy from the RDi Remote Systems Explorer and the IFS.

 

The RDi strategy for using IFS source files would typically be to maintain your source and git repository in the IFS and either compile from the IFS or move source member copies into a library for building. Or you could use a continuous integration product for automated build processes.

 

Source members and versions can simply be stored in a local shared IFS repository directory or they can be pushed to a remote git server (like Github or Bitbucket) if you have one established.

 

Getting Started with RDi and Git

The first thing you need to do is bring up a list of IFS source members in RDi

 

Right-click on any IFS source member and select User Actions/Work with User Actions.

 

Then under New, select File action (to run command for selected file) or Folder action (to run command when directory right-clicked).

 

clip00001

 

 

Commit Git Repo Changes - Use the GITCMD CL command to perform local commit of all source members in the selected IFS repo directory. Always perform this user action to commit a copy of all repository source member changes to git.

 

Action type: Folder action

Action name: Commit Git Repo Changes-GITCMD

Comment: Git add/commit all changed

Command: IBM i command

Command entry: IFORGIT/GITCMD IFSREPODIR('&FP') FROMIFSFIL(*NONE) CRTIFSDIR(*NO) CMDOPTS('add .' 'commit -m "Changes by &U"') LOGSTDOUT(*YES)

Prompt first: Check this box so command will prompt (Optional but good for testing.)

Show action: Check this box.

 

 

Commit IFS File to Git Repo - Use the GITCMD CL command to perform local commit of selected IFS file in the IFS repo directory. Always perform this user action to commit a copy of the selected repository source member changes to git.

 

Action type: File action

Action name: Commit IFS File to Git Repo

Comment: Git add/commit selected file

Command: IBM i command

Command entry: IFORGIT/GITCMD IFSREPODIR(*IFSFILEPARENT) FROMIFSFIL('&FP') CRTIFSDIR(*NO) CMDOPTS('add &FP' 'commit -m "Changes by &U"') LOGSTDOUT(*YES)

Prompt first: Check this box so command will prompt (Optional but good for testing.)

Show action: Check this box.

 

 

Send IFS File to Source Member from Git-SRCFRMGIT - Use the SRCFRMGIT CL command to pull and import a file version from the local IFS repository directory. Always perform this user action to read most recent version from your local git repository. The *SRCHDR values will up

 

Action name: Send IFS File to Source Member from Git-SRCFRMGIT

Comment: Import source member from git repository

Command: File action

Command entry: IFORGIT/SRCFRMGIT IFSREPODIR('*IFSFILEPARENT') FROMIFSFIL('&FP') SRCFILE(*SRCHDR) SRCMBR(*SRCHDR) SRCTYPE(*SRCHDR) SRCHEADER(*YES) SRCDATSEQ(*NO) REPLACE(*YES) EDITOPT(*NONE) VALIDREPO(*YES) COMMITOPT(*COMMIT) COMMENT(*DATEUSER)

Prompt first: Check this box so command will prompt (Optional but good for testing.)

Show action: Check this box.

Defined types: ALL

Selected types: ALL

 

 

Send IFS File to Source Member - SRCFRMSTMF - Use the SRCFRMSTMF CL command to pull and import a file version from the local IFS repository directory to a source member. The SRCFRMSTMF command may not update source type and text. Meant as a quick copy of IFS to source members similar to CPYFRMSTMF.

 

Action name: Send IFS File to Source Member - SRCFRMSTMF

Comment: Import source member from IFS directory

Command: File action

Command entry: IFORGIT/SRCFRMSTMF FROMSTMF('&FP') TOMBR(*IFSFILEPATH) MBROPT(*REPLACE) STMFCCSID(*PCASCII) ENDLINFMT(*ALL)

Prompt first: Check this box so command will prompt (Optional but good for testing.)

Show action: Check this box.

Defined types: ALL

Selected types: ALL

 

Get IFS File from Source Member - SRCTOSTMF - Use the SRCTOSTMF CL command to export a source member to the local IFS repository directory. The SRCTOSTMF does not write any source information headers or line sequences or dates. Meant as a quick copy of source members to IFS similar to CPYTOSTMF.

 

Action name: Send IFS File to Source Member - SRCTOSTMF

Comment: Export source member to IFS directory

Command: File action

Command entry: IFORGIT/SRCTOSTMF TOSTMF('&FP') FROMMBR(*IFSFILEPATH) STMFOPT(*REPLACE) STMFCCSID(*PCASCII) ENDLINFMT(*CRLF)

Prompt first: Check this box so command will prompt (Optional but good for testing.)

Show action: Check this box.

Defined types: ALL

Selected types: ALL

 

Note: SRCTOGIT is currently not enabled to be used with User Actions when editing from the IFS only. If you have a need for this, please reach out. The goal would be to make it work like the Send IFS File to Source Member from Git-SRCFRMGIT