Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66c3a4ffcd | |||
| 80ef7ea886 | |||
| 8e68ccd067 | |||
| 5d5d49e154 | |||
| 629d7a61f9 | |||
| 2a58d5baf3 | |||
| 09df88b26f | |||
| edb0f86277 | |||
| 19cca53cb2 | |||
| fd8b22153c | |||
| 855019261b | |||
|
8daaa77d7b
|
|||
| 847f784ea6 | |||
| 7f438b462a | |||
| bc60db7df4 | |||
| e2d5e00f3a | |||
|
0617b6e3c6
|
|||
| 463bf2d1e3 | |||
| 867eedbdbe | |||
| 240ceb8928 | |||
|
85e2fdd31c
|
|||
| d59ffc9796 |
@@ -0,0 +1,45 @@
|
||||
name: Nightly Rebuild
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
hadolint:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
|
||||
with:
|
||||
dockerfile: Dockerfile
|
||||
|
||||
build-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
|
||||
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- id: get-latest-tag
|
||||
run: |
|
||||
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||
- id: meta
|
||||
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6
|
||||
with:
|
||||
images: jcabillot/iperf3
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=raw,value=${{ steps.get-latest-tag.outputs.tag }},enable=${{ steps.get-latest-tag.outputs.tag != '' }}
|
||||
- uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
pull: true
|
||||
@@ -1,46 +0,0 @@
|
||||
name: Docker Build and Push
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
push:
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: jcabillot/iperf3
|
||||
tags: |
|
||||
#type=ref,event=branch
|
||||
#type=ref,event=pr
|
||||
#type=sha
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
pull: true
|
||||
@@ -0,0 +1,63 @@
|
||||
name: Main Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
hadolint:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
|
||||
with:
|
||||
dockerfile: Dockerfile
|
||||
|
||||
build-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
|
||||
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- id: meta
|
||||
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6
|
||||
with:
|
||||
images: jcabillot/iperf3
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
- uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
pull: true
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
|
||||
- run: docker build -t ci-image:${{ github.sha }} .
|
||||
- run: bash tests/test.sh ci-image:${{ github.sha }}
|
||||
|
||||
tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Configure git auth
|
||||
run: |
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@scm.cabillot.eu/perso/iperf3.git"
|
||||
- uses: anothrNick/github-tag-action@4ed44965e0db8dab2b466a16da04aec3cc312fd8 # v1.75.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DEFAULT_BUMP: patch
|
||||
RELEASE_BRANCHES: master
|
||||
WITH_V: true
|
||||
GIT_API_TAGGING: false
|
||||
@@ -0,0 +1,22 @@
|
||||
name: PR Checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
hadolint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
|
||||
with:
|
||||
dockerfile: Dockerfile
|
||||
|
||||
build-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
|
||||
- run: docker build -t ci-image:${{ github.sha }} .
|
||||
- run: bash tests/test.sh ci-image:${{ github.sha }}
|
||||
@@ -0,0 +1,38 @@
|
||||
name: Tag Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['*']
|
||||
|
||||
jobs:
|
||||
hadolint:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
|
||||
with:
|
||||
dockerfile: Dockerfile
|
||||
|
||||
build-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
|
||||
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- id: meta
|
||||
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6
|
||||
with:
|
||||
images: jcabillot/iperf3
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
- uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
pull: true
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
image: "docker:latest"
|
||||
image: docker:latest
|
||||
|
||||
services:
|
||||
- "docker:dind"
|
||||
|
||||
+4
-2
@@ -1,15 +1,17 @@
|
||||
FROM "alpine:3.23"
|
||||
FROM alpine:3.24
|
||||
LABEL maintainer="Cabillot Julien <dockerimages@cabillot.eu>"
|
||||
|
||||
# hadolint ignore=DL3018
|
||||
RUN apk add --no-cache iperf3 && \
|
||||
adduser -D iperf
|
||||
|
||||
## Add Tini
|
||||
#ENV "TINI_VERSION" "v0.16.1"
|
||||
ENV "TINI_VERSION" "v0.16.1"
|
||||
#ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" "/tini"
|
||||
#RUN chmod +x "/tini"
|
||||
#ENTRYPOINT ["/tini", "--"]
|
||||
|
||||
USER "iperf"
|
||||
|
||||
# hadolint ignore=DL4004
|
||||
ENTRYPOINT [ "/usr/bin/iperf3" ]
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"gitlabci": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE="$1"
|
||||
FAILED=0
|
||||
PASSED=0
|
||||
|
||||
assert_eq() {
|
||||
local desc="$1" expected="$2" actual="$3"
|
||||
if [ "$expected" = "$actual" ]; then
|
||||
echo "PASS: $desc"
|
||||
PASSED=$((PASSED + 1))
|
||||
else
|
||||
echo "FAIL: $desc (expected $expected, got $actual)"
|
||||
FAILED=$((FAILED + 1))
|
||||
fi
|
||||
}
|
||||
|
||||
TMPDIR="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMPDIR"' EXIT
|
||||
|
||||
docker run --rm "$IMAGE" --version > "$TMPDIR/output" 2>&1 && RC=0 || RC=$?
|
||||
assert_eq "iperf3 --version exits cleanly" "0" "$RC"
|
||||
|
||||
if [ -s "$TMPDIR/output" ]; then
|
||||
echo "PASS: --version produces output"
|
||||
PASSED=$((PASSED + 1))
|
||||
else
|
||||
echo "FAIL: --version produces no output"
|
||||
FAILED=$((FAILED + 1))
|
||||
fi
|
||||
|
||||
docker run --rm "$IMAGE" --help > "$TMPDIR/output" 2>&1
|
||||
if grep -qi "iperf" "$TMPDIR/output"; then
|
||||
echo "PASS: --help mentions iperf"
|
||||
PASSED=$((PASSED + 1))
|
||||
else
|
||||
echo "FAIL: --help does not mention iperf"
|
||||
FAILED=$((FAILED + 1))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "$PASSED/$((PASSED + FAILED)) tests passed"
|
||||
if [ "$FAILED" -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user