Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-07

FPC buildbot

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Darius Blaszyk

Hi all,

I was looking for the sources of a buildbot suitable for an FPC project. I would like to keep it as simple as possible, so no webserver hassle for instance. Just simply repo sync, build, run test suite and upload to ftp. I know buildbot.net but I was hoping on finding something specifically suited for FPC. Does anything like that already exists? Any help would be appreciated.

Rgds, Darius

Verstuurd vanaf mijn iPhone

Joost van der Sluis
to Darius Blaszyk

Op 16-07-2020 om 08:37 schreef Darius Blaszyk via fpc-pascal:

I was looking for the sources of a buildbot suitable for an FPC project. I would like to keep it as simple as possible, so no webserver hassle for instance. Just simply repo sync, build, run test suite and upload to ftp. I know buildbot.net but I was hoping on finding something specifically suited for FPC. Does anything like that already exists? Any help would be appreciated.

Well, there are the buildagents used by the fppkg-repository. You can use them to build fppkg-packages. Try for yourself at: https://fppkg.cnoc.nl/build (Login with your mantis or forum-account)

The code of these buildagents is here, but it's not 'simple': svn.freepascal.org/FPC/svn/fpcprojects/fppkgreposerver/trunk/buildagent

Easiest way is to use an existing build-environment like Jenkins. But you can also use gitlab.

Look for example here:
https://gitlab.freepascal.org/Joost/fpdserver/pipelines/293/builds

That one is automatically build after each commit. That's done with an easy CI-script, and a kubernetes-cluster with a container with fpc installed. (It's the same kubernetes-cluster as the fppkg-repository above uses)

There are so many options...

Regards,

Joost.

Darius Blaszyk
to Joost van der Sluis

Hi Joost,

Thanks for the suggestions. I had a look at the fppkgreposerver, but this is indeed more complex than I need at the moment. The project I am working on is a closed source at the moment, so making use of public build services is unfortunately not an option for me.

I was considering making an instantFPC script that could be run from a cron job, or remains in an endless loop, checking the repo every x minutes, and in case it detects a commit, would execute a build script (fpmake / pmake) and then upload the created package via ftp. I have limited experience with uploading via ftp through an fpc application, but would LNet be most suited? Also interfacing (username/password) via TProcess is new to me.

Is there any resources (like fppkgreposerver) that I could (re)use?

Rgds, Darius

PM Joost van der Sluis wrote 37 lines
Op 16-07-2020 om 08:37 schreef Darius Blaszyk via fpc-pascal: > I was looking for the sources of a buildbot suitable for an FPC project. I would like to keep it as simple as possible, so no webserver hassle for instance. Just simply repo sync, build, run test suite and upload to ftp. I know buildbot.net but I was hoping on finding something specifically suited for FPC. Does anything like that already exists? Any help would be appreciated. Well, there are the buildagents used by the fppkg-repository. You can use them to build fppkg-packages. Try for yourself at: https://fppkg.cnoc.nl/build (Login with your mantis or forum-account) The code of these buildagents is here, but it's not 'simple': svn.freepascal.org/FPC/svn/fpcprojects/fppkgreposerver/trunk/buildagent Easiest way is to use an existing build-environment like Jenkins. But you can also use gitlab. Look for example here: https://gitlab.freepascal.org/Joost/fpdserver/pipelines/293/builds That one is automatically build after each commit. That's done with an easy CI-script, and a kubernetes-cluster with a container with fpc installed. (It's the same kubernetes-cluster as the fppkg-repository above uses) There are so many options... Regards, Joost. _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Travis Siegel
to Darius Blaszyk

Instead of ftp, you could use something like scp (assuming you have access to the target machine, and can generate the key pairs you need).  That would allow you to simply copy the compiled executable onto the target machine, without needing any automation with passwords and the like.

Rsync can do this too, but I find scp considerably easier to use.

Darius Blaszyk wrote 69 lines
Hi Joost, Thanks for the suggestions. I had a look at the fppkgreposerver, but this is indeed more complex than I need at the moment. The project I am working on is a closed source at the moment, so making use of public build services is unfortunately not an option for me. I was considering making an instantFPC script that could be run from a cron job, or remains in an endless loop, checking the repo every x minutes, and in case it detects a commit, would execute a build script (fpmake / pmake) and then upload the created package via ftp. I have limited experience with uploading via ftp through an fpc application, but would LNet be most suited? Also interfacing (username/password) via TProcess is new to me. Is there any resources (like fppkgreposerver) that I could (re)use? Rgds, Darius On Fri, Jul 17, 2020 at 2:50 PM Joost van der Sluis < > wrote: Op 16-07-2020 om 08:37 schreef Darius Blaszyk via fpc-pascal: > I was looking for the sources of a buildbot suitable for an FPC project. I would like to keep it as simple as possible, so no webserver hassle for instance. Just simply repo sync, build, run test suite and upload to ftp. I know buildbot.net <http://buildbot.net> but I was hoping on finding something specifically suited for FPC. Does anything like that already exists? Any help would be appreciated. Well, there are the buildagents used by the fppkg-repository. You can use them to build fppkg-packages. Try for yourself at: https://fppkg.cnoc.nl/build (Login with your mantis or forum-account) The code of these buildagents is here, but it's not 'simple': svn.freepascal.org/FPC/svn/fpcprojects/fppkgreposerver/trunk/buildagent <http://svn.freepascal.org/FPC/svn/fpcprojects/fppkgreposerver/trunk/buildagent> Easiest way is to use an existing build-environment like Jenkins. But you can also use gitlab. Look for example here: https://gitlab.freepascal.org/Joost/fpdserver/pipelines/293/builds That one is automatically build after each commit. That's done with an easy CI-script, and a kubernetes-cluster with a container with fpc installed. (It's the same kubernetes-cluster as the fppkg-repository above uses) There are so many options... Regards, Joost. _______________________________________________ fpc-pascal maillist  - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Joost van der Sluis
to Darius Blaszyk: Thanks for the suggestions. I had a look at the fppkgreposerver, but this is indeed more…

Op 20-07-2020 om 11:31 schreef Darius Blaszyk via fpc-pascal:

Show quoted text 14 lines
Thanks for the suggestions. I had a look at the fppkgreposerver, but this is indeed more complex than I need at the moment. The project I am working on is a closed source at the moment, so making use of public build services is unfortunately not an option for me. I was considering making an instantFPC script that could be run from a cron job, or remains in an endless loop, checking the repo every x minutes, and in case it detects a commit, would execute a build script (fpmake / pmake) and then upload the created package via ftp. I have limited experience with uploading via ftp through an fpc application, but would LNet be most suited? Also interfacing (username/password) via TProcess is new to me. Is there any resources (like fppkgreposerver) that I could (re)use?

Actually, the fppkgreposerver also contains a (s)ftp connection. But it works as a server, you need a client.

For uploading a single file on a linux system, I would install lftp, and then call lftp using TProcess, using the --env-password option and then set tne LFTP_PASSWORD environment option in TProcess to pass the password.

This is easier than using (s)ftp directly from your application.

Regards,

Joost.

Darius Blaszyk
to Joost van der Sluis

Hi Travis & Joost,

Thanks for all your suggestions! I created a simple buildbot for FPC projects and used sfpt as the tool to upload to an FTP server. It is surprisingly stable. The buildbot is an instantFPC script that can be run in an endless loop to regularly check for new commits or can be triggered from a cron job. On finding a new commit, it pulls all changes, builds the project (lazbuild), creates a binary archive and uploads it to FTP. Build, pack and upload are bash scripts now, but I will refine the tool on accepting a configuration file to make it more versatile and uniform across platforms. I'm happy to finally have a buildbot tool with "zero" configuration that provides me daily snapshots over different platforms.

Rgds, Darius

PM Joost van der Sluis wrote 33 lines
Op 20-07-2020 om 11:31 schreef Darius Blaszyk via fpc-pascal: > Thanks for the suggestions. I had a look at the fppkgreposerver, but > this is indeed more complex than I need at the moment. The project I am > working on is a closed source at the moment, so making use of public > build services is unfortunately not an option for me. > > I was considering making an instantFPC script that could be run from a > cron job, or remains in an endless loop, checking the repo every x > minutes, and in case it detects a commit, would execute a build script > (fpmake / pmake) and then upload the created package via ftp. I have > limited experience with uploading via ftp through an fpc application, > but would LNet be most suited? Also interfacing (username/password) via > TProcess is new to me. > > Is there any resources (like fppkgreposerver) that I could (re)use? Actually, the fppkgreposerver also contains a (s)ftp connection. But it works as a server, you need a client. For uploading a single file on a linux system, I would install lftp, and then call lftp using TProcess, using the --env-password option and then set tne LFTP_PASSWORD environment option in TProcess to pass the password. This is easier than using (s)ftp directly from your application. Regards, Joost. _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal