diff --git a/.gitignore b/.gitignore index 91339a5e..20da41e8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,7 @@ .DS_Store bin/ +_tmp/ + artifacts/gcloud/ .idea \ No newline at end of file diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index ed8b6e74..a96a48c9 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -1,15 +1,21 @@ #!/usr/bin/env bash set -o errexit -set -o nounset set -o pipefail -SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. -CODEGEN_PKG=${CODEGEN_PKG:-$(echo `go env GOPATH`'/pkg/mod/k8s.io/code-generator@v0.0.0-20190511023357-639c964206c2')} +REPO_ROOT=$(git rev-parse --show-toplevel) +CODEGEN_VERSION="@v0.0.0-20190511023357-639c964206c2" +CODEGEN_PKG=${CODEGEN_PKG:-$(echo `go env GOPATH`"/pkg/mod/k8s.io/code-generator${CODEGEN_VERSION}")} -#chmod +x ${CODEGEN_PKG}/generate-groups.sh +if [[ "$CIRCLECI" ]]; then +mkdir -p ${REPO_ROOT}/bin; +cp -r ${CODEGEN_PKG} ${REPO_ROOT}/bin/; +chmod +x ${REPO_ROOT}/bin/code-generator${CODEGEN_VERSION}/generate-groups.sh; +CODEGEN_PKG=${REPO_ROOT}/bin/code-generator${CODEGEN_VERSION}; +echo ">> $CODEGEN_PKG" +fi ${CODEGEN_PKG}/generate-groups.sh all \ github.com/weaveworks/flagger/pkg/client github.com/weaveworks/flagger/pkg/apis \ "appmesh:v1beta1 istio:v1alpha3 flagger:v1alpha3 smi:v1alpha1" \ - --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt + --go-header-file ${REPO_ROOT}/hack/boilerplate.go.txt