-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.ps1
More file actions
executable file
·104 lines (92 loc) · 4.64 KB
/
run.ps1
File metadata and controls
executable file
·104 lines (92 loc) · 4.64 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
#!/usr/bin/env pwsh
$ErrorActionPreference = "Stop"
$BIN = $env:BIN
if (-not $BIN) { $BIN = "pact" }
& $BIN --help
& $BIN broker --help
& $BIN pactflow --help
& $BIN completions --help
& $BIN 'broker' docker --help
& $BIN plugin --help
& $BIN plugin list --help
& $BIN plugin list installed --help
& $BIN plugin list known --help
& $BIN plugin env --help
& $BIN plugin install --help
& $BIN plugin remove --help
& $BIN plugin enable --help
& $BIN plugin disable --help
& $BIN plugin repository --help
& $BIN plugin repository validate --help
& $BIN plugin repository new --help
& $BIN plugin repository add-plugin-version --help
& $BIN plugin repository add-plugin-version git-hub --help
& $BIN plugin repository add-plugin-version file --help
& $BIN plugin repository add-all-plugin-versions --help
& $BIN plugin repository yank-version --help
& $BIN plugin repository list --help
& $BIN plugin repository list-versions --help
& $BIN stub --help
& $BIN verifier --help
& $BIN mock --help
& $BIN mock start --help
& $BIN mock list --help
& $BIN mock create --help
& $BIN mock verify --help
& $BIN mock shutdown --help
& $BIN mock shutdown-master --help
try { & $BIN 'broker' ruby stop } catch {}
& $BIN 'broker' ruby start -d
& $BIN 'broker' ruby info
& $BIN 'broker' list-latest-pact-versions
& $BIN 'broker' create-environment --name name_foo1
& $BIN 'broker' create-environment --name name_foo2 --display-name display_name_foo
& $BIN 'broker' create-environment --name name_foo3 --display-name display_name_foo --contact-name contact_name_foo
& $BIN 'broker' create-environment --name name_foo4 --display-name display_name_foo --contact-name contact_name_foo --contact-email-address contact.email.address@foo.bar
$ENV_UUID = (& $BIN 'broker' create-environment --name name_foo5 --output=id).Trim()
& $BIN 'broker' describe-environment --uuid $ENV_UUID
& $BIN 'broker' update-environment --uuid $ENV_UUID --name name_foo6
& $BIN 'broker' update-environment --uuid $ENV_UUID --name name_foo7 --display-name display_name_foo6
& $BIN 'broker' update-environment --uuid $ENV_UUID --name name_foo8 --contact-name contact_name_foo8
& $BIN 'broker' update-environment --uuid $ENV_UUID --name name_foo9 --contact-name contact_name_foo9 --contact-email-address contact_name_foo7
& $BIN 'broker' delete-environment --uuid $ENV_UUID
# Delete all environments except the first and last
$envs = & $BIN 'broker' list-environments
$lines = $envs -split "`n"
# Find lines that look like environment rows (start with │ and contain ┆)
$envRows = $lines | Where-Object { $_ -match '^│' -and $_ -match '┆' }
# Extract UUIDs from each row (first column between │ and ┆)
$uuids = $envRows | ForEach-Object {
($_ -split '┆')[0] -replace '[│\s]', ''
}
foreach ($uuid in $uuids) {
& $BIN 'broker' delete-environment --uuid $uuid
}
& $BIN 'broker' create-environment --name production --production
& $BIN 'broker' publish tests/pacts -r
& $BIN 'broker' publish tests/pacts -a foo --branch bar
try {
& $BIN 'broker' can-i-deploy --pacticipant GettingStartedOrderWeb --version foo --to prod
} catch {
Write-Host "can-i-deploy fails due to no verification result - expected"
}
& $BIN 'broker' can-i-deploy --pacticipant GettingStartedOrderWeb --version foo --to prod --dry-run
& $BIN 'broker' record-deployment --version foo --environment production --pacticipant GettingStartedOrderWeb
& $BIN 'broker' record-undeployment --environment production --pacticipant GettingStartedOrderWeb
& $BIN 'broker' record-release --version foo --environment production --pacticipant GettingStartedOrderWeb
& $BIN 'broker' record-support-ended --version foo --environment production --pacticipant GettingStartedOrderWeb
& $BIN 'broker' create-or-update-pacticipant --name foo --main-branch main --repository-url http://foo.bar
& $BIN 'broker' describe-pacticipant --name foo
& $BIN 'broker' list-pacticipants
& $BIN 'broker' create-webhook https://localhost --request POST --contract-published
$WEBHOOK_UUID = (& $BIN 'broker' create-webhook https://localhost --request POST --contract-published | ConvertFrom-Json).uuid
& $BIN 'broker' create-or-update-webhook https://foo.bar --request POST --uuid $WEBHOOK_UUID --provider-verification-succeeded
& $BIN 'broker' test-webhook --uuid $WEBHOOK_UUID
& $BIN 'broker' create-or-update-version --version foo --pacticipant foo --branch bar --tag baz
& $BIN 'broker' create-version-tag --version foo --pacticipant foo --tag bar
& $BIN 'broker' describe-version --pacticipant foo
& $BIN 'broker' can-i-merge --pacticipant foo --version foo
& $BIN 'broker' delete-branch --branch bar --pacticipant foo
& $BIN 'broker' describe-pacticipant --name foo
& $BIN 'broker' generate-uuid
& $BIN 'broker' ruby stop