Skip to content

Commit

Permalink
Place generated manifests in _out folder
Browse files Browse the repository at this point in the history
By also moving the manifests to _out, we have all produced artifacts in
the _out folder.

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr authored and Travis CI committed Jan 15, 2018
1 parent 150d382 commit 8dff48f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ vendor/*
.idea
*.iml
tools/openapispec/openapispec
manifests/**/*.yaml
**/bin
bin/*
.vagrant
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ deploy:
file_glob: true
file:
- _out/cmd/virtctl/virtctl-*
- manifests/release/kubevirt.yaml
- _out/manifests/release/kubevirt.yaml
prerelease: true
on:
tags: true
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ clean:
rm tools/openapispec/openapispec -rf

distclean: clean
find manifests -name "*.yaml" -type f -delete
rm -rf vendor/
rm -f .glide.*.hash
glide cc
Expand Down
9 changes: 5 additions & 4 deletions cluster/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set -ex

PROVIDER=${PROVIDER:-vagrant}

source hack/common.sh
source cluster/$PROVIDER/provider.sh
source hack/config.sh

Expand All @@ -31,7 +32,7 @@ _kubectl delete pods -n kube-system -l="kubevirt.io=libvirt" --force --grace-per
_kubectl delete pods -n kube-system -l="kubevirt.io=virt-handler" --force --grace-period 0 2>/dev/null || :

# Delete everything, no matter if release, devel or infra
_kubectl delete -f manifests -R --grace-period 1 2>/dev/null || :
_kubectl delete -f ${MANIFESTS_OUT_DIR}/ -R --grace-period 1 2>/dev/null || :

# Delete exposures
_kubectl delete services -l "kubevirt.io" -n kube-system
Expand All @@ -42,12 +43,12 @@ echo "Deploying ..."

# Deploy the right manifests for the right target
if [ -z "$TARGET" ] || [ "$TARGET" = "vagrant-dev" ]; then
_kubectl create -f manifests/dev -R $i
_kubectl create -f ${MANIFESTS_OUT_DIR}/dev -R $i
elif [ "$TARGET" = "vagrant-release" ]; then
_kubectl create -f manifests/release -R $i
_kubectl create -f ${MANIFESTS_OUT_DIR}/release -R $i
fi

# Deploy additional infra for testing
_kubectl create -f manifests/testing -R $i
_kubectl create -f ${MANIFESTS_OUT_DIR}/testing -R $i

echo "Done"
16 changes: 7 additions & 9 deletions hack/build-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,18 @@
set -e

source hack/config.sh
source hack/common.sh

if [ $# -eq 0 ]; then
args=$(find manifests -type f -name "*.yaml.in")
else
args=$@
fi
args=$(cd ${KUBEVIRT_DIR}/manifests && find * -type f -name "*.yaml.in")

# Delete all generated manifests in case an input file was deleted or renamed
find manifests -name "*.yaml" -type f -delete
rm -rf ${MANIFESTS_OUT_DIR}

# Render kubernetes manifests
for arg in $args; do
final_out_dir=$(dirname ${MANIFESTS_OUT_DIR}/${arg})
mkdir -p ${final_out_dir}
manifest=$(basename -s .in ${arg})
sed -e "s/{{ master_ip }}/$master_ip/g" \
-e "s/{{ docker_tag }}/$docker_tag/g" \
-e "s/{{ docker_prefix }}/$docker_prefix/g" \
$arg >${arg%%.in}
${KUBEVIRT_DIR}/manifests/$arg >${final_out_dir}/${manifest}
done
11 changes: 11 additions & 0 deletions hack/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

KUBEVIRT_DIR="$(
cd "$(dirname "$0")/../"
pwd
)"
OUT_DIR=$KUBEVIRT_DIR/_out/
CMD_OUT_DIR=$KUBEVIRT_DIR/_out/cmd/
TESTS_OUT_DIR=$KUBEVIRT_DIR/_out/cmd/
APIDOCS_OUT_DIR=$KUBEVIRT_DIR/_out/apidocs
MANIFESTS_OUT_DIR=$KUBEVIRT_DIR/_out/manifests

0 comments on commit 8dff48f

Please sign in to comment.