aboutsummaryrefslogtreecommitdiff
path: root/bbot/worker/worker.cli
blob: cd7159a2489a0b07651de736d192f7f26e8bb9ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// file      : bbot/worker.cli
// license   : MIT; see accompanying LICENSE file

include <bbot/common.cli>;

"\section=1"
"\name=bbot-worker"
"\summary=build bot worker"

namespace bbot
{
  {
    "<options> <module> <cfg-var>",

    "
    \h|SYNOPSIS|

    \c{\b{bbot-worker --help}\n
       \b{bbot-worker --version}\n
       \b{bbot-worker --bootstrap} [<options>]\n
       \b{bbot-worker --startup} [<options>]\n
       \b{bbot-worker} [<options>] <module>... <cfg-var>...}

    \h|DESCRIPTION|

    \cb{bbot-worker} @@ TODO.

    If the \cb{--bootstrap} mode option is specified, then the worker performs
    the initial machine bootstrap and writes the bootstrap result manifest to
    \c{stdout}. If the \cb{--startup} mode option is specified, then the
    worker performs the environment setup and then re-executes in the build
    mode. If neither of the mode options is specified, then the worker
    proceeds to performing the build task.
    "
  }

  class worker_options
  {
    "\h|OPTIONS|"

    //
    // NOTE: when adding new options, consider whether they should be
    //       propagated from startup to build.
    //

    bool --help {"Print usage information and exit."}
    bool --version {"Print version and exit."}

    uint16_t --verbose = 1
    {
      "<level>",
      "Set the diagnostics verbosity to <level> between 0 and 6 with level 1
       being the default."
    }

    bool --bootstrap
    {
      "Perform the inital machine bootstrap insteading of building."
    }

    bool --startup
    {
      "Perform the environment setup and then re-execute for building."
    }

    bool --systemd-daemon
    {
      "Run as a simple systemd daemon."
    }

    dir_path --build
    {
      "<dir>",
      "The directory to perform the build in. If not specified, then the
       current working directory is used."
    }

    dir_path --environments
    {
      "<dir>",
      "The directory containing the environment setup executables. If not
       specified, then the user's home directory is used."
    }

    path --env-script
    {
      "<path>",
      "The environment setup executable path. This option is normally passed
       by the worker running in the startup mode to the worker executed in the
       build mode."
    }

    string --env-target
    {
      "<target>",
      "The environment setup executable target argument. This option is
       normally passed by the worker running in the startup mode to the worker
       executed in the build mode."
    }

    // Testing options.
    //
    string --tftp-host = "196.254.111.222"
    {
      "<addr>",
      "The TFTP host address and, optionally, port to use to download the
       build task and to upload the build result. By default the link-local
       address 196.254.111.222 with the standard TFTP port (69) is used."
    }
  };

  "
  \h|EXIT STATUS|

  Non-zero exit status is returned in case of an error. In the build mode,
  exit code 2 is used to signal abnormal termination where the worker
  uploaded the result manifest itself.
  "
}