Last active
August 20, 2021 16:13
-
-
Save jwhitlock/24475309dab548f15cba248dcb98ddef to your computer and use it in GitHub Desktop.
Taskcluster task for Poucave issue #851
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
taskQueueId: proj-taskcluster/gw-ci-ubuntu-18-04 | |
schedulerId: taskcluster-ui | |
created: '2021-08-20T16:06:31.635Z' | |
deadline: '2021-08-20T19:06:31.635Z' | |
payload: | |
command: | |
- - /bin/bash | |
- -c | |
- which python3 && python -V && which curl && curl --version | |
- - /bin/bash | |
- -c | |
- mkdir -p workspace/results | |
- - /usr/bin/curl | |
- --silent | |
- -o | |
- task1.py | |
- https://gist.githubusercontent.com/jwhitlock/24475309dab548f15cba248dcb98ddef/raw/ac0f0d4466560cf1a1ba05c16285f86520f5ecb0/task1.py | |
- - /usr/bin/python3 | |
- task1.py | |
- '--output' | |
- workspace/results/status.json | |
- - /bin/bash | |
- -c | |
- 'echo {\"msg\": \"Hello, world!\", \"status\": \"OK\"} > workspace/results/status2.json' | |
maxRunTime: 630 | |
artifacts: | |
- name: public/results | |
path: workspace/results | |
type: directory | |
routes: | |
- index.project.taskcluster.telescope.poucave-issue-851-test.05 | |
extra: | |
index: | |
expires: '2021-08-27T13:54:29.891Z' | |
data: | |
description: > | |
Create a task that Poucave can check for completion. See | |
[Poucave issue 851](https://github.com/mozilla-services/poucave/issues/851). | |
Resources stored in | |
[gist 24475309d](https://gist.github.com/jwhitlock/24475309dab548f15cba248dcb98ddef). | |
metadata: | |
name: poucave-issue-851-test-05 | |
description: > | |
Create a task that Poucave can check for completion. See | |
[Poucave issue 851](https://github.com/mozilla-services/poucave/issues/851). | |
Resources stored in | |
[gist 24475309d](https://gist.github.com/jwhitlock/24475309dab548f15cba248dcb98ddef). | |
owner: [email protected] | |
source: https://community-tc.services.mozilla.com/tasks/create |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import json | |
import sys | |
def get_status(): | |
return { | |
"msg": "Hello, world!", | |
"status": "OK" | |
} | |
def write_status(status, output_file): | |
json.dump(status, output_file) | |
def get_parser(): | |
parser = argparse.ArgumentParser( | |
description="Task 1 for Poucave issue #851.") | |
parser.add_argument( | |
'--output', | |
help="Output path") | |
return parser | |
if __name__ == "__main__": | |
parser = get_parser() | |
args = parser.parse_args() | |
status = get_status() | |
with open(args.output, 'w') as output_file: | |
write_status(status, output_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment