diff --git a/.circleci/config.yml b/.circleci/config.yml index af9f9eeb..53b95545 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ restore_workspace: &restore_workspace run: | make bootstrap sudo cp -r /tmp/go/bin/* /usr/local/bin/ - cp -r /tmp/go/src/github.com/kubeless/nats-trigger/*yaml . + cp -r /tmp/go/src/github.com/kubeless/nats-trigger/build-manifests/*yaml . should_test: &should_test run: | case $CIRCLE_JOB in @@ -85,12 +85,21 @@ jobs: - checkout - <<: *exports - run: make bootstrap + - run: mkdir build-manifests + # Install kubeless required files + - run: | + git clone https://github.com/kubeless/kubeless.git $GOPATH/src/github.com/kubeless/kubeless + ln -s $(pwd)/ksonnet-lib $GOPATH/src/github.com/kubeless/kubeless/ksonnet-lib + cd $GOPATH/src/github.com/kubeless/kubeless + make binary + make all-yaml + cd - + cp $GOPATH/src/github.com/kubeless/kubeless/kubeless-non-rbac.yaml $GOPATH/src/github.com/kubeless/kubeless/kubeless.yaml build-manifests/ - run: make VERSION=${CONTROLLER_TAG} binary - run: make test - run: make validation - run: make all-yaml - run: | - mkdir build-manifests IFS=' ' read -r -a manifests <<< "$MANIFESTS" for f in "${manifests[@]}"; do sed -i.bak 's/:latest/'":${CONTROLLER_TAG}"'/g' ${f}.yaml @@ -100,7 +109,7 @@ jobs: root: /home/circleci/.go_workspace paths: - bin - - src/github.com/kubeless/nats-trigger/*yaml + - src/github.com/kubeless/nats-trigger/build-manifests/*yaml - store_artifacts: path: /home/circleci/.go_workspace/bin/kubeless - store_artifacts: @@ -146,6 +155,4 @@ jobs: - attach_workspace: at: /tmp/go - <<: *restore_workspace - - run: make VERSION=${CIRCLE_TAG} binary-cross - - run: for d in bundles/kubeless_*; do zip -r9 $d.zip $d/; done - run: ./script/create_release.sh ${CIRCLE_TAG} "${MANIFESTS}" diff --git a/.gitignore b/.gitignore index ce13e71e..c630ea94 100644 --- a/.gitignore +++ b/.gitignore @@ -153,3 +153,4 @@ bundles/ docker/nats-controller/nats-controller ksonnet-lib/ nats.yaml +/kubeless diff --git a/script/cluster-up-minikube.sh b/script/cluster-up-minikube.sh index 8976101c..605c6835 100755 --- a/script/cluster-up-minikube.sh +++ b/script/cluster-up-minikube.sh @@ -26,7 +26,6 @@ export KUBECONFIG=$HOME/.kube/config export PATH=${PATH}:${GOPATH:?}/bin MINIKUBE_VERSION=${MINIKUBE_VERSION:?} -export KUBELESS_VERSION=$(curl -s https://api.github.com/repos/kubeless/kubeless/releases/latest | grep tag_name | cut -d '"' -f 4) install_bin() { local exe=${1:?} @@ -49,27 +48,11 @@ check_or_install_minikube() { install_bin ./minikube } } -check_or_install_kubeless() { - which kubeless || { - sudo wget https://github.com/kubeless/kubeless/releases/download/$KUBELESS_VERSION/kubeless_$(go env GOOS)-$(go env GOARCH).zip - unzip kubeless_$(go env GOOS)-$(go env GOARCH).zip - sudo cp ./bundles/kubeless_$(go env GOOS)-$(go env GOARCH)/kubeless /usr/local/bin/kubeless - sudo chmod +x /usr/local/bin/kubeless - } -} -install_kubeless_manifests() { - wget -q -O kubeless-non-rbac.yaml https://github.com/kubeless/kubeless/releases/download/$KUBELESS_VERSION/kubeless-non-rbac-$KUBELESS_VERSION.yaml - wget -q -O kubeless.yaml https://github.com/kubeless/kubeless/releases/download/$KUBELESS_VERSION/kubeless-$KUBELESS_VERSION.yaml -} # Install nsenter if missing check_or_build_nsenter # Install minikube if missing check_or_install_minikube -# Install Kubeless if missing -check_or_install_kubeless -# Install Kubeless manifests -install_kubeless_manifests MINIKUBE_BIN=$(which minikube) diff --git a/script/create_release.sh b/script/create_release.sh index b0e1aa64..9f60cefd 100755 --- a/script/create_release.sh +++ b/script/create_release.sh @@ -1,8 +1,8 @@ #!/bin/bash set -e -REPO_NAME=kubeless -REPO_DOMAIN=nats-trigger +REPO_NAME=nats-trigger +REPO_DOMAIN=kubeless TAG=${1:?} MANIFESTS=${2:?} # Space separated list of manifests to publish @@ -33,6 +33,3 @@ for f in "${manifests[@]}"; do cp ${PROJECT_DIR}/${f}.yaml ${PROJECT_DIR}/${f}-${TAG}.yaml upload_asset $REPO_DOMAIN $REPO_NAME "$RELEASE_ID" "${PROJECT_DIR}/${f}-${TAG}.yaml" done -for f in `ls ${PROJECT_DIR}/bundles/kubeless_*.zip`; do - upload_asset $REPO_DOMAIN $REPO_NAME $RELEASE_ID $f -done diff --git a/script/release_utils.sh b/script/release_utils.sh index 08f51693..7dd1fafd 100755 --- a/script/release_utils.sh +++ b/script/release_utils.sh @@ -22,27 +22,10 @@ This release includes the following commits and features:\\n\ $commits\\n\\n\ To install this latest version, use the manifest that is part of the release:\\n\ \\n\ -**WITH RBAC ENABLED:**\\n\ -\\n\ \`\`\`console\\n\ -kubectl create ns kubeless\\n\ -kubectl create -f https://github.com/kubeless/kubeless/releases/download/$tag/kubeless-$tag.yaml \\n\ +kubectl create -f https://github.com/kubeless/nats-trigger/releases/download/$tag/nats-$tag.yaml \\n\ \`\`\`\\n\ \\n\ -**WITHOUT RBAC:**\\n\ -\\n\ -\`\`\`console\\n\ -kubectl create ns kubeless\\n\ -kubectl create -f https://github.com/kubeless/kubeless/releases/download/$tag/kubeless-non-rbac-$tag.yaml \\n\ -\`\`\`\\n\ -**OPENSHIFT:**\\n\ -\\n\ -\`\`\`console\\n\ -oc create ns kubeless\\n\ -oc create -f https://github.com/kubeless/kubeless/releases/download/$tag/kubeless-openshift-$tag.yaml \\n\ -# Kafka\\n\ -oc create -f https://github.com/kubeless/kubeless/releases/download/$tag/kafka-zookeeper-openshift-$tag.yaml \\n\ -\`\`\`\\n\ ") echo "${notes}" }