I'm trying to create a simple build plan using Harbormaster and Drydock:
Whenever a commit is made the build plan Deployment
should be triggered. This can be easily done with Harold.
The build plan Deployment
has some build steps which run a command.
I know Drydock and Harbormaster are prototypes so it seems there is no much documentation.
So first I've created a build plan and added two build steps for testing:
Lease Host
build step with localhost
as name and linux
as platformRun Command
build step with php /var/www/ci/test.php
as command and localhost
as hostBut the error message after a manual start was:
exception 'Exception' with message 'Lease has been broken!' in /var/www/phabricator/src/applications/drydock/storage/DrydockLease.php:172
Stack trace:
#0 /var/www/phabricator/src/applications/drydock/storage/DrydockLease.php(198): DrydockLease::waitForLeases(Array)
#1 /var/www/phabricator/src/applications/harbormaster/step/HarbormasterLeaseHostBuildStepImplementation.php(32): DrydockLease->waitUntilActive()
#2 /var/www/phabricator/src/applications/harbormaster/worker/HarbormasterTargetWorker.php(52): HarbormasterLeaseHostBuildStepImplementation->execute(Object(HarbormasterBuild), Object(HarbormasterBuildTarget))
#3 /var/www/phabricator/src/infrastructure/daemon/workers/PhabricatorWorker.php(91): HarbormasterTargetWorker->doWork()
#4 /var/www/phabricator/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php(162): PhabricatorWorker->executeTask()
#5 /var/www/phabricator/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php(22): PhabricatorWorkerActiveTask->executeTask()
#6 /var/www/libphutil/src/daemon/PhutilDaemon.php(183): PhabricatorTaskmasterDaemon->run()
#7 /var/www/libphutil/scripts/daemon/exec/exec_daemon.php(125): PhutilDaemon->execute()
#8 {main}
Could anybody give me some hints how to run commands on localhost with Harbormaster and Drydock?
The problem was that I have not created any resource through Drydock. Here how you can get execute a command with Harbormaster and Drydock:
Blueprint 4711
).K123
).Create a Drydock Resource through the CLI for your local host:
./bin/drydock create-resource --blueprint 4711 --name localhost --attributes host=localhost,platform=linux,remote=true,port=22,path=/var/drydock,credential=123
Create a Harbormaster Build Plan.
Lease Host
) to your Build Plan, use your Drydock Blueprint as Artifact
and linux
as Platform
.Run Command
) with the command you want and your Drydock Blueprint as Host
.Using the server itself for CD/CI might be only an option for small installations.