CustomBuild 2.0 rev. 2369 with steroids

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,911
Location
LT, EU
Hello,

CB 2.0 rev. 2369 has been released. It's a huge release for developers :) As it now lets you overwrite any call, execute pre/post hooks etc. For example, you could now:
1) create "./build varnish" or just overwrite regular "./build apache" call with whatever you want by using pre-call hook and 'exiting' at the end
2) execute anything before/after CustomBuild command, for example, after update_versions you could mail yourself/server-owner a message that updates have been applied

All CustomBuild variables are reachable in 'hooks', structure is /usr/local/directadmin/custombuild/custom/hooks/command/pre/anything.sh (pre could be post as well), for example, you could try custom/hooks/versions/pre/test.sh with the following content:
Code:
#!/bin/sh
echo "Oh yeah! My PHP version is ${PHP1_RELEASE_OPT}, and I'm just exiting with a strange error code instead of listing the version updates...."
exit 4
If you'd like to just finish the function, "return" instead of "exit" could be used.

For per-function hooks - if any are needed, just create a ticket/mail us, and they'll be added :)

In addition to this, CB 2.0 rev. 2369 includes update_versions_full, update_full and update_versions full calls, they all do the same:
1) Update OS packages
2) Update CustomBuild and CustomBuild packages

Everything with just a single call.
 

wattie

Verified User
Joined
May 31, 2008
Messages
1,083
Location
Bulgaria
All that I can say is simply... AWESOME JOB! Thank you! Now it's a peace of cake to apply custom patches when needed.

Regarding "update_full" - we may need some additional info regarding what exactly it does. For example in FreeBSD - is it calling freebsd-update and/or updating all ports?
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,911
Location
LT, EU
All that I can say is simply... AWESOME JOB! Thank you! Now it's a peace of cake to apply custom patches when needed.

Regarding "update_full" - we may need some additional info regarding what exactly it does. For example in FreeBSD - is it calling freebsd-update and/or updating all ports?
“pkg -y upgrade” for now.
 

duntuk

Verified User
Joined
Jan 23, 2007
Messages
49
I think we need some useful examples utilizing this new feature. Like a HOW-TO with practical examples.
 

asumos

New member
Joined
Feb 4, 2020
Messages
1
i've renamed my default username, when trying to update custombuild i get

chown: invalid group: 'root:admin'
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,911
Location
LT, EU
i've renamed my default username, when trying to update custombuild i get

chown: invalid group: 'root:admin'
It's not related to the version announced. It can be ignored, unless you have any particular problem with it?
 

Erulezz

Verified User
Joined
Sep 14, 2015
Messages
437
Location
Arnhem, NL
Can I also add a post hook for the cronjob? In addition to the email that's being send when there is a update available, I would like to call a simple command:

Code:
/root/pushover-notification/notification.sh "title" "updates that are available"
So that I can also receive Pushover notifications when there are updates available.
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,911
Location
LT, EU
Can I also add a post hook for the cronjob? In addition to the email that's being send when there is a update available, I would like to call a simple command:

Code:
/root/pushover-notification/notification.sh "title" "updates that are available"
So that I can also receive Pushover notifications when there are updates available.
Check CB 2.0 rev. 2048:
Added custom/hooks/cron_execute/pre and custom/hooks/cron_execute/post hooks for pre/post execution of the CustomBuild cronjob. "./build cron" is needed to re-generate the cronjob which uses the hooks.
 
Top