Xyna Factory and Git - Xyna-Factory/xyna GitHub Wiki
It is possible to have XMOM objects under version control with git
.
This chapter will list the necessary steps in order to connect the saved state of XMOM objects within a workspace to a git
repository.
As a minimal prerequesite a Xyna Factory instance and local git
repository is needed. It is recommended to have a separate directory for the cloned repository.
The process includes two main steps. The first step is to handle your sources with git commands and the second part involves the announcement of changes to the Xyna Factory instance.
- Either use an existing workspace or create a new one with the help of the Factory Manager (or with the CLI command
./xynafactory.sh createworkspace
) - Clone a repository to a separate directory
git clone <your_repo>.git
- Find out the current revision of the workspace (Factory Manager or
./xynafactory.sh listworkspaces -t
) - Backup the original revision folder like this:
cd /opt/xyna/xyna_001/revisions mv rev_<n> rev_<n>_bkp
- Create a symlink to the git respository with
ln -s /path/to/git/repo/your_workspace rev_<n>
. Make sure that<n>
matches the revision number determined in step 3. - Announce the directory change to the Factory i. e. with
./xynafactory.sh refreshworkspace -d
(for details see chapter "Announce changes to Xyna Factory")
After handling the git
commands it is necessary to announce the changes to Xyna Factory instance.
The procedure depends on the kind of XMOM objects.
-
Added/Modified/Renamed: Either deploy the changed DataTypes/Workflows/Exceptions with the
-xmlFile
option:# data type ./xynafactory.sh deploydatatype -workspaceName <your_workspace> -fqDatatypeName <full_qualified_path> -xmlFile <../revisions/rev_<n>/path/to/xml> # workflow ./xynafactory.sh deploy -workspaceName <your_workspace> -fqWorkflowName <full_qualified_path> -xmlFile <../revisions/rev_<n>/path/to/xml> # exception ./xynafactory.sh deployexception -workspaceName <your_workspace> -fqExceptionName <full_qualified_path> -xmlFile <../revisions/rev_<n>/path/to/xml>
or refresh the whole workspace with -d
option ./xynafactory.sh refreshworkspace -d
- Delete: Delete the corresponding object within the Factory Manager > Deployment Items > Trash bin
-
Added/Modified/Renamed: Re-deploy the corresponding service group with
./xynafactory.sh deploydatatype -workspaceName <your_workspace> -fqDatatypeName <full_qualified_path> -xmlFile <../revisions/rev_<n>/path/to/xml>
-
Delete: Nothing additionally has to be done, because it is already covered with the Delete of the datatype
-
Added/Modified: Re-deploy the shared library with
./xynafactory.sh deploysharedlib -workspaceName <your_workspace> -sharedLibName <your_sharedLib>
-
Delete:
- Delete the shared lib folder
- Deploy shared lib with empty folder with
./xynafactory.sh deploysharedlib -workspaceName <your_workspace> -sharedLibName <your_sharedLib>
- Shutdown Factory
./xynafactory.sh stop
- Delete Folder
revision/rev_<n>/sharedLib/<your_sharedLib>>
- Start Factory
./xynafactory.sh