-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathproject.yaml
More file actions
33 lines (30 loc) · 1.11 KB
/
project.yaml
File metadata and controls
33 lines (30 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# yaml-language-server: $schema=https://schemas.brigade.sh/schemas-v2/project.json
apiVersion: brigade.sh/v2
kind: Project
metadata:
id: shared-workspace
description: Demonstrates a workspace shared across jobs
spec:
eventSubscriptions:
- source: brigade.sh/cli
types:
- exec
workerTemplate:
# logLevel: DEBUG
useWorkspace: true
defaultConfigFiles:
brigade.js: |
const { events, Job } = require("@brigadecore/brigadier");
events.on("brigade.sh/cli", "exec", async event => {
let job1 = new Job("first-job", "debian:latest", event);
job1.primaryContainer.workspaceMountPath = "/share";
job1.primaryContainer.command = ["bash"];
job1.primaryContainer.arguments = ["-c", "echo 'Hello!' > /share/message"];
await job1.run();
let job2 = new Job("second-job", "debian:latest", event);
job2.primaryContainer.workspaceMountPath = "/share";
job2.primaryContainer.command = ["cat"];
job2.primaryContainer.arguments = ["/share/message"];
await job2.run();
});
events.process();