-
Notifications
You must be signed in to change notification settings - Fork 13
/
activestate.generators.yaml
132 lines (123 loc) · 5.33 KB
/
activestate.generators.yaml
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
scripts:
- name: generate-api-client
language: bash
description: Generates the mono-api client files
value: |
echo "IMPORTANT!!! mono API and inventory API have to be in sync. Consider running state run generate-inventory-client"
WD=$(pwd)
pushd pkg/platform/api/mono
swagger generate client -f ${WD}/../TheHomeRepot/service/api/swagger/swagger.yaml -A mono -a mono_operations -m mono_models -c mono_client
popd
- name: generate-secrets-client
language: bash
description: Generates the secrets-api client files
value: |
WD=$(pwd)
pushd pkg/platform/api/secrets
swagger generate client -f ${WD}/../TheHomeRepot/service/secrets/api/swagger.yaml -A secrets -a secrets_operations -m secrets_models -c secrets_client
popd
- name: generate-headchef-client
language: bash
description: Generates the headchef-api client files
value: |
WD=$(pwd)
pushd pkg/platform/api/headchef
swagger generate client --with-flatten full -f ${WD}/../TheHomeRepot/service/head-chef/swagger.json -A headchef -a headchef_operations -m headchef_models -c headchef_client
popd
- name: generate-logstreamer-client
language: bash
description: Generates the buildlog-streamer client files
value: |
WD=$(pwd)
pushd pkg/platform/api/buildlogstream
swagger generate client --with-flatten full -f ${WD}/../TheHomeRepot/service/build-log-streamer/swagger.yaml -A buildlogstream -a buildlogstream_operations -m buildlogstream_models -c buildlogstream_client
popd
- name: generate-inventory-client
language: bash
description: Generates the inventory-api client files
value: |
echo "IMPORTANT!!! mono API and inventory API have to be in sync. Consider running state run generate-api-client"
WD=$(pwd)
pushd pkg/platform/api/inventory
swagger generate client --with-flatten full -f ${WD}/../TheHomeRepot/service/inventory-api-v1/swagger.json -A inventory -a inventory_operations -m inventory_models -c inventory_client
popd
- name: generate-clients
language: bash
description: Generates all api clients
value: |
$scripts.generate-api-client.path()
$scripts.generate-secrets-client.path()
$scripts.generate-headchef-client.path()
$scripts.generate-inventory-client.path()
- name: generate-locale
language: bash
description: Detects new localisation calls and generates placeholder entries in en-us.yaml
value: python3 scripts/locale-generator.py
- name: generate-payload
language: bash
description: Generate payload for installer / update archives
value: |
set -e
$constants.SET_ENV
echo "# Generate payload"
go run ./scripts/ci/payload-generator/main.go "$@"
- name: generate-update
language: bash
description: Generate update files
value: |
set -e
export GOARCH=${1:-amd64}
$constants.SET_ENV
$scripts.generate-payload.path()
echo "# Create update dir"
mkdir -p ./build/update
echo "# Generate update from temp dir"
go run scripts/ci/update-generator/main.go -o ./build/update
- name: generate-remote-install-deployment
language: bash
value: go run scripts/ci/deploy-generator/remote-installer/main.go "$@"
- name: generate-graph
language: bash
description: Generates graph server and client files
value: |
set -e
go install github.com/99designs/gqlgen@v0.17.48
cd ./cmd/state-svc && gqlgen --verbose
- name: generate-test-update
language: bash
standalone: true
description: |
Generate tests update files. These can be safely uploaded to s3, and can be used to test an installation/update
value: |
set -e
$constants.SET_ENV
TEST_VERSION="99.99.9999"
TEST_CHANNEL=${1:-test-channel}
TEST_PREPARED_DIR=./build/payload/state-install
TEST_PREPARED_BIN_DIR=${TEST_PREPARED_DIR}/bin
TEST_FAKE_EXEC=./build/fakeversioncmd
TEST_ARCHIVE_DIR=./build/test-update
mkdir -p ${TEST_ARCHIVE_DIR}
copy_test_payload () {
cp -a ${TEST_FAKE_EXEC} ${TEST_PREPARED_BIN_DIR}/$constants.BUILD_TARGET
cp -a ${TEST_FAKE_EXEC} ${TEST_PREPARED_BIN_DIR}/$constants.BUILD_DAEMON_TARGET
cp -a ${TEST_FAKE_EXEC} ${TEST_PREPARED_BIN_DIR}/$constants.BUILD_EXEC_TARGET
cp -a ${BUILD_TARGET_DIR}/$constants.BUILD_INSTALLER_TARGET ${TEST_PREPARED_DIR}
}
go build -o ${TEST_FAKE_EXEC} ./internal/testhelpers/installation/fakeversioncmd
go run scripts/ci/payload-generator/main.go -v ${TEST_VERSION}
copy_test_payload
go run scripts/ci/update-generator/main.go -v ${TEST_VERSION} -o ${TEST_ARCHIVE_DIR}
echo "compile ${TEST_CHANNEL} update"
go build -o ${TEST_FAKE_EXEC} -ldflags "-X main.channel=${TEST_CHANNEL}" ./internal/testhelpers/installation/fakeversioncmd
go run scripts/ci/payload-generator/main.go -b ${TEST_CHANNEL} -v ${TEST_VERSION}
copy_test_payload
go run scripts/ci/update-generator/main.go -b ${TEST_CHANNEL} -v ${TEST_VERSION} -o ${TEST_ARCHIVE_DIR}
- name: generate-versions-list
language: bash
standalone: true
description: Generates master versions.json from S3 and info.json's from generate-update
value: |
set -e
$constants.SET_ENV
go run scripts/ci/update-version-list/main.go ./build/update