Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9900 from EOSIO/egonz/release2.1.x
Browse files Browse the repository at this point in the history
Egonz/release2.1.x
  • Loading branch information
scottarnette authored Jan 14, 2021
2 parents c32975d + 458edfe commit 2a30aec
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .cicd/create-docker-from-binary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

set -euo pipefail

buildkite-agent artifact download '*.deb' --step ':ubuntu: Ubuntu 18.04 - Package Builder' .
echo ":done: download successful"

SANITIZED_BRANCH=$(echo "$BUILDKITE_BRANCH" | sed 's.^/..' | sed 's/[:/]/_/g')
SANITIZED_TAG=$(echo "$BUILDKITE_TAG" | sed 's.^/..' | tr '/' '_')
echo "$SANITIZED_BRANCH"
echo "$SANITIZED_TAG"

# do docker build
echo ":docker::build: Building image..."
DOCKERHUB_REGISTRY="docker.io/eosio/eos"

BUILD_TAG=${BUILDKITE_BUILD_NUMBER:-latest}
DOCKER_BUILD_GEN="docker build -t eos_image:$BUILD_TAG -f ./docker/dockerfile ."
echo "$ $DOCKER_BUILD_GEN"
eval $DOCKER_BUILD_GEN

#tag and push on each destination AWS & DOCKERHUB

EOSIO_REGS=("$EOSIO_REGISTRY" "$DOCKERHUB_REGISTRY")
for REG in ${EOSIO_REGS[@]}; do
DOCKER_TAG_COMMIT="docker tag eos_image:$BUILD_TAG $REG:$BUILDKITE_COMMIT"
DOCKER_TAG_BRANCH="docker tag eos_image:$BUILD_TAG $REG:$SANITIZED_BRANCH"
echo -e "$ Tagging Images: \n$DOCKER_TAG_COMMIT \n$DOCKER_TAG_BRANCH"
eval $DOCKER_TAG_COMMIT
eval $DOCKER_TAG_BRANCH
DOCKER_PUSH_COMMIT="docker push $REG:$BUILDKITE_COMMIT"
DOCKER_PUSH_BRANCH="docker push $REG:$SANITIZED_BRANCH"
echo -e "$ Pushing Images: \n$DOCKER_PUSH_COMMIT \n$DOCKER_PUSH_BRANCH"
eval $DOCKER_PUSH_COMMIT
eval $DOCKER_PUSH_BRANCH
CLEAN_IMAGE_COMMIT="docker rmi $REG:$BUILDKITE_COMMIT"
CLEAN_IMAGE_BRANCH="docker rmi $REG:$SANITIZED_BRANCH"
echo -e "Cleaning Up: \n$CLEAN_IMAGE_COMMIT \n$CLEAN_IMAGE_BRANCH$"
eval $CLEAN_IMAGE_COMMIT
eval $CLEAN_IMAGE_BRANCH
if [[ ! -z "$SANITIZED_TAG" ]]; then
DOCKER_TAG="docker tag eos_image $REG:$SANITIZED_TAG"
DOCKER_REM="docker rmi $REG:$SANITIZED_TAG"
echo -e "$ \n Tagging Image: \n$DOCKER_TAG \n Cleaning Up: \n$DOCKER_REM"
eval $DOCKER_TAG
eval $DOCKER_REM
fi
done

DOCKER_GEN="docker rmi eos_image:$BUILD_TAG"
echo "Clean up base image"
eval $DOCKER_GEN
7 changes: 7 additions & 0 deletions .cicd/generate-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -657,5 +657,12 @@ cat <<EOF
timeout: "${TIMEOUT:-5}"
skip: ${SKIP_PACKAGE_BUILDER}${SKIP_MAC}${SKIP_MACOS_10_14}
- label: ":docker: :ubuntu: Docker - Build 18.04 Docker Image"
command: "./.cicd/create-docker-from-binary.sh"
agents:
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
skip: ${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}${SKIP_PACKAGE_BUILDER}
timeout: ${TIMEOUT:-10}
EOF
IFS=$oIFS
8 changes: 8 additions & 0 deletions docker/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:18.04

COPY *.deb /

RUN apt update && \
apt install -y curl wget && \
apt install -y /*.deb && \
rm -rf /*.deb /var/lib/apt/lists/*

0 comments on commit 2a30aec

Please sign in to comment.