Skip to content

Commit

Permalink
Merge pull request #3 from cytopia/release-0.2
Browse files Browse the repository at this point in the history
Offer multiple versions
  • Loading branch information
cytopia committed Mar 29, 2021
2 parents 0b8c03e + b554e36 commit db4598f
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
matrix:
version:
- 'latest'
- '0.15'
- '0.14'
- '0.13'
- '0.12'
- '0.11'
- '0.10'
steps:

# ------------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ jobs:
# Lint repository
# ------------------------------------------------------------
- name: Lint
id: vars
run: |
make lint
7 changes: 6 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
matrix:
version:
- 'latest'
- '0.15'
- '0.14'
- '0.13'
- '0.12'
- '0.11'
- '0.10'
refs:
- 'master'
- '0.1'
steps:

# ------------------------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ FROM alpine:3.13 as builder

RUN set -x \
&& apk add --no-cache \
git \
wget

ARG VERSION
RUN set -x \
&& if [ "${VERSION}" = "latest" ]; then \
wget "https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz"; \
else \
wget "https://github.com/instrumenta/kubeval/releases/download/${VERSION}/kubeval-darwin-amd64.tar.gz"; \
git clone https://github.com/instrumenta/kubeval /tmp/kubeval \
&& cd /tmp/kubeval \
&& VERSION="$( git tag --sort=v:refname | grep -E "^${VERSION}" | tail -1 )" \
&& cd / \
&& echo "${VERSION}" \
&& wget "https://github.com/instrumenta/kubeval/releases/download/${VERSION}/kubeval-linux-amd64.tar.gz"; \
fi \
&& tar xf kubeval-linux-amd64.tar.gz \
&& cp kubeval /usr/bin/kubeval \
Expand Down
44 changes: 41 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,45 @@ help:
# --------------------------------------------------------------------------------------------------
# Lint Targets
# --------------------------------------------------------------------------------------------------
lint:
lint: _lint-files
lint: _lint-workflow

.PHONY: _lint-workflow
_lint-workflow:
@echo "################################################################################"
@echo "# Lint Workflow"
@echo "################################################################################"
@\
GIT_CURR_MAJOR="$$( git tag | sort -V | tail -1 | sed 's|\.[0-9]*$$||g' )"; \
GIT_CURR_MINOR="$$( git tag | sort -V | tail -1 | sed 's|^[0-9]*\.||g' )"; \
GIT_NEXT_TAG="$${GIT_CURR_MAJOR}.$$(( GIT_CURR_MINOR + 1 ))"; \
AVAILABLE_REFS="$$( \
grep 'refs:' -A 100 .github/workflows/nightly.yml \
| grep 'steps:' -B 100 \
| grep -E '[[:space:]]+\-' \
| sed 's/.*\s//g' \
| sed "s/'//g" \
| sed 's/"//g' \
| grep -v master || true \
)"; \
if [ -n "$${AVAILABLE_REFS}" ]; then \
if ! grep 'refs:' -A 100 .github/workflows/nightly.yml \
| grep " - '$${GIT_NEXT_TAG}'" >/dev/null; then \
echo "[ERR] New Tag required in .github/workflows/nightly.yml: $${GIT_NEXT_TAG}"; \
exit 1; \
else \
echo "[OK] Git Tag present in .github/workflows/nightly.yml: $${GIT_NEXT_TAG}"; \
fi \
else \
echo "[OK] No Tags defined at all in .github/workflows/nightly.yml"; \
fi
@echo

.PHONY: lint-files
_lint-files:
@echo "################################################################################"
@echo "# Lint Files"
@echo "################################################################################"
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-cr --text --ignore '.git/,.github/,tests/' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-crlf --text --ignore '.git/,.github/,tests/' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-trailing-single-newline --text --ignore '.git/,.github/,tests/' --path .
Expand Down Expand Up @@ -79,13 +117,13 @@ _test-version:
| grep -Eo '[.0-9]+' \
)"; \
echo "Testing for latest: $${LATEST}"; \
if ! docker run --rm $(IMAGE) --version | grep -E "$${LATEST}$$"; then \
if ! docker run --rm $(IMAGE) --version | grep -E "Version: $${LATEST}$$"; then \
echo "Failed"; \
exit 1; \
fi; \
else \
echo "Testing for tag: $(VERSION)"; \
if ! docker run --rm $(IMAGE) --version | grep -E "^$(VERSION)"; then \
if ! docker run --rm $(IMAGE) --version | grep -E "Version: $(VERSION)"; then \
echo "Failed"; \
exit 1; \
fi; \
Expand Down
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,37 @@ The image is built nightly against multiple stable versions and pushed to Docker

## Available Docker image versions

| Docker tag | Build from |
|------------|------------|
| `latest` | Latest stable version |
#### Rolling releaess

The following Docker image tags are rolling releases and are built and updated every night.

[![nightly](https://github.com/cytopia/docker-kubeval/workflows/nightly/badge.svg)](https://github.com/cytopia/docker-kubeval/actions?query=workflow%3Anightly)

| Docker tag | Explanation |
|-----------------|-------------|
| `latest` | Latest stable version |
| `0.15` | Latest stable `0.15.x` version |
| `0.14` | Latest stable `0.14.x` version |
| `0.13` | Latest stable `0.13.x` version |
| `0.12` | Latest stable `0.12.x` version |
| `0.11` | Latest stable `0.11.x` version |
| `0.10` | Latest stable `0.10.x` version |

#### Point in time releases

The following Docker image tags are built once and can be used for reproducible builds. Its version never changes so you will have to update tags in your pipelines from time to time in order to stay up-to-date.

[![build](https://github.com/cytopia/docker-kubeval/workflows/build/badge.svg)](https://github.com/cytopia/docker-kubeval/actions?query=workflow%3Abuild)

| Docker tag | Explanation |
|-----------------|-------------|
| `latest-<TAG>` | Latest stable version when this repository was git tagged |
| `0.15-<TAG>` | Latest stable 0.15.x version when this repository was git tagged |
| `0.14-<TAG>` | Latest stable 0.14.x version when this repository was git tagged |
| `0.13-<TAG>` | Latest stable 0.13.x version when this repository was git tagged |
| `0.12-<TAG>` | Latest stable 0.12.x version when this repository was git tagged |
| `0.11-<TAG>` | Latest stable 0.11.x version when this repository was git tagged |
| `0.10-<TAG>` | Latest stable 0.10.x version when this repository was git tagged |


## Docker mounts
Expand Down

0 comments on commit db4598f

Please sign in to comment.