Skip to content

Commit

Permalink
Improve Bruno build job examples (Failing and Successful builds)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mtze committed Aug 13, 2024
1 parent c9fa36a commit 1537c01
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
meta {
name: Create Build Job
name: Create Build Job (Test Fail)
type: http
seq: 2
}
Expand All @@ -13,7 +13,9 @@ post {
body:json {
{
"name": "Example Job",
"metadata": {}, // global metadata
"metadata": {
"GLOBAL": "test"
},
"timestamp": "2021-01-01T00:00:00.000Z",
"priority": 3, // optional, default 3
"steps": [
Expand All @@ -39,15 +41,15 @@ body:json {
"id": 2, // mandatory to declare the order of execution
"name": "Execute",
"image": "ls1tum/artemis-maven-template:java17-18", // mandatory
"script": "cd ./example && ./gradlew --status && ./gradlew clean test"
"script": "set +e && cd ./shared/example || exit 0 && ./gradlew --status || exit 0 && ./gradlew clean test || exit 0"
}
]
}
}

vars:pre-request {
user: {{process.env.USERNAME}}
password: {{process.env.PASSWORD}}
test_repo: {{process.env.TEST_REPO}}
assignment_repo: {{process.env.ASSIGNMENT_REPO}}
user: ""
password: ""
test_repo: "https://github.com/Mtze/Artemis-Java-Test.git"
assignment_repo: "https://github.com/Mtze/Artemis-Java-Template.git"
}
55 changes: 55 additions & 0 deletions docs/api/Create Build Job (Test Succeed).bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
meta {
name: Create Build Job (Test Succeed)
type: http
seq: 2
}

post {
url: http://{{hostname}}/build
body: json
auth: none
}

body:json {
{
"name": "Example Job",
"metadata": {
"GLOBAL": "test"
},
"timestamp": "2021-01-01T00:00:00.000Z",
"priority": 3, // optional, default 3
"steps": [
{
"id": 1, // mandatory to declare the order of execution
"name": "Clone",
"image": "ghcr.io/ls1intum/hades/hades-clone-container:latest", // mandatory
"metadata": {
"REPOSITORY_DIR": "/shared",
"HADES_TEST_USERNAME": "{{user}}",
"HADES_TEST_PASSWORD": "{{password}}",
"HADES_TEST_URL": "{{test_repo}}",
"HADES_TEST_PATH": "./example",
"HADES_TEST_ORDER": "1",
"HADES_ASSIGNMENT_USERNAME": "{{user}}",
"HADES_ASSIGNMENT_PASSWORD": "{{password}}",
"HADES_ASSIGNMENT_URL": "{{assignment_repo}}",
"HADES_ASSIGNMENT_PATH": "./example/assignment",
"HADES_ASSIGNMENT_ORDER": "2"
}
},
{
"id": 2, // mandatory to declare the order of execution
"name": "Execute",
"image": "ls1tum/artemis-maven-template:java17-18", // mandatory
"script": "set +e && cd ./shared/example || exit 0 && ./gradlew --status || exit 0 && ./gradlew clean test || exit 0"
}
]
}
}

vars:pre-request {
user: ""
password: ""
test_repo: "https://github.com/Mtze/Artemis-Java-Test.git"
assignment_repo: "https://github.com/Mtze/Artemis-Java-Solution.git"
}
2 changes: 1 addition & 1 deletion docs/environments/Local-Development.bru
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vars {
hostname: localhost:8080
hostname: localhost:8081
}

0 comments on commit 1537c01

Please sign in to comment.