forked from twilio/twilio-oai-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprism.sh
executable file
·30 lines (24 loc) · 988 Bytes
/
prism.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
#!/bin/bash
set -e
make install
API_SPEC=examples/twilio_api_v2010.yaml
OUT_DIR=examples/go/rest
rm -rf $OUT_DIR
java -cp ./openapi-generator-cli.jar:target/twilio-openapi-generator.jar \
org.openapitools.codegen.OpenAPIGenerator \
generate -g twilio-go \
-i $API_SPEC \
-o $OUT_DIR/api/v2010
OUT_DIR=examples/terraform/resources
rm -rf $OUT_DIR
java -cp ./openapi-generator-cli.jar:target/twilio-openapi-generator.jar \
org.openapitools.codegen.OpenAPIGenerator \
generate -g terraform-provider-twilio \
-i $API_SPEC \
-o $OUT_DIR
# Replace a couple imports in the generated Terraform resource to use local code.
sed -i.bak "s/github.com\/twilio\/twilio-go/twilio-oai-generator\/go/g" "$OUT_DIR/api_default.go"
sed -i.bak "s/github.com\/twilio\/terraform-provider-twilio\/client/twilio-oai-generator\/terraform\/client/g" "$OUT_DIR/api_default.go"
cd examples/prism
docker-compose build
docker-compose up --force-recreate --abort-on-container-exit --remove-orphans