|
| 1 | +package buildkite |
| 2 | + |
| 3 | +/** |
| 4 | + * Buildkite Environment Variables |
| 5 | + * A Groovy enum equivalent to the TypeScript EnvironmentVariable |
| 6 | + */ |
| 7 | +enum EnvironmentVariable { |
| 8 | + /** |
| 9 | + * Always `true` |
| 10 | + */ |
| 11 | + BUILDKITE("BUILDKITE"), |
| 12 | + |
| 13 | + /** |
| 14 | + * The agent session token for the job. The variable is read by the agent `artifact` and `meta-data` commands. |
| 15 | + */ |
| 16 | + BUILDKITE_AGENT_ACCESS_TOKEN("BUILDKITE_AGENT_ACCESS_TOKEN"), |
| 17 | + |
| 18 | + /** |
| 19 | + * The value of the `debug` agent configuration option. |
| 20 | + */ |
| 21 | + BUILDKITE_AGENT_DEBUG("BUILDKITE_AGENT_DEBUG"), |
| 22 | + |
| 23 | + /** |
| 24 | + * The value of the `disconnect-after-job` agent configuration option. |
| 25 | + */ |
| 26 | + BUILDKITE_AGENT_DISCONNECT_AFTER_JOB("BUILDKITE_AGENT_DISCONNECT_AFTER_JOB"), |
| 27 | + |
| 28 | + /** |
| 29 | + * The value of the `disconnect-after-idle-timeout` agent configuration option. |
| 30 | + */ |
| 31 | + BUILDKITE_AGENT_DISCONNECT_AFTER_IDLE_TIMEOUT("BUILDKITE_AGENT_DISCONNECT_AFTER_IDLE_TIMEOUT"), |
| 32 | + |
| 33 | + /** |
| 34 | + * The value of the `endpoint` agent configuration option. |
| 35 | + */ |
| 36 | + BUILDKITE_AGENT_ENDPOINT("BUILDKITE_AGENT_ENDPOINT"), |
| 37 | + |
| 38 | + /** |
| 39 | + * A list of the experimental agent features that are currently enabled. |
| 40 | + */ |
| 41 | + BUILDKITE_AGENT_EXPERIMENT("BUILDKITE_AGENT_EXPERIMENT"), |
| 42 | + |
| 43 | + /** |
| 44 | + * The value of the `health-check-addr` agent configuration option. |
| 45 | + */ |
| 46 | + BUILDKITE_AGENT_HEALTH_CHECK_ADDR("BUILDKITE_AGENT_HEALTH_CHECK_ADDR"), |
| 47 | + |
| 48 | + /** |
| 49 | + * The UUID of the agent. |
| 50 | + */ |
| 51 | + BUILDKITE_AGENT_ID("BUILDKITE_AGENT_ID"), |
| 52 | + |
| 53 | + /** |
| 54 | + * The value of each agent tag. |
| 55 | + */ |
| 56 | + BUILDKITE_AGENT_META_DATA_("BUILDKITE_AGENT_META_DATA_"), |
| 57 | + |
| 58 | + /** |
| 59 | + * The name of the agent that ran the job. |
| 60 | + */ |
| 61 | + BUILDKITE_AGENT_NAME("BUILDKITE_AGENT_NAME"), |
| 62 | + |
| 63 | + /** |
| 64 | + * The process ID of the agent. |
| 65 | + */ |
| 66 | + BUILDKITE_AGENT_PID("BUILDKITE_AGENT_PID"), |
| 67 | + |
| 68 | + /** |
| 69 | + * The artifact paths to upload after the job, if any have been specified. |
| 70 | + */ |
| 71 | + BUILDKITE_ARTIFACT_PATHS("BUILDKITE_ARTIFACT_PATHS"), |
| 72 | + |
| 73 | + /** |
| 74 | + * The path where artifacts will be uploaded. |
| 75 | + */ |
| 76 | + BUILDKITE_ARTIFACT_UPLOAD_DESTINATION("BUILDKITE_ARTIFACT_UPLOAD_DESTINATION"), |
| 77 | + |
| 78 | + /** |
| 79 | + * The path to the directory containing the `buildkite-agent` binary. |
| 80 | + */ |
| 81 | + BUILDKITE_BIN_PATH("BUILDKITE_BIN_PATH"), |
| 82 | + |
| 83 | + /** |
| 84 | + * The branch being built. |
| 85 | + */ |
| 86 | + BUILDKITE_BRANCH("BUILDKITE_BRANCH"), |
| 87 | + |
| 88 | + /** |
| 89 | + * The path where the agent has checked out your code for this build. |
| 90 | + */ |
| 91 | + BUILDKITE_BUILD_CHECKOUT_PATH("BUILDKITE_BUILD_CHECKOUT_PATH"), |
| 92 | + |
| 93 | + /** |
| 94 | + * The name of the user who authored the commit being built. |
| 95 | + */ |
| 96 | + BUILDKITE_BUILD_AUTHOR("BUILDKITE_BUILD_AUTHOR"), |
| 97 | + |
| 98 | + /** |
| 99 | + * The notification email of the user who authored the commit being built. |
| 100 | + */ |
| 101 | + BUILDKITE_BUILD_AUTHOR_EMAIL("BUILDKITE_BUILD_AUTHOR_EMAIL"), |
| 102 | + |
| 103 | + /** |
| 104 | + * The name of the user who created the build. |
| 105 | + */ |
| 106 | + BUILDKITE_BUILD_CREATOR("BUILDKITE_BUILD_CREATOR"), |
| 107 | + |
| 108 | + /** |
| 109 | + * The notification email of the user who created the build. |
| 110 | + */ |
| 111 | + BUILDKITE_BUILD_CREATOR_EMAIL("BUILDKITE_BUILD_CREATOR_EMAIL"), |
| 112 | + |
| 113 | + /** |
| 114 | + * A colon separated list of non-private team slugs that the build creator belongs to. |
| 115 | + */ |
| 116 | + BUILDKITE_BUILD_CREATOR_TEAMS("BUILDKITE_BUILD_CREATOR_TEAMS"), |
| 117 | + |
| 118 | + /** |
| 119 | + * The UUID of the build. |
| 120 | + */ |
| 121 | + BUILDKITE_BUILD_ID("BUILDKITE_BUILD_ID"), |
| 122 | + |
| 123 | + /** |
| 124 | + * The build number. |
| 125 | + */ |
| 126 | + BUILDKITE_BUILD_NUMBER("BUILDKITE_BUILD_NUMBER"), |
| 127 | + |
| 128 | + /** |
| 129 | + * The value of the `build-path` agent configuration option. |
| 130 | + */ |
| 131 | + BUILDKITE_BUILD_PATH("BUILDKITE_BUILD_PATH"), |
| 132 | + |
| 133 | + /** |
| 134 | + * The url for this build on Buildkite. |
| 135 | + */ |
| 136 | + BUILDKITE_BUILD_URL("BUILDKITE_BUILD_URL"), |
| 137 | + |
| 138 | + /** |
| 139 | + * The value of the `cancel-grace-period` agent configuration option in seconds. |
| 140 | + */ |
| 141 | + BUILDKITE_CANCEL_GRACE_PERIOD("BUILDKITE_CANCEL_GRACE_PERIOD"), |
| 142 | + |
| 143 | + /** |
| 144 | + * The value of the `cancel-signal` agent configuration option. |
| 145 | + */ |
| 146 | + BUILDKITE_CANCEL_SIGNAL("BUILDKITE_CANCEL_SIGNAL"), |
| 147 | + |
| 148 | + /** |
| 149 | + * Whether the build should perform a clean checkout. |
| 150 | + */ |
| 151 | + BUILDKITE_CLEAN_CHECKOUT("BUILDKITE_CLEAN_CHECKOUT"), |
| 152 | + |
| 153 | + /** |
| 154 | + * The UUID value of the cluster. |
| 155 | + */ |
| 156 | + BUILDKITE_CLUSTER_ID("BUILDKITE_CLUSTER_ID"), |
| 157 | + |
| 158 | + /** |
| 159 | + * The command that will be run for the job. |
| 160 | + */ |
| 161 | + BUILDKITE_COMMAND("BUILDKITE_COMMAND"), |
| 162 | + |
| 163 | + /** |
| 164 | + * The opposite of the value of the `no-command-eval` agent configuration option. |
| 165 | + */ |
| 166 | + BUILDKITE_COMMAND_EVAL("BUILDKITE_COMMAND_EVAL"), |
| 167 | + |
| 168 | + /** |
| 169 | + * The exit code from the last command run in the command hook. |
| 170 | + */ |
| 171 | + BUILDKITE_COMMAND_EXIT_STATUS("BUILDKITE_COMMAND_EXIT_STATUS"), |
| 172 | + |
| 173 | + /** |
| 174 | + * The git commit object of the build. |
| 175 | + */ |
| 176 | + BUILDKITE_COMMIT("BUILDKITE_COMMIT"), |
| 177 | + |
| 178 | + /** |
| 179 | + * The path to the agent config file. |
| 180 | + */ |
| 181 | + BUILDKITE_CONFIG_PATH("BUILDKITE_CONFIG_PATH"), |
| 182 | + |
| 183 | + /** |
| 184 | + * The path to the file containing the job's environment variables. |
| 185 | + */ |
| 186 | + BUILDKITE_ENV_FILE("BUILDKITE_ENV_FILE"), |
| 187 | + |
| 188 | + // More environment variables would be added here... |
| 189 | + |
| 190 | + /** |
| 191 | + * Always `true`. |
| 192 | + */ |
| 193 | + CI("CI") |
| 194 | + |
| 195 | + private final String value |
| 196 | + |
| 197 | + private EnvironmentVariable(String value) { |
| 198 | + this.value = value |
| 199 | + } |
| 200 | + |
| 201 | + @Override |
| 202 | + String toString() { |
| 203 | + return value |
| 204 | + } |
| 205 | +} |
0 commit comments