Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Use latest kubeless manifest (#2)
Browse files Browse the repository at this point in the history
* Use latest kubeless manifest

* Fix cp
  • Loading branch information
andresmgot committed Jul 31, 2018
1 parent c1e54f1 commit 943ea6d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 151 deletions.
34 changes: 19 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,25 @@ defaults: &defaults
working_directory: /home/circleci/.go_workspace/src/github.com/kubeless/http-trigger
environment:
GOPATH: /home/circleci/.go_workspace
CONTROLLER_IMAGE_NAME: bitnami/kubeless-controller-manager
HTTP_CONTROLLER_IMAGE_NAME: bitnami/http-trigger-controller
CGO_ENABLED: "0"
TEST_DEBUG: "1"
GKE_VERSION: 1.9.7-gke.3
MINIKUBE_VERSION: v0.25.2
MANIFESTS: http
KUBELESS_MANIFESTS: kubeless kubeless-non-rbac
exports: &exports
# It is not possible to resolve env vars in the environment section:
# https://discuss.circleci.com/t/using-environment-variables-in-config-yml-not-working/14237
run: |
CONTROLLER_TAG=${CIRCLE_TAG:-build-$CIRCLE_WORKFLOW_ID}
echo "export CONTROLLER_TAG=${CONTROLLER_TAG}" >> $BASH_ENV
echo "export CONTROLLER_IMAGE=${CONTROLLER_IMAGE_NAME}:${CONTROLLER_TAG}" >> $BASH_ENV
echo "export HTTP_CONTROLLER_IMAGE=${HTTP_CONTROLLER_IMAGE_NAME}:${CONTROLLER_TAG}" >> $BASH_ENV
echo "export KUBECFG_JPATH=/home/circleci/src/github.com/kubeless/http-trigger/ksonnet-lib" >> $BASH_ENV
echo "export PATH=$(pwd)/bats/libexec:$PATH" >> $BASH_ENV
restore_workspace: &restore_workspace
run: |
make bootstrap
sudo cp -r /tmp/go/bin/* /usr/local/bin/
cp -r /tmp/go/src/github.com/kubeless/http-trigger/*yaml .
cp -r /tmp/go/src/github.com/kubeless/http-trigger/build-manifests/*yaml .
should_test: &should_test
run: |
case $CIRCLE_JOB in
Expand Down Expand Up @@ -85,22 +82,29 @@ jobs:
- checkout
- <<: *exports
- run: make bootstrap
- run: make VERSION=${CONTROLLER_TAG} binary
- run: make test
- run: make validation
- run: make all-yaml
- run: mkdir build-manifests
- run: |
mkdir build-manifests
IFS=' ' read -r -a manifests <<< "$MANIFESTS"
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
# Replace the controller version that is included in the main Kubeless manifest
IFS=' ' read -r -a manifests <<< "$KUBELESS_MANIFESTS"
for f in "${manifests[@]}"; do
sed -i.bak 's/:latest/'":${CONTROLLER_TAG}"'/g' ${f}.yaml
cp ${f}.yaml build-manifests/
sed -i.bak 's/http-trigger-controller:.*/http-trigger-controller:'"${CONTROLLER_TAG}"'/g' ${f}.yaml
cp ${f}.yaml $GOPATH/src/github.com/kubeless/http-trigger/build-manifests/
done
cd -
# Install kubeless required files
- run: make VERSION=${CONTROLLER_TAG} binary
- run: make test
- run: make validation
- persist_to_workspace:
root: /home/circleci/.go_workspace
paths:
- bin
- src/github.com/kubeless/http-trigger/*yaml
- src/github.com/kubeless/http-trigger/build-manifests/*yaml
- store_artifacts:
path: /home/circleci/.go_workspace/bin/kubeless
- store_artifacts:
Expand Down Expand Up @@ -149,4 +153,4 @@ jobs:
- <<: *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}"
- run: ./script/create_release.sh ${CIRCLE_TAG}
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ binary:
binary-cross:
./script/binary-cli

%.yaml: %.jsonnet
$(KUBECFG) show -o yaml $< > $@.tmp
mv $@.tmp $@

all-yaml: http.yaml

http.yaml: http.jsonnet

http-controller-build:
./script/binary-controller -os=$(OS) -arch=$(ARCH) http-controller github.com/kubeless/http-trigger/cmd/http-trigger-controller

Expand Down
77 changes: 0 additions & 77 deletions http.jsonnet

This file was deleted.

17 changes: 0 additions & 17 deletions script/cluster-up-minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}
Expand All @@ -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)

Expand Down
14 changes: 2 additions & 12 deletions script/create_release.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash
set -e

REPO_NAME=kubeless
REPO_DOMAIN=http-trigger
REPO_NAME=http-trigger
REPO_DOMAIN=kubeless
TAG=${1:?}
MANIFESTS=${2:?} # Space separated list of manifests to publish

PROJECT_DIR=$(cd $(dirname $0)/.. && pwd)

Expand All @@ -27,12 +26,3 @@ if [[ $repo_check == *"Not Found"* ]]; then
else
RELEASE_ID=$(release_tag $TAG $REPO_DOMAIN $REPO_NAME | jq '.id')
fi

IFS=' ' read -r -a manifests <<< "$MANIFESTS"
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
23 changes: 1 addition & 22 deletions script/release_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,8 @@ function get_release_notes {
notes=$(echo "\
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\
To install the latest version of this image use the manifest included in the Kubeless main repository.\\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\
\`\`\`\\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}"
}
Expand Down

0 comments on commit 943ea6d

Please sign in to comment.