Skip to content

Commit

Permalink
fix: add build warning documentation (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
klu909 authored Oct 13, 2023
1 parent 20ede12 commit d031fd0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
Binary file added docs/user-guide/assets/warning-event-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user-guide/assets/warning-message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 31 additions & 1 deletion docs/user-guide/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ toc:
- title: Job-based minimized setting
url: "#job-based-minimized-setting"
subitem: level-2
- title: Mark Builds and Set Warnings
url: "#mark-builds-and-set-warnings"
subitem: true
- title: Using Lua for atomic updates
url: "#using-lua-for-atomic-updates"
subitem: true
Expand Down Expand Up @@ -329,6 +332,33 @@ jobs:
```
In the above example a Slack notification message will be send in `minimized` format for the `component` job if it was triggered by the scheduler.

### Mark Builds and Set Warnings

You can mark builds/events with warning status by setting `build.warning`.

Example screwdriver.yaml:
```yaml
jobs:
main:
steps:
- warning: meta set build.warning true
```
Result:
![warning-event-tab](./assets/warning-event-tab.png)

Additionally you can also set warning messages
Example screwdriver.yaml:
```yaml
jobs:
main:
steps:
- setWarning: meta set build.warning.message "this is a warning message"
- setAnotherWarning: meta set build.warning.anotherMessage "this is another warning message"
```
Result:
![warning-message](./assets/warning-message.png)
*Note*: Only builds/events with successful status will be marked, warning message will still be displayed in build detail page regardless of build/event status

### Using [Lua](https://www.lua.org/) for atomic updates

The `meta` tool creates a lock file, and holds a [flock](https://linux.die.net/man/2/flock) around each of its
Expand Down Expand Up @@ -394,4 +424,4 @@ meta.set(key, array)
-- print the index
-- NOTE: index for meta.(get/set) purposes is 0-based, so subtract 1 from the array size
print(#array - 1)
```
```
2 changes: 1 addition & 1 deletion screwdriver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- bundle_install: bundle install
- build: bundle exec jekyll build --source docs --destination _site
- proof: bundle exec htmlproofer --assume-extension --allow-hash-href --url-ignore '/bitbucket/,/gitlab/,/api\.screwdriver\.cd/,/github\.com/,/kubernetes\.io/,/opensource\.org/,/twitter\.com/' --http-status-ignore 429 _site
- proof: bundle exec htmlproofer --assume-extension --allow-hash-href --url-ignore '/bitbucket/,/gitlab/,/api\.screwdriver\.cd/,/github\.com/,/kubernetes\.io/,/opensource\.org/,/twitter\.com/,/linux\.die\.net/' --http-status-ignore 429 _site

publish:
image: ruby:2
Expand Down

0 comments on commit d031fd0

Please sign in to comment.