Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions hack/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi
# Extract the release achives to a staging area.
os::build::detect_local_release_tars "linux"

echo "Building images from release tars:"
echo "Building images from release tars for commit ${OS_RELEASE_COMMIT}:"
echo " primary: $(basename ${OS_PRIMARY_RELEASE_TAR})"
echo " image: $(basename ${OS_IMAGE_RELEASE_TAR})"

Expand All @@ -40,27 +40,27 @@ cp -f "${imagedir}/openshift" images/router/haproxy/bin
cp -f "${imagedir}/pod" images/pod/bin
cp -f "${imagedir}/hello-openshift" examples/hello-openshift/bin

# images that depend on scratch
echo "--- openshift/origin-pod ---"
docker build -t openshift/origin-pod:latest images/pod
# builds an image and tags it two ways - with latest, and with the release tag
function image {
echo "--- $1 ---"
docker build -t $1:latest $2
docker tag $1:latest $1:${OS_RELEASE_COMMIT}
}

# images that depend on scratch
image openshift/origin-pod images/pod
# images that depend on openshift/origin-base
echo "--- openshift/origin ---"
docker build -t openshift/origin:latest images/origin
echo "--- openshift/origin-haproxy-router ---"
docker build -t openshift/origin-haproxy-router:latest images/router/haproxy
echo "--- openshift/hello-openshift ---"
docker build -t openshift/hello-openshift:latest examples/hello-openshift

image openshift/origin images/origin
image openshift/origin-haproxy-router images/router/haproxy
# images that depend on openshift/origin
echo "--- openshift/origin-deployer ---"
docker build -t openshift/origin-deployer:latest images/deployer
echo "--- openshift/origin-docker-builder ---"
docker build -t openshift/origin-docker-builder:latest images/builder/docker/docker-builder
echo "--- openshift/origin-sti-builder ---"
docker build -t openshift/origin-sti-builder:latest images/builder/docker/sti-builder
image openshift/origin-deployer images/deployer
image openshift/origin-docker-builder images/builder/docker/docker-builder
image openshift/origin-sti-builder images/builder/docker/sti-builder
# extra images (not part of infrastructure)
image openshift/hello-openshift examples/hello-openshift
# unpublished images
echo "--- openshift/origin-custom-docker-builder ---"
docker build -t openshift/origin-custom-docker-builder:latest images/builder/docker/custom-docker-builder
echo "--- openshift/sti-image-builder ---"
docker build -t openshift/sti-image-builder:latest images/builder/docker/sti-image-builder
image openshift/origin-custom-docker-builder images/builder/docker/custom-docker-builder
image openshift/sti-image-builder images/builder/docker/sti-image-builder

echo "++ Active images"
docker images | grep openshift/
1 change: 1 addition & 0 deletions hack/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ gzip -f "${context}/archive.tar"
# Perform the build and release in Docker.
cat "${context}/archive.tar.gz" | docker run -i --cidfile="${context}/cid" openshift/origin-release
docker cp $(cat ${context}/cid):/go/src/github.com/openshift/origin/_output/local/releases "${OS_ROOT}/_output/local"
echo "${OS_GIT_COMMIT}" > "${OS_ROOT}/_output/local/releases/.commit"

# Copy the linux release archives release back to the local _output/local/go/bin directory.
os::build::detect_local_release_tars "linux"
Expand Down
1 change: 1 addition & 0 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ os::build::detect_local_release_tars() {

export OS_PRIMARY_RELEASE_TAR="${primary}"
export OS_IMAGE_RELEASE_TAR="${image}"
export OS_RELEASE_COMMIT="$(cat ${OS_LOCAL_RELEASEPATH}/.commit)"
}

# os::build::get_version_vars loads the standard version variables as
Expand Down
18 changes: 14 additions & 4 deletions hack/push-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ else
tag=":latest"
fi

# Source tag
source_tag="${OS_TAG:-}"
if [[ -z "${source_tag}" ]]; then
source_tag="latest"
file="${OS_ROOT}/_output/local/releases/.commit"
if [[ -e ${file} ]]; then
source_tag="$(cat $file)"
fi
fi

base_images=(
openshift/origin-base
openshift/origin-release
Expand All @@ -43,7 +53,7 @@ if [[ "${tag}" == ":latest" ]]; then
if [[ "${OS_PUSH_BASE_IMAGES-}" != "" ]]; then
for image in "${base_images[@]}"; do
if [[ "${OS_PUSH_BASE_REGISTRY-}" != "" ]]; then
docker tag -f "${image}:latest" "${OS_PUSH_BASE_REGISTRY}${image}${tag}"
docker tag -f "${image}:${source_tag}" "${OS_PUSH_BASE_REGISTRY}${image}${tag}"
fi
docker push "${OS_PUSH_BASE_REGISTRY-}${image}${tag}"
done
Expand All @@ -55,19 +65,19 @@ if [[ "${tag}" != ":latest" ]]; then
if [[ -z "${OS_PUSH_LOCAL-}" ]]; then
set -e
for image in "${images[@]}"; do
docker pull "${OS_PUSH_BASE_REGISTRY-}${image}:latest"
docker pull "${OS_PUSH_BASE_REGISTRY-}${image}:${source_tag}"
done
set +e
else
echo "Pushing local :latest images to ${OS_PUSH_BASE_REGISTRY-}*${tag} - CTRL+C to cancel"
echo "Pushing local :${source_tag} images to ${OS_PUSH_BASE_REGISTRY-}*${tag} - CTRL+C to cancel"
read
fi
fi

if [[ "${OS_PUSH_BASE_REGISTRY-}" != "" || "${tag}" != "" ]]; then
set -e
for image in "${images[@]}"; do
docker tag -f "${image}:latest" "${OS_PUSH_BASE_REGISTRY-}${image}${tag}"
docker tag -f "${image}:${source_tag}" "${OS_PUSH_BASE_REGISTRY-}${image}${tag}"
done
set +e
fi
Expand Down
18 changes: 17 additions & 1 deletion hack/test-end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ source "${OS_ROOT}/hack/util.sh"

echo "[INFO] Starting end-to-end test"

# Use either the latest release built images, or latest.
if [[ -z "${USE_IMAGES-}" ]]; then
USE_IMAGES='openshift/origin-${component}:latest'
if [[ -e "${OS_ROOT}/_output/local/releases/.commit" ]]; then
COMMIT="$(cat "${OS_ROOT}/_output/local/releases/.commit")"
USE_IMAGES="openshift/origin-\${component}:${COMMIT}"
fi
fi
# TODO: remove the need for this by making all OpenShift components pullIfPresent
USE_LOCAL_IMAGES="${USE_LOCAL_IMAGES:-true}"

ROUTER_TESTS_ENABLED="${ROUTER_TESTS_ENABLED:-true}"

if [[ -z "${BASETMPDIR-}" ]]; then
Expand Down Expand Up @@ -155,11 +165,17 @@ echo "[INFO] Server logs will be at: ${LOG_DIR}/openshift.log"
echo "[INFO] Test artifacts will be in: ${ARTIFACT_DIR}"
echo "[INFO] Volumes dir is: ${VOLUME_DIR}"
echo "[INFO] Certs dir is: ${CERT_DIR}"
echo "[INFO] Using images: ${USE_IMAGES}"

# Start All-in-one server and wait for health
# Specify the scheme and port for the listen address, but let the IP auto-discover. Set --public-master to localhost, for a stable link to the console.
echo "[INFO] Starting OpenShift server"
sudo env "PATH=${PATH}" OPENSHIFT_ON_PANIC=crash openshift start --listen="${API_SCHEME}://0.0.0.0:${API_PORT}" --public-master="${API_SCHEME}://${PUBLIC_MASTER_HOST}" --hostname="127.0.0.1" --volume-dir="${VOLUME_DIR}" --etcd-dir="${ETCD_DATA_DIR}" --cert-dir="${CERT_DIR}" --loglevel=4 --latest-images &> "${LOG_DIR}/openshift.log" &
sudo env "PATH=${PATH}" OPENSHIFT_ON_PANIC=crash openshift start \
--listen="${API_SCHEME}://0.0.0.0:${API_PORT}" --public-master="${API_SCHEME}://${PUBLIC_MASTER_HOST}" \
--hostname="127.0.0.1" --volume-dir="${VOLUME_DIR}" \
--etcd-dir="${ETCD_DATA_DIR}" --cert-dir="${CERT_DIR}" --loglevel=4 --latest-images \
--images="${USE_IMAGES}" \
&> "${LOG_DIR}/openshift.log" &
OS_PID=$!

if [[ "${API_SCHEME}" == "https" ]]; then
Expand Down