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 #8700 from EOSIO/cicd-base-images-r2.0
Browse files Browse the repository at this point in the history
[2.0.x] Base images pipeline.
  • Loading branch information
scottarnette committed Feb 25, 2020
2 parents dfdaba6 + 643bf30 commit 28b950b
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 3 deletions.
121 changes: 121 additions & 0 deletions .cicd/base-images.yml
@@ -0,0 +1,121 @@
steps:
- wait

- label: ":aws: Amazon_Linux 2 - Base Image Pinned"
command:
- "./.cicd/generate-base-images.sh"
env:
FORCE_BASE_IMAGE: true
IMAGE_TAG: amazon_linux-2-pinned
PLATFORM_TYPE: pinned
agents:
queue: "automation-eks-eos-builder-fleet"
timeout: 180

- label: ":centos: CentOS 7.7 - Base Image Pinned"
command:
- "./.cicd/generate-base-images.sh"
env:
FORCE_BASE_IMAGE: true
IMAGE_TAG: centos-7.7-pinned
PLATFORM_TYPE: pinned
agents:
queue: "automation-eks-eos-builder-fleet"
timeout: 180

- label: ":darwin: macOS 10.14 - Base Image Pinned"
command:
- "git clone git@github.com:EOSIO/eos.git eos && cd eos && git checkout -f $BUILDKITE_BRANCH"
- "cd eos && ./.cicd/platforms/pinned/macos-10.14-pinned.sh"
plugins:
- EOSIO/anka#v0.6.0:
debug: true
vm-name: "10.14.6_6C_14G_40G"
no-volume: true
always-pull: true
wait-network: true
vm-registry-tag: "clean::cicd::git-ssh::nas::brew::buildkite-agent"
failover-registries:
- "registry_1"
- "registry_2"
inherit-environment-vars: true
- EOSIO/skip-checkout#v0.1.1:
cd: ~
agents: "queue=mac-anka-node-fleet"
timeout: 180

- label: ":ubuntu: Ubuntu 16.04 - Base Image Pinned"
command:
- "./.cicd/generate-base-images.sh"
env:
FORCE_BASE_IMAGE: true
IMAGE_TAG: ubuntu-16.04-pinned
PLATFORM_TYPE: pinned
agents:
queue: "automation-eks-eos-builder-fleet"
timeout: 180

- label: ":ubuntu: Ubuntu 18.04 - Base Image Pinned"
command:
- "./.cicd/generate-base-images.sh"
env:
FORCE_BASE_IMAGE: true
IMAGE_TAG: ubuntu-18.04-pinned
PLATFORM_TYPE: pinned
agents:
queue: "automation-eks-eos-builder-fleet"
timeout: 180

- label: ":aws: Amazon_Linux 2 - Base Image Unpinned"
command:
- "./.cicd/generate-base-images.sh"
env:
FORCE_BASE_IMAGE: true
IMAGE_TAG: amazon_linux-2-unpinned
PLATFORM_TYPE: unpinned
agents:
queue: "automation-eks-eos-builder-fleet"
timeout: 180

- label: ":centos: CentOS 7.7 - Base Image Unpinned"
command:
- "./.cicd/generate-base-images.sh"
env:
FORCE_BASE_IMAGE: true
IMAGE_TAG: centos-7.7-unpinned
PLATFORM_TYPE: unpinned
agents:
queue: "automation-eks-eos-builder-fleet"
timeout: 180

- label: ":darwin: macOS 10.14 - Base Image Unpinned"
command:
- "git clone git@github.com:EOSIO/eos.git eos && cd eos && git checkout -f $BUILDKITE_BRANCH"
- "cd eos && ./.cicd/platforms/unpinned/macos-10.14-unpinned.sh"
plugins:
- EOSIO/anka#v0.6.0:
debug: true
vm-name: "10.14.6_6C_14G_40G"
no-volume: true
always-pull: true
wait-network: true
vm-registry-tag: "clean::cicd::git-ssh::nas::brew::buildkite-agent"
failover-registries:
- "registry_1"
- "registry_2"
inherit-environment-vars: true
- EOSIO/skip-checkout#v0.1.1:
cd: ~
agents: "queue=mac-anka-node-fleet"
timeout: 180

- label: ":ubuntu: Ubuntu 18.04 - Base Image Unpinned"
command:
- "./.cicd/generate-base-images.sh"
env:
FORCE_BASE_IMAGE: true
IMAGE_TAG: ubuntu-18.04-unpinned
PLATFORM_TYPE: unpinned
agents:
queue: "automation-eks-eos-builder-fleet"
timeout: 180
11 changes: 8 additions & 3 deletions .cicd/generate-base-images.sh
Expand Up @@ -8,9 +8,14 @@ ORG_REPO=$(echo $FULL_TAG | cut -d: -f1)
TAG=$(echo $FULL_TAG | cut -d: -f2)
EXISTS=$(curl -s -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${ORG_REPO}:pull" | jq --raw-output .token)" "https://registry.hub.docker.com/v2/${ORG_REPO}/manifests/$TAG")
# build, if neccessary
if [[ $EXISTS =~ '404 page not found' || $EXISTS =~ 'manifest unknown' || $FORCE_BASE_IMAGE == 'true' ]]; then # if we cannot pull the image, we build and push it first
docker build -t $FULL_TAG -f $CICD_DIR/platforms/$PLATFORM_TYPE/$IMAGE_TAG.dockerfile .
docker push $FULL_TAG
if [[ $EXISTS =~ '404 page not found' || $EXISTS =~ 'manifest unknown' || $FORCE_BASE_IMAGE == true ]]; then # if we cannot pull the image, we build and push it first
docker build --no-cache -t $FULL_TAG -f $CICD_DIR/platforms/$PLATFORM_TYPE/$IMAGE_TAG.dockerfile .
if [[ $FORCE_BASE_IMAGE != true ]]; then
docker push $FULL_TAG
else
echo "Base image creation successful. Not pushing...".
exit 0
fi
else
echo "$FULL_TAG already exists."
fi

0 comments on commit 28b950b

Please sign in to comment.