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

Commit

Permalink
Add kinesis yaml in the release process. Other minor fixes (#786)
Browse files Browse the repository at this point in the history
* Add kinesis yaml in the release process. Other minor fixes

* Fix build
  • Loading branch information
andresmgot authored May 28, 2018
1 parent 16cb7ea commit 5f5178c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
13 changes: 5 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ defaults: &defaults
TEST_DEBUG: "1"
GKE_VERSION: 1.8.8-gke.0
MINIKUBE_VERSION: v0.25.2
MANIFESTS: kubeless kubeless-non-rbac kubeless-openshift kafka-zookeeper kafka-zookeeper-openshift nats kinesis
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
Expand Down Expand Up @@ -162,14 +163,10 @@ jobs:
- run: make all-yaml
- run: |
mkdir build-manifests
manifests=(
kubeless.yaml kubeless-non-rbac.yaml kubeless-openshift.yaml
kafka-zookeeper.yaml kafka-zookeeper-openshift.yaml
nats.yaml kinesis.yaml
)
IFS=' ' read -r -a manifests <<< "$MANIFESTS"
for f in "${manifests[@]}"; do
sed -i.bak 's/:latest/'":${CONTROLLER_TAG}"'/g' $f
cp $f build-manifests/
sed -i.bak 's/:latest/'":${CONTROLLER_TAG}"'/g' ${f}.yaml
cp ${f}.yaml build-manifests/
done
- persist_to_workspace:
root: /home/circleci/.go_workspace
Expand Down Expand Up @@ -324,4 +321,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}
- run: ./script/create_release.sh ${CIRCLE_TAG} "${MANIFESTS}"
10 changes: 3 additions & 7 deletions script/create_release.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
set -e

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

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

Expand All @@ -25,14 +25,10 @@ if [[ $repo_check == *"Not Found"* ]]; then
echo "Not found a Github repository for $REPO_DOMAIN/$REPO_NAME, it is not possible to publish it" > /dev/stderr
exit 1
else
RELEASE_ID=$(release_tag $1 $REPO_DOMAIN $REPO_NAME | jq '.id')
RELEASE_ID=$(release_tag $TAG $REPO_DOMAIN $REPO_NAME | jq '.id')
fi

manifests=(
kubeless kubeless-non-rbac kubeless-openshift
kafka-zookeeper kafka-zookeeper-openshift
nats
)
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"
Expand Down
2 changes: 1 addition & 1 deletion script/release_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function release_tag {
local repo_domain=${2:?}
local repo_name=${3:?}
local body=$(get_release_body $tag $repo_domain $repo_name)
local release=`curl -H "Authorization: token $ACCESS_TOKEN" -s --request POST --data "$body" https://api.github.com/repos/$REPO_DOMAIN/$REPO_NAME/releases`
local release=`curl -H "Authorization: token $ACCESS_TOKEN" -s --request POST --data "$body" https://api.github.com/repos/$repo_domain/$repo_name/releases`
echo $release
}

Expand Down

0 comments on commit 5f5178c

Please sign in to comment.