3 # This script creates a project, a jobset with an input of type local
4 # path. This local path is a directory that contains a Nix expression
6 # The EXPR-PATH environment variable must be set with the local path.
10 URL
=http
://localhost
:3000
13 PROJECT_NAME
="trivial"
15 EXPR_PATH
=${EXPR_PATH:-}
17 if [ -z $EXPR_PATH ]; then
18 echo "Environment variable EXPR_PATH must be set"
23 curl
--referer $URL -H "Accept: application/json" -H "Content-Type: application/json" $@
27 { "username": "$USERNAME", "password": "$PASSWORD" }
29 mycurl
-X POST
-d '@data.json' $URL/login
-c hydra-cookie.txt
33 "displayname":"Trivial",
38 mycurl
--silent -X PUT
$URL/project
/$PROJECT_NAME -d @data.json
-b hydra-cookie.txt
42 "description": "Trivial",
43 "checkinterval": "60",
48 "emailoverride": "hydra@localhost",
49 "nixexprinput": "trivial",
50 "nixexprpath": "trivial.nix",
53 "value": "$EXPR_PATH",
59 mycurl
--silent -X PUT
$URL/jobset
/$PROJECT_NAME/$JOBSET_NAME -d @data.json
-b hydra-cookie.txt