Merge pull request #1737 from hasbro17/haseeb/separate-e2e-build-push

build/e2e: separate build binaries and push images
This commit is contained in:
Haseeb Tariq 2017-12-06 14:05:38 -08:00 коммит произвёл GitHub
Родитель 3bb9d950ff 581431d79d
Коммит 7b82fba6d0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 25 добавлений и 26 удалений

Просмотреть файл

@ -6,33 +6,16 @@ set -o errexit
set -o nounset
set -o pipefail
if ! which docker > /dev/null; then
echo "docker needs to be installed"
exit 1
fi
mkdir -p _output
DOCKER_REPO_ROOT="/go/src/github.com/coreos/etcd-operator"
function build_binaries {
docker run --rm \
-v "$PWD":"$DOCKER_REPO_ROOT" \
-w "$DOCKER_REPO_ROOT" \
gcr.io/coreos-k8s-scale-testing/etcd-operator-builder \
/bin/bash -c "hack/update_vendor.sh && \
hack/build/operator/build -i && \
hack/build/backup-operator/build -i && \
hack/build/restore-operator/build -i && \
go build -i -o ${DOCKER_REPO_ROOT}/_output/bin/logcollector test/logcollector/main.go"
}
function build_and_push_images {
: ${TEST_IMAGE:?"Need to set TEST_IMAGE"}
: ${OPERATOR_IMAGE:?"Need to set OPERATOR_IMAGE"}
IMAGE=${OPERATOR_IMAGE} hack/build/docker_push
TEST_IMAGE=${TEST_IMAGE} test/pod/build
}
build_binaries
build_and_push_images
docker run --rm \
-v "$PWD":"$DOCKER_REPO_ROOT" \
-w "$DOCKER_REPO_ROOT" \
gcr.io/coreos-k8s-scale-testing/etcd-operator-builder \
/bin/bash -c "hack/update_vendor.sh && \
hack/build/operator/build -i && \
hack/build/backup-operator/build -i && \
hack/build/restore-operator/build -i && \
go build -i -o ${DOCKER_REPO_ROOT}/_output/bin/logcollector test/logcollector/main.go"

16
hack/build/e2e/docker_push Executable file
Просмотреть файл

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
: ${TEST_IMAGE:?"Need to set TEST_IMAGE"}
: ${OPERATOR_IMAGE:?"Need to set OPERATOR_IMAGE"}
if ! which docker > /dev/null; then
echo "docker needs to be installed"
exit 1
fi
IMAGE=${OPERATOR_IMAGE} hack/build/docker_push
TEST_IMAGE=${TEST_IMAGE} test/pod/docker_push

Просмотреть файл