Move binaries to Dockerfile dir
@@ -18,17 +18,15 @@ set -o errexit
set -o nounset
set -o pipefail
-root_dir="$(cd "$(dirname "$0")/.." ; pwd)"
-base_dir="${root_dir}"
+base_dir="$(cd "$(dirname "$0")/.." ; pwd)"
dockerfile_dir="${base_dir}/images/federation-v2"
-cd "$base_dir" || {
- echo "Cannot cd to '$base_dir'. Aborting." >&2
+cd "$base_dir/bin" || {
+ echo "Cannot cd to '$base_dir/bin'. Aborting." >&2
exit 1
}
cd ${base_dir}
-
if [[ "${TRAVIS_BRANCH}" != "master" ]]; then
echo "Not on master branch. Image build skipped." >&2
exit 0
@@ -37,10 +35,10 @@ fi
echo "Starting image build"
export REGISTRY=quay.io/
echo "Copy apiserver"
-cp ${base_dir}/bin/apiserver apiserver
+cp ${base_dir}/bin/apiserver ${dockerfile_dir}/apiserver
echo "Copy controller manager"
-cp ${base_dir}/bin/controller-manager controller-manager
+cp ${base_dir}/bin/controller-manager ${dockerfile_dir}/controller-manager
echo "Building Federation-v2 docker image"
docker login -u "${QUAY_USERNAME}" -p "{QUAY_PASSWORD}" quay.io
@@ -49,5 +47,5 @@ echo "Pushing images with default tags (git sha and 'canary')."
docker build ${dockerfile_dir} -t ${REGISTRY}${QUAY_USERNAME}/federation-v2:canary
docker push ${REGISTRY}${QUAY_USERNAME}/federation-v2:canary
-rm apiserver
-rm controller-manager
+rm ${dockerfile_dir}/apiserver
+rm ${dockerfile_dir}/controller-manager
