-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·126 lines (101 loc) · 8.02 KB
/
build.sh
File metadata and controls
executable file
·126 lines (101 loc) · 8.02 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
#!/bin/bash
set -o errexit
set -o pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cred_store_type="${1:-filesystem}"
rm -rf "${SCRIPT_DIR}"/lib/*.wasm
rm -rf "${SCRIPT_DIR}/lib/test" && mkdir -p "${SCRIPT_DIR}/lib/test"
# wit interface
wkg wit build -o "${SCRIPT_DIR}/lib/interface.wasm"
# core components
cargo component build -p credential-config --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/credential_config.wasm" "${SCRIPT_DIR}/lib/credential-config.wasm"
cargo component build -p keyvalue-credential-admin --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/keyvalue_credential_admin.wasm" "${SCRIPT_DIR}/lib/keyvalue-credential-admin.wasm"
cargo component build -p keyvalue-credential-store --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/keyvalue_credential_store.wasm" "${SCRIPT_DIR}/lib/keyvalue-credential-store.wasm"
cargo component build -p lifecycle-host-cli --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/lifecycle_host_cli.wasm" "${SCRIPT_DIR}/lib/lifecycle-host-cli.wasm"
cargo component build -p lifecycle-host-http --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/lifecycle_host_http.wasm" "${SCRIPT_DIR}/lib/lifecycle-host-http.wasm"
# filesystem components
cargo component build -p filesystem-lifecycle --release --target wasm32-wasip2
cp "${SCRIPT_DIR}/target/wasm32-wasip2/release/filesystem_lifecycle.wasm" "${SCRIPT_DIR}/lib/filesystem-lifecycle.wasm"
cargo component build -p filesystem-credential-store --release --target wasm32-wasip2
cp "${SCRIPT_DIR}/target/wasm32-wasip2/release/filesystem_credential_store.wasm" "${SCRIPT_DIR}/lib/filesystem-credential-store.wasm"
cargo component build -p filesystem-credential-admin --release --target wasm32-wasip2
cp "${SCRIPT_DIR}/target/wasm32-wasip2/release/filesystem_credential_admin.wasm" "${SCRIPT_DIR}/lib/filesystem-credential-admin.wasm"
# valkey components
cargo component build -p valkey-lifecycle --release --target wasm32-wasip2
wac plug "${SCRIPT_DIR}/target/wasm32-wasip2/release/valkey_lifecycle.wasm" --plug "${SCRIPT_DIR}/lib/deps/valkey-client.wasm" -o "${SCRIPT_DIR}/lib/valkey-lifecycle.wasm"
wac plug "${SCRIPT_DIR}/lib/keyvalue-credential-store.wasm" --plug "${SCRIPT_DIR}/lib/deps/valkey-client.wasm" -o "${SCRIPT_DIR}/lib/valkey-credential-store.wasm"
wac plug "${SCRIPT_DIR}/lib/keyvalue-credential-admin.wasm" --plug "${SCRIPT_DIR}/lib/deps/valkey-client.wasm" -o "${SCRIPT_DIR}/lib/valkey-credential-admin.wasm"
# webhook components
cargo component build -p webhook-credential-admin --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/webhook_credential_admin.wasm" "${SCRIPT_DIR}/lib/webhook-credential-admin.wasm"
cargo component build -p webhook-credential-store --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/webhook_credential_store.wasm" "${SCRIPT_DIR}/lib/webhook-credential-store.wasm"
# test components
cp "${SCRIPT_DIR}/lib/deps/filesystem-chroot.wasm" "${SCRIPT_DIR}/lib/test/filesystem-client.wasm"
cp "${SCRIPT_DIR}/lib/deps/valkey-client.wasm" "${SCRIPT_DIR}/lib/test/keyvalue-client.wasm"
cargo component build -p filesystem-ops --release --target wasm32-wasip2
cp "${SCRIPT_DIR}/target/wasm32-wasip2/release/filesystem_ops.wasm" "${SCRIPT_DIR}/lib/test/filesystem-ops.wasm"
cargo component build -p keyvalue-ops --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/keyvalue_ops.wasm" "${SCRIPT_DIR}/lib/test/keyvalue-ops.wasm"
cargo component build -p lifecycle-router --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/lifecycle_router.wasm" "${SCRIPT_DIR}/lib/test/lifecycle-router.wasm"
cargo component build -p ops-router --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/ops_router.wasm" "${SCRIPT_DIR}/lib/test/ops-router.wasm"
cargo component build -p service-cli --release --target wasm32-wasip2
cp "${SCRIPT_DIR}/target/wasm32-wasip2/release/service-cli.wasm" "${SCRIPT_DIR}/lib/test/service-cli.wasm"
# stub components
cargo component build -p stub-lifecycle --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/stub_lifecycle.wasm" "${SCRIPT_DIR}/lib/test/stub-lifecycle.wasm"
cargo component build -p stub-client --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/stub_client.wasm" "${SCRIPT_DIR}/lib/test/stub-client.wasm"
cargo component build -p stub-credential-admin --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/stub_credential_admin.wasm" "${SCRIPT_DIR}/lib/test/stub-credential-admin.wasm"
cargo component build -p stub-credential-store --release --target wasm32-unknown-unknown
cp "${SCRIPT_DIR}/target/wasm32-unknown-unknown/release/stub_credential_store.wasm" "${SCRIPT_DIR}/lib/test/stub-credential-store.wasm"
wac compose -o "${SCRIPT_DIR}/lib/test/logging.wasm" \
-d componentized:logger="${SCRIPT_DIR}/lib/deps/logger.wasm" \
-d componentized:app-config="${SCRIPT_DIR}/lib/deps/app-config.wasm" \
-d componentized:stdout-to-stderr="${SCRIPT_DIR}/lib/deps/stdout-to-stderr.wasm" \
"${SCRIPT_DIR}/tests/logging.wac"
wac compose -o "${SCRIPT_DIR}/lib/test/lifecycle.wasm" \
-d componentized:logging="${SCRIPT_DIR}/lib/logging.wasm" \
-d componentized:lifecycle-router="${SCRIPT_DIR}/lib/test/lifecycle-router.wasm" \
-d componentized:filesystem-lifecycle="${SCRIPT_DIR}/lib/filesystem-lifecycle.wasm" \
-d componentized:keyvalue-lifecycle="${SCRIPT_DIR}/lib/valkey-lifecycle.wasm" \
"${SCRIPT_DIR}/tests/lifecycle.wac"
wac compose -o "${SCRIPT_DIR}/lib/test/ops.wasm" \
-d componentized:logging="${SCRIPT_DIR}/lib/logging.wasm" \
-d componentized:credential-store="${SCRIPT_DIR}/lib/${cred_store_type}-credential-store.wasm" \
-d componentized:credential-config="${SCRIPT_DIR}/lib/credential-config.wasm" \
-d componentized:filesystem-client="${SCRIPT_DIR}/lib/test/filesystem-client.wasm" \
-d componentized:filesystem-ops="${SCRIPT_DIR}/lib/test/filesystem-ops.wasm" \
-d componentized:keyvalue-client="${SCRIPT_DIR}/lib/test/keyvalue-client.wasm" \
-d componentized:keyvalue-ops="${SCRIPT_DIR}/lib/test/keyvalue-ops.wasm" \
-d componentized:ops-router="${SCRIPT_DIR}/lib/test/ops-router.wasm" \
"${SCRIPT_DIR}/tests/ops.wac"
wac compose -o "${SCRIPT_DIR}/lib/test/cli.wasm" \
-d componentized:logging="${SCRIPT_DIR}/lib/logging.wasm" \
-d componentized:cli="${SCRIPT_DIR}/lib/test/service-cli.wasm" \
-d componentized:lifecycle="${SCRIPT_DIR}/lib/test/lifecycle.wasm" \
-d componentized:credential-store="${SCRIPT_DIR}/lib/${cred_store_type}-credential-store.wasm" \
-d componentized:credential-admin="${SCRIPT_DIR}/lib/${cred_store_type}-credential-admin.wasm" \
-d componentized:ops="${SCRIPT_DIR}/lib/test/ops.wasm" \
-d componentized:static-config-factory="${SCRIPT_DIR}/lib/deps/static-config-factory.wasm" \
"${SCRIPT_DIR}/tests/cli.wac"
wac compose -o "${SCRIPT_DIR}/lib/test/host-cli-valkey.wasm" \
-d componentized:logging="${SCRIPT_DIR}/lib/test/logging.wasm" \
-d componentized:lifecycle-host="${SCRIPT_DIR}/lib/lifecycle-host-cli.wasm" \
-d componentized:lifecycle="${SCRIPT_DIR}/lib/valkey-lifecycle.wasm" \
-d componentized:credential-admin="${SCRIPT_DIR}/lib/valkey-credential-admin.wasm" \
"${SCRIPT_DIR}/tests/host.wac"
wac compose -o "${SCRIPT_DIR}/lib/test/host-http-valkey.wasm" \
-d componentized:logging="${SCRIPT_DIR}/lib/test/logging.wasm" \
-d componentized:lifecycle-host="${SCRIPT_DIR}/lib/lifecycle-host-http.wasm" \
-d componentized:lifecycle="${SCRIPT_DIR}/lib/valkey-lifecycle.wasm" \
-d componentized:credential-admin="${SCRIPT_DIR}/lib/valkey-credential-admin.wasm" \
"${SCRIPT_DIR}/tests/host.wac"