python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / tests / hydra / create-trivial-project.sh
blob5aae2d5bf90d635ffe7938f01bad22d025fffc11
1 #!/usr/bin/env bash
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
5 # to define a job.
6 # The EXPR-PATH environment variable must be set with the local path.
8 set -e
10 URL=http://localhost:3000
11 USERNAME="admin"
12 PASSWORD="admin"
13 PROJECT_NAME="trivial"
14 JOBSET_NAME="trivial"
15 EXPR_PATH=${EXPR_PATH:-}
17 if [ -z $EXPR_PATH ]; then
18 echo "Environment variable EXPR_PATH must be set"
19 exit 1
22 mycurl() {
23 curl --referer $URL -H "Accept: application/json" -H "Content-Type: application/json" $@
26 cat >data.json <<EOF
27 { "username": "$USERNAME", "password": "$PASSWORD" }
28 EOF
29 mycurl -X POST -d '@data.json' $URL/login -c hydra-cookie.txt
31 cat >data.json <<EOF
33 "displayname":"Trivial",
34 "enabled":"1",
35 "visible":"1"
37 EOF
38 mycurl --silent -X PUT $URL/project/$PROJECT_NAME -d @data.json -b hydra-cookie.txt
40 cat >data.json <<EOF
42 "description": "Trivial",
43 "checkinterval": "60",
44 "enabled": "1",
45 "visible": "1",
46 "keepnr": "1",
47 "enableemail": true,
48 "emailoverride": "hydra@localhost",
49 "nixexprinput": "trivial",
50 "nixexprpath": "trivial.nix",
51 "inputs": {
52 "trivial": {
53 "value": "$EXPR_PATH",
54 "type": "path"
58 EOF
59 mycurl --silent -X PUT $URL/jobset/$PROJECT_NAME/$JOBSET_NAME -d @data.json -b hydra-cookie.txt