Skip to content

Commit

Permalink
Remove bashbrew (now canonically at https://github.com/docker-library…
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Apr 24, 2020
1 parent 73d7469 commit e9a3c6d
Show file tree
Hide file tree
Showing 514 changed files with 37 additions and 102,965 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
.git
bashbrew/go/bin
bashbrew/go/pkg
bashbrew/go/vendor/bin
bashbrew/go/vendor/pkg
bashbrew/logs
bashbrew/src
35 changes: 18 additions & 17 deletions bashbrew/travis.sh → .travis.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
set -Eeuo pipefail

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
dir="$(readlink -f "$BASH_SOURCE")"
dir="$(dirname "$dir")"
cd "$dir"

repos=( --all )
extraCommands=

: "${TRAVIS_PULL_REQUEST:=}"
: "${TRAVIS_BRANCH:=}"

upstreamRepo='docker-library/official-images'
upstreamBranch='master'
if [ "$TRAVIS_PULL_REQUEST" -a "$TRAVIS_PULL_REQUEST" != 'false' ]; then
if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
upstreamRepo="$TRAVIS_REPO_SLUG"
upstreamBranch="$TRAVIS_BRANCH"
fi
Expand All @@ -18,28 +23,24 @@ HEAD="$(git rev-parse --verify HEAD)"
git fetch -q "https://github.com/$upstreamRepo.git" "refs/heads/$upstreamBranch"
UPSTREAM="$(git rev-parse --verify FETCH_HEAD)"

if [ "$TRAVIS_BRANCH" = 'master' -a "$TRAVIS_PULL_REQUEST" = 'false' ]; then
if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" = 'false' ]; then
# if we're testing master itself, RUN ALL THE THINGS
echo >&2 'Testing master -- BUILD ALL THE THINGS!'
elif [ "$(git diff --numstat "$UPSTREAM...$HEAD" -- ../library | wc -l)" -ne 0 ]; then
elif libraryChanges="$(git diff --numstat "$UPSTREAM...$HEAD" -- library)" && [ "$(wc -l <<<"$libraryChanges")" -ne 0 ]; then
# changes in library/ -- run our extended tests regardless of bashbrew changes
repos=( $(git diff --numstat "$UPSTREAM...$HEAD" -- ../library | awk -F '/' '{ print $2 }') )
repos=( $(awk -F '/' '{ print $2 }' <<<"$libraryChanges") )
extraCommands=1
elif [ "$(git diff --numstat "$UPSTREAM...$HEAD" -- . | wc -l)" -ne 0 ]; then
# changes in bashbrew/ -- keep "--all" so we test the bashbrew script changes appropriately
echo >&2 'Changes in bashbrew/ detected!'
#extraCommands=1 # TODO this takes a lot of load and often fails (force pushes to maintainer branches, etc)
else
# no changes to library/ or bashbrew/ -- skip tests
# no changes to library/ -- skip tests
repos=()
fi

if [ "${#repos[@]}" -eq 0 ]; then
echo >&2 'Skipping test builds: no changes to library/ or bashbrew/ in PR'
echo >&2 'Skipping test builds: no changes to library/ in PR'
exit
fi

export BASHBREW_LIBRARY="$(dirname "$PWD")/library"
export BASHBREW_LIBRARY="$PWD/library"

if badTags="$(bashbrew list "${repos[@]}" | grep -E ':.+latest.*|:.*latest.+')" && [ -n "$badTags" ]; then
echo >&2
Expand All @@ -52,7 +53,7 @@ if badTags="$(bashbrew list "${repos[@]}" | grep -E ':.+latest.*|:.*latest.+')"
fi

if [ -n "$extraCommands" ]; then
naughtyFrom="$(../naughty-from.sh "${repos[@]}")"
naughtyFrom="$(./naughty-from.sh "${repos[@]}")"
if [ -n "$naughtyFrom" ]; then
echo >&2
echo >&2 "Invalid 'FROM' + 'Architectures' combinations detected:"
Expand All @@ -64,7 +65,7 @@ if [ -n "$extraCommands" ]; then
exit 1
fi

naughtyConstraints="$(../naughty-constraints.sh "${repos[@]}")"
naughtyConstraints="$(./naughty-constraints.sh "${repos[@]}")"
if [ -n "$naughtyConstraints" ]; then
echo >&2
echo >&2 "Invalid 'FROM' + 'Constraints' combinations detected:"
Expand All @@ -74,7 +75,7 @@ if [ -n "$extraCommands" ]; then
exit 1
fi

naughtyCommits="$(../naughty-commits.sh "${repos[@]}")"
naughtyCommits="$(./naughty-commits.sh "${repos[@]}")"
if [ -n "$naughtyCommits" ]; then
echo >&2
echo >&2 "Unpleasant commits detected:"
Expand Down
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
language: go
go: 1.12.x
language: bash

install:
- ./bashbrew/bashbrew.sh --help > /dev/null
- export PATH="$PWD/bashbrew/go/bin:$PATH"
- mkdir bin
- bashbrewVersion="$(< bashbrew-version)"
- wget -O bin/bashbrew "https://github.com/docker-library/bashbrew/releases/download/v$bashbrewVersion/bashbrew-amd64"
- chmod +x bin/bashbrew
- export PATH="$PWD/bin:$PATH"
- bashbrew --version

before_script:
- env | sort

script:
- ./bashbrew/travis.sh
- ./.travis.sh
30 changes: 2 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM tianon/docker-tianon
# FYI, this base image is built via test-pr.sh (from https://github.com/docker-library/bashbrew/tree/master/Dockerfile)
FROM oisupport/bashbrew:base

RUN set -eux; \
apt-get update; \
Expand All @@ -9,37 +10,10 @@ RUN set -eux; \
# git for cloning source code
git \
; \
# go for compiling bashbrew (backports to get new enough version and to make it work on s390x)
suite="$(awk '$1 == "deb" && $4 == "main" && $3 !~ /[\/-]/ { print $3; exit }' /etc/apt/sources.list)"; \
echo "deb http://deb.debian.org/debian $suite-backports main" > /etc/apt/sources.list.d/backports.list; \
apt-get update; \
apt-get install -y --no-install-recommends -t "$suite-backports" \
golang-go \
; \
rm -rf /var/lib/apt/lists/*

ENV GOPATH /go
ENV PATH $GOPATH/bin:$PATH

ENV DIR /usr/src/official-images
ENV PATH $DIR/bashbrew/go/bin:$PATH

ENV BASHBREW_LIBRARY $DIR/library
ENV BASHBREW_CACHE /bashbrew-cache

# make sure our default cache dir exists and is writable by anyone (similar to /tmp)
RUN mkdir -p "$BASHBREW_CACHE" \
&& chmod 1777 "$BASHBREW_CACHE"
# (this allows us to decide at runtime the exact uid/gid we'd like to run as)

WORKDIR $DIR
COPY . $DIR

RUN set -eux; \
CGO_ENABLED=0 ./bashbrew/bashbrew.sh --help > /dev/null; \
cp -vL bashbrew/go/bin/bashbrew /usr/local/bin/

VOLUME $BASHBREW_CACHE

RUN ln -s "$PWD/bashbrew/bashbrew-entrypoint.sh" /usr/local/bin/bashbrew-entrypoint.sh
ENTRYPOINT ["bashbrew-entrypoint.sh"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ For image updates which constitute a security fix, there are a few things we rec

#### Multiple Architectures

Each repo can specify multiple architectures for any and all tags. If no architecture is specified, images are built in Linux on `amd64` (aka x86-64). To specify more or different architectures, use the `Architectures` field (comma-delimited list, whitespace is trimmed). Valid architectures are found in [`oci-platform.go`](https://github.com/docker-library/official-images/blob/a7ad3081aa5f51584653073424217e461b72670a/bashbrew/go/vendor/src/github.com/docker-library/go-dockerlibrary/architecture/oci-platform.go#L14-L25):
Each repo can specify multiple architectures for any and all tags. If no architecture is specified, images are built in Linux on `amd64` (aka x86-64). To specify more or different architectures, use the `Architectures` field (comma-delimited list, whitespace is trimmed). Valid architectures are found in [Bashbrew's `oci-platform.go` file](https://github.com/docker-library/bashbrew/blob/v0.1.0/vendor/github.com/docker-library/go-dockerlibrary/architecture/oci-platform.go#L14-L26):

- `amd64`
- `arm32v6`
Expand Down Expand Up @@ -429,4 +429,4 @@ See the [multi-arch section](#multiple-architectures) for details on how to spec

## Bashbrew

Bashbrew (`bashbrew`) is a tool for cloning, building, tagging, and pushing the Docker official images. See [`README.md` in the `bashbrew/` subfolder](bashbrew/README.md) for more information.
Bashbrew (`bashbrew`) is a tool for cloning, building, tagging, and pushing the Docker official images. See [the Bashbrew `README`](https://github.com/docker-library/bashbrew#readme) for more information.
1 change: 1 addition & 0 deletions bashbrew-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
37 changes: 0 additions & 37 deletions bashbrew/.bashbrew-arch-to-goenv.sh

This file was deleted.

6 changes: 0 additions & 6 deletions bashbrew/.dockerignore

This file was deleted.

85 changes: 0 additions & 85 deletions bashbrew/Dockerfile.release

This file was deleted.

88 changes: 0 additions & 88 deletions bashbrew/README.md

This file was deleted.

Loading

0 comments on commit e9a3c6d

Please sign in to comment.