github.com/ryanbennettvoid/go-swagger@v0.18.1-0.20190104015444-3854bbbe2392/hack/regen-samples.sh (about) 1 #!/bin/sh 2 3 examples=$(git rev-parse --show-toplevel)/examples 4 5 # go to project root 6 cd "${examples}/generated" 7 rm -rf cmd models restapi 8 swagger generate server -A Petstore 9 10 cd "${examples}/todo-list" 11 rm -rf client cmd models restapi 12 swagger generate client -A TodoList -f ./swagger.yml 13 swagger generate server -A TodoList -f ./swagger.yml --flag-strategy pflag 14 15 cd "${examples}/authentication" 16 rm -rf client cmd models restapi 17 swagger generate client -A AuthSample -f ./swagger.yml -P 'models.Principal' 18 swagger generate server -A AuthSample -f ./swagger.yml -P 'models.Principal' 19 20 cd "${examples}/task-tracker" 21 rm -rf client cmd models restapi 22 swagger generate client -A TaskTracker -f ./swagger.yml 23 swagger generate server -A TaskTracker -f ./swagger.yml 24 25 cd "${examples}/stream-server" 26 cp restapi/configure_countdown.go . 27 rm -rf cmd models restapi 28 swagger generate server -A Countdown -f ./swagger.yml 29 mv configure_countdown.go restapi/ 30 31 cd "${examples}/oauth2" 32 cp restapi/configure_oauth_sample.go restapi/implementation.go . 33 rm -rf cmd models restapi 34 swagger generate server -A oauthSample -P models.Principal -f ./swagger.yml 35 mv configure_oauth_sample.go implementation.go restapi/ 36 37 cd "${examples}/tutorials/todo-list/server-1" 38 rm -rf cmd models restapi 39 swagger generate server -A TodoList -f ./swagger.yml 40 41 cd "${examples}/tutorials/todo-list/server-2" 42 rm -rf cmd models restapi 43 swagger generate server -A TodoList -f ./swagger.yml 44 45 cd "${examples}/tutorials/todo-list/server-complete" 46 swagger generate server -A TodoList -f ./swagger.yml 47 48 cd "${examples}/tutorials/custom-server" 49 rm -rf gen 50 mkdir gen 51 swagger generate server --exclude-main -A greeter -t gen -f ./swagger/swagger.yml 52 53 cd "${examples}/composed-auth" 54 cp restapi/configure_multi_auth_example.go . 55 rm -rf cmd models restapi 56 swagger generate server -A multi-auth-example -P models.Principal -f ./swagger.yml 57 mv configure_multi_auth_example.go restapi/ 58 59 cd "${examples}/contributed-templates/stratoscale" 60 rm -rf client cmd models restapi 61 swagger generate client -A Petstore --template stratoscale 62 swagger generate server -A Petstore --template stratoscale 63 64 cd ${examples} 65 go test -vet off -v ./...