-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.hcl
More file actions
132 lines (102 loc) · 3.46 KB
/
tasks.hcl
File metadata and controls
132 lines (102 loc) · 3.46 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Task Resources for Demo Lab
# Validation Chapter: Catching Typos
resource "task" "validation_typo" {
description = "Identify and fix the typo error caught by static validation"
config {
target = resource.container.workstation
}
condition "error_identified" {
description = "Validation output reviewed and error understood"
setup {
script = "scripts/validation-demos/setup-typo.sh"
}
check {
script = "scripts/validation-demos/check-typo-error-identified.sh"
failure_message = "Have you run 'instruqt lab validate'?"
}
}
condition "typo_corrected" {
description = "Resource reference spelling corrected"
check {
script = "scripts/validation-demos/check-typo-fixed.sh"
failure_message = "Check spelling in example-typo.hcl. Does 'prometeus' look correct?"
}
solve {
script = "scripts/validation-demos/solve-typo.sh"
}
}
}
# Validation Chapter: Task-Component Mismatch
resource "task" "validation_task_mismatch" {
description = "Map the task component to its task resource in the activities block"
config {
target = resource.container.workstation
}
condition "error_identified" {
description = "Validation output reviewed and mismatch error understood"
setup {
script = "scripts/validation-demos/setup-task-mismatch.sh"
}
check {
script = "scripts/validation-demos/check-task-mismatch-error-identified.sh"
failure_message = "Have you run 'instruqt lab validate' to see the mismatch error?"
}
}
condition "mismatch_resolved" {
description = "Task component mapped in page activities block"
check {
script = "scripts/validation-demos/check-task-mismatch-fixed.sh"
failure_message = "Add the activities mapping in content.hcl to connect the task component to its task resource"
}
solve {
script = "scripts/validation-demos/solve-task-mismatch.sh"
}
}
}
# Validation Chapter: Missing Script File
resource "task" "validation_missing_file" {
description = "Create the missing script file referenced in the task check"
config {
target = resource.container.workstation
}
condition "error_identified" {
description = "Validation output reviewed and missing file error understood"
setup {
script = "scripts/validation-demos/setup-missing-file.sh"
}
check {
script = "scripts/validation-demos/check-missing-file-error-identified.sh"
failure_message = "Have you run 'instruqt lab validate' to see the missing file error?"
}
}
condition "script_created" {
description = "Missing script file created"
check {
script = "scripts/validation-demos/check-missing-file-fixed.sh"
failure_message = "Create the missing script file referenced in the task check"
}
solve {
script = "scripts/validation-demos/solve-missing-file.sh"
}
}
}
# Git-Native Collaboration: Conflict Resolution
resource "task" "git_conflict_resolution" {
description = "Successfully resolve a git merge conflict"
config {
target = resource.container.workstation
}
condition "conflict_resolved" {
description = "Git conflict resolved and pushed"
setup {
script = "scripts/git-demos/setup-conflict-demo.sh"
}
check {
script = "scripts/git-demos/check-conflict-resolved.sh"
failure_message = "Resolve the conflict in instructions/intro.md and push to origin"
}
solve {
script = "scripts/git-demos/solve-conflict.sh"
}
}
}