nixpkgs/nixos
Bjørn Forsman 8ebfd5c45c nixos/jenkins-job-builder: stop reloadScript on error
Currently there are two calls to curl in the reloadScript, neither which
check for errors. If something is misconfigured (like wrong authToken),
the only trace that something wrong happened is this log message:

  Asking Jenkins to reload config
  <h1>Bad Message 400</h1><pre>reason: Illegal character VCHAR='<'</pre>

The service isn't marked as failed, so it's easy to miss.

Fix it by passing --fail to curl.

While at it:
* Add $curl_opts and $jenkins_url variables to keep the curl command
  lines DRY.
* Add --show-error to curl to show short error message explanation when
  things go wrong (like HTTP 401 error).
* Lower-case the $CRUMB variable as upper case is for exported environment
  variables.

The new behaviour, when having wrong accessToken:

  Asking Jenkins to reload config
  curl: (22) The requested URL returned error: 401

And the service is clearly marked as failed in `systemctl --failed`.
2018-12-03 17:07:29 +01:00
..
doc Merge pull request #51329 from c0bw3b/cleanup/gnu-https 2018-12-02 16:52:33 +01:00
lib Fix nixops evaluation 2018-11-26 23:12:31 +00:00
maintainers google-compute-image: make it a module and the size tuneable (#49854) 2018-11-26 14:51:00 +00:00
modules nixos/jenkins-job-builder: stop reloadScript on error 2018-12-03 17:07:29 +01:00
tests Merge pull request #48423 from charles-dyfis-net/bees 2018-12-02 18:38:47 +01:00
COPYING
default.nix
README
release-combined.nix
release-small.nix
release.nix tests: split into a separate all-tests.nix file 2018-11-11 23:11:46 +09:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.