I want to setup a build system and later deploy it to Jenkins CI.
The first prototype of build system might include following 1 SVN checkout 2 set and open a project 3 load/install library 4 compile and login
I follow this post l viewtopic.php?t=1890 l and successfully open a project and print the value. But with SVN example it failed and I do not understand how this svn code checkout repo even.
So could someone provide a python example of checkout svn repo first, then setup a Codesys project? It is even better if there is a way to include library.
Also I would like to know where could I find the document of python script? It will be useful for me to see how much I can do using python script.
Best regard,
Yiqing
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
anson2004 hat geschrieben:
I follow this post l viewtopic.php?t=1890 l and successfully open a project and print the value. But with SVN example it failed and I do not understand how this svn code checkout repo even.
anson2004 hat geschrieben:
So could someone provide a python example of checkout svn repo first, then setup a Codesys project? It is even better if there is a way to include library.
anson2004 hat geschrieben:
Also I would like to know where could I find the document of python script? It will be useful for me to see how much I can do using python script.
You can find the API documentation "ScriptEngine.chm" in the sub directory OnlineHelp in the CODESYS main directory. The API documentation "ScriptEngine_SVN_4040.chm" can be found in one of its sub directories.
BR
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a problem after svn checkout. I try to login to a specific target device using set_gateway_and_address method. I specify correct guid and address. But I got runtime error:
Exception: The object 'Device' cannot be modified because it could not be locked in the SVN repository.
Details: Path '/svn_url/Device/svnobj' is already locked by user 'xxx.xx' in filesystem 'a6267ff8-34b0-244c-8b93-125bfbd9a58b'
What could go wrong?
Yiqing
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
anson2004 hat geschrieben:
Exception: The object 'Device' cannot be modified because it could not be locked in the SVN repository.
Details: Path '/svn_url/Device/svnobj' is already locked by user 'xxx.xx' in filesystem 'a6267ff8-34b0-244c-8b93-125bfbd9a58b'
Set the automatic locking in the SVN settings (see Options) to "Never acquire a lock automatically" and try again.
BR
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
svn checkout works? Really? How?
What is the namespace ov svn.checkout()?
What is the object that the function can be applied to?
Within docs I found SubversionIntegration.ScriptDriver - but how to use it?
Within forum I found "Find some API within ScriptEngine_SVN_4040.chm"
Within this forum I found several approaches:
1. svn.checkout() or projects.primary.svn.checkout?
2. system.commands["svn", "copy"].execute("svn://new/destination/url", "false", "commit message")
3. os.popen('"' + SVNEXE + '" cat ' + XMLURL, 'r') as pipe:....
Does any of these ideas work for checkout?
Best regards
Dirk
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DBe hat geschrieben:
Within this forum I found several approaches:
1. svn.checkout() or projects.primary.svn.checkout?
2. system.commands["svn", "copy"].execute("svn://new/destination/url", "false", "commit message")
3. os.popen('"' + SVNEXE + '" cat ' + XMLURL, 'r') as pipe:....
If you have CODESYS SVN you can use the API described in the of the CHM file . For example, you can checkout a project using svn.checkout('url', 'directory', 'project_name') in a python script and run it in CODESYS.
If you don't have CODESYS SVN you can only work with the normal files. For example, you can checkout a project file and open it in CODESYS but you don't have any SVN features or operation inside CODESYS.
BR
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in fact we use Tortoise SVN and ENI Server for storing Codesys sources.
We don't store the projects due to their size and other collaboration reasons.
So I assume Tortoise SVN sources can not be checked out by Codesys SVN, right or wrong?
One possible solution that appears to me could be:
1. Store Codesys sources with Tortoise SVN
2. Use Codesys SVN to check out sources via API for continous integration build process only
If Tortoise and Codesys SVN can coexist just for a simple check-out then investing 500β¬ for this package will be my preferred solution.
Best regards
Dirk
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-06-30
Originally created by: M.Schaber
Hi,
the CODESYS SVN AddOn stores the CODESYS projects as a tree of files and directories, so you can commit and compare on a per-object basis.
As CODESYS projects are "natively" stored in an object database, the mapping is not straight forward, and you won't be able to work on CODESYS Sources using TortoiseSVN.
On the other hand, the SVN AddOn will not work with a CODESYS project file stored with TortoiseSVN.
As you write about ENI server - this product is not really supported any more (for CODESYS V3).
HTH,
Markus
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
is it possible to give svn user and password as a parameter to svn.checkout or similiar (e.g. AuthenticationRequest)?
Or should I go with the auth cache set manually for each user within Codesys UI?
Reason: A build server script would like to access the codesys machine via ssh, programatically do a checkout of a project and codesys build.
Best regards
Dirk
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DBe hat geschrieben:
is it possible to give svn user and password as a parameter to svn.checkout or similiar (e.g. AuthenticationRequest)?
Or should I go with the auth cache set manually for each user within Codesys UI?
Hi,
I am new to Codesys Python script language.
I want to setup a build system and later deploy it to Jenkins CI.
The first prototype of build system might include following 1 SVN checkout 2 set and open a project 3 load/install library 4 compile and login
I follow this post l viewtopic.php?t=1890 l and successfully open a project and print the value. But with SVN example it failed and I do not understand how this svn code checkout repo even.
So could someone provide a python example of checkout svn repo first, then setup a Codesys project? It is even better if there is a way to include library.
Also I would like to know where could I find the document of python script? It will be useful for me to see how much I can do using python script.
Best regard,
Yiqing
Hi anson2004.
You can find the API documentation "ScriptEngine.chm" in the sub directory OnlineHelp in the CODESYS main directory. The API documentation "ScriptEngine_SVN_4040.chm" can be found in one of its sub directories.
BR
Martin
Hi Martin,
Thank you very much.
The svn checkout work.
I have a problem after svn checkout. I try to login to a specific target device using set_gateway_and_address method. I specify correct guid and address. But I got runtime error:
Exception: The object 'Device' cannot be modified because it could not be locked in the SVN repository.
Details: Path '/svn_url/Device/svnobj' is already locked by user 'xxx.xx' in filesystem 'a6267ff8-34b0-244c-8b93-125bfbd9a58b'
What could go wrong?
Yiqing
Hi anson2004.
Set the automatic locking in the SVN settings (see Options) to "Never acquire a lock automatically" and try again.
BR
Martin
Hello together,
svn checkout works? Really? How?
What is the namespace ov svn.checkout()?
What is the object that the function can be applied to?
Within docs I found SubversionIntegration.ScriptDriver - but how to use it?
Within forum I found "Find some API within ScriptEngine_SVN_4040.chm"
Within this forum I found several approaches:
1. svn.checkout() or projects.primary.svn.checkout?
2. system.commands["svn", "copy"].execute("svn://new/destination/url", "false", "commit message")
3. os.popen('"' + SVNEXE + '" cat ' + XMLURL, 'r') as pipe:....
Does any of these ideas work for checkout?
Best regards
Dirk
Hi DBe.
If you have CODESYS SVN you can use the API described in the of the CHM file . For example, you can checkout a project using svn.checkout('url', 'directory', 'project_name') in a python script and run it in CODESYS.
If you don't have CODESYS SVN you can only work with the normal files. For example, you can checkout a project file and open it in CODESYS but you don't have any SVN features or operation inside CODESYS.
BR
Martin
Hi Martin,
in fact we use Tortoise SVN and ENI Server for storing Codesys sources.
We don't store the projects due to their size and other collaboration reasons.
So I assume Tortoise SVN sources can not be checked out by Codesys SVN, right or wrong?
One possible solution that appears to me could be:
1. Store Codesys sources with Tortoise SVN
2. Use Codesys SVN to check out sources via API for continous integration build process only
If Tortoise and Codesys SVN can coexist just for a simple check-out then investing 500β¬ for this package will be my preferred solution.
Best regards
Dirk
Originally created by: M.Schaber
Hi,
the CODESYS SVN AddOn stores the CODESYS projects as a tree of files and directories, so you can commit and compare on a per-object basis.
As CODESYS projects are "natively" stored in an object database, the mapping is not straight forward, and you won't be able to work on CODESYS Sources using TortoiseSVN.
On the other hand, the SVN AddOn will not work with a CODESYS project file stored with TortoiseSVN.
As you write about ENI server - this product is not really supported any more (for CODESYS V3).
HTH,
Markus
Hi,
is it possible to give svn user and password as a parameter to svn.checkout or similiar (e.g. AuthenticationRequest)?
Or should I go with the auth cache set manually for each user within Codesys UI?
Reason: A build server script would like to access the codesys machine via ssh, programatically do a checkout of a project and codesys build.
Best regards
Dirk
Hi DBe.
Some example code:
For more details please look at the Scripting API for SVN which is installed with the CODESYS SVN Add-On.
BR
Martin
Hi Martin,
thank you again - this works fine for all ssh scenarios and users!
No auth cache needed anymore
Best regards
Dirk