Skip to content

Commit

Permalink
gen swagger and doc when prereleasing
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard committed Sep 27, 2019
1 parent 032bb74 commit 2bc26c9
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
6 changes: 4 additions & 2 deletions hack/docgen.sh
Expand Up @@ -14,10 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -e

ROOT=$(realpath $(dirname ${BASH_SOURCE})/..)
ROOT=$(dirname ${BASH_SOURCE})/..
source $ROOT/hack/lib/library.sh
ROOT=$(bash::realpath $ROOT)

CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ${GOPATH}/src/k8s.io/code-generator)}

go run ${CODEGEN_PKG}/cmd/openapi-gen/main.go \
Expand Down
21 changes: 21 additions & 0 deletions hack/lib/bash.sh
@@ -0,0 +1,21 @@
#!/bin/bash
#
# Copyright 2017-2018 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

function bash::realpath() {
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
return 0
}
22 changes: 22 additions & 0 deletions hack/lib/library.sh
@@ -0,0 +1,22 @@

#!/usr/bin/env bash

# Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e

LIBROOT=$(dirname $BASH_SOURCE[0])
source $LIBROOT/utils.sh
source $LIBROOT/object.sh
source $LIBROOT/bash.sh
5 changes: 4 additions & 1 deletion hack/prerelease.sh
Expand Up @@ -195,4 +195,7 @@ for cr_file in $(find "deploy/crds" -name "*_cr.yaml" -print); do
operator-sdk scorecard --namespace marketplace --olm-deployed --cr-manifest $cr_file --csv-path "${OPERATOR_DIR}cloud-functions-operator.v${TAG}.clusterserviceversion.yaml"
done

# cleanup 0
echo "generating swagger and documentation"
hack/docgen.sh

cleanup 0
2 changes: 2 additions & 0 deletions vendor/github.com/onsi/gomega/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2bc26c9

Please sign in to comment.