-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.sh
executable file
·113 lines (97 loc) · 2.43 KB
/
init.sh
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
#!/bin/bash
mkdir -p spec/{cloud_configs,deployments,credhub_variables,exodus,runtime_configs}
pushd spec
go mod init $(bosh int ../kit.yml --path /code | sed 's@https://@@g')/spec
ginkgo bootstrap
cat << EOF > spec_test.go
package spec_test
import (
"path/filepath"
"runtime"
. "github.com/genesis-community/testkit/v2/testing"
. "github.com/onsi/ginkgo/v2"
// . "github.com/onsi/gomega"
)
var _ = Describe("Interal Kit", func() {
BeforeSuite(func() {
_, filename, _, _ := runtime.Caller(0)
KitDir, _ = filepath.Abs(filepath.Join(filepath.Dir(filename), "../"))
})
// Add tests by adding more blocks below.
Test(Environment{
Name: "baseline",
CloudConfig: "aws",
})
// For more usage examples reference the spec dir of testkit itself
// https://github.com/genesis-community/testkit/tree/master/internal/spec
// Test(Environment{
// Name: "ops-override",
// CloudConfig: "aws",
// RuntimeConfig: "dns",
// CPI: "aws",
// Exodus: "test-exodus",
// CredhubVars: "secret",
// Ops: []string{
// "test-ops-override",
// },
// OutputMatchers: OutputMatchers{
// GenesisAddSecrets: ContainSubstring("this-does-not-exist"),
// GenesisCheck: ContainSubstring("this-does-not-exist"),
// GenesisManifest: ContainSubstring("this-does-not-exist"),
// },
// })
})
EOF
cat << EOF > deployments/baseline.yml
kit:
name: dev
features: []
genesis:
env: baseline
EOF
cat << EOF > cloud_configs/aws.yml
azs:
- name: z1
cloud_properties:
availability_zone: [z1, z2, z3]
- name: z2
cloud_properties:
availability_zone: [z1, z2, z3]
- name: z3
cloud_properties:
availability_zone: [z1, z2, z3]
vm_types:
- name: default
cloud_properties:
instance_type: m5.large
ephemeral_disk: {size: 25_000}
- name: large
cloud_properties:
instance_type: m5.xlarge
ephemeral_disk: {size: 50_000}
disk_types:
- name: default
disk_size: 3000
- name: jumpbox
disk_size: 50_000
networks:
- name: default
type: manual
subnets:
- range: 172.31.0.0/16
gateway: 172.31.0.1
azs: [z1, z2, z3]
dns: [8.8.8.8]
reserved: [ 172.31.0.1 - 172.31.0.15 ]
static: [ 172.31.0.16 - 172.31.0.30 ]
cloud_properties:
subnet: foo-subnet
- name: vip
type: vip
compilation:
workers: 5
reuse_compilation_vms: true
az: z1
vm_type: default
network: default
EOF