Compare commits

...

34 Commits
v0.3.0 ... main

Author SHA1 Message Date
renovate[bot] e712a9f6af
chore(deps): update quay.io/thegeeklab/wp-docker-buildx docker tag to v4 (#69)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-27 08:42:50 +01:00
renovate[bot] 8b75d58e61 chore(docker): update alpine:3.19 docker digest to c5b1261 2024-01-28 08:35:58 +00:00
renovate[bot] a1fdbd35d2
chore(deps): update quay.io/thegeeklab/wp-docker-buildx docker tag to v3 (#67)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-22 12:37:31 +01:00
Robert Kaussow 3a5cd76960
remove unnecessary git fetch command from ci 2024-01-04 21:54:49 +01:00
renovate[bot] 70370f7407
chore(deps): update alpine docker tag to v3.19 (#66)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-08 08:37:12 +01:00
Robert Kaussow e4d973ef81
ci: use git-sv to generate changelog (#65) 2023-12-07 11:38:36 +01:00
renovate[bot] bf941589d8
chore(deps): update quay.io/thegeeklab/wp-docker-buildx docker tag to v2 (#64)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-07 08:39:35 +01:00
renovate[bot] 2f0f46d725 chore(docker): update alpine:3.18 docker digest to 34871e7 2023-12-01 23:39:06 +00:00
renovate[bot] dbfeb75f8f
chore(docker): update alpine:3.18 docker digest to eece025 (#62)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-04 22:38:00 +01:00
Robert Kaussow 4d5fbcb449
fix github required status checks 2023-11-04 22:35:20 +01:00
renovate[bot] 22f01fba8b
chore(docker): update alpine:3.18 docker digest to 7144f7b (#61)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-22 09:39:11 +02:00
Robert Kaussow e4cd9b9bda
fix pipeline deps 2023-08-22 09:36:08 +02:00
Robert Kaussow bbabed7ceb
fix spellcheck 2023-08-22 09:34:19 +02:00
Robert Kaussow 8ee5cd001d
fix pipeline deps 2023-08-22 09:31:46 +02:00
Robert Kaussow 6b19718e32
unify ci config 2023-08-22 09:25:21 +02:00
Robert Kaussow 2195b48f64
fix gh settings name 2023-08-22 09:10:09 +02:00
Robert Kaussow 9b1ca89664
fix containerfile name 2023-08-22 09:09:07 +02:00
Robert Kaussow d10ad6d8de
ci: migrate to woodpecker 2023-08-22 09:07:13 +02:00
renovate[bot] 08ca642858 chore(docker): update alpine:3.18 docker digest to 7144f7b 2023-08-08 00:02:59 +00:00
renovate[bot] 3b55d2b615 chore(docker): update alpine:3.18 docker digest to 82d1e9d 2023-06-15 10:43:45 +00:00
renovate[bot] e569aa1272 chore(docker): update alpine:3.18 docker digest to ac03b2a 2023-06-15 05:17:51 +00:00
renovate[bot] 7811ed7497
chore(deps): update alpine docker tag to v3.18 (#57)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-28 15:27:53 +02:00
Robert Kaussow 768d713216
fix bare url in contribution file 2023-05-03 08:56:30 +02:00
renovate[bot] a53c1f4b63 chore(docker): update alpine:3.17 docker digest to 124c7d2 2023-03-30 00:06:58 +00:00
renovate[bot] 8a75871fab chore(docker): update alpine:3.17 docker digest to ff6bdca 2023-03-13 23:40:58 +00:00
Robert Kaussow 8cc47a9e2a
fix: fix requirements check (#54) 2023-03-02 14:04:24 +01:00
Robert Kaussow 39a235a9e0
fix: fix syntax while using bash fallbacks (#53) 2023-03-02 13:40:42 +01:00
Robert Kaussow 847108a7c9
add netcat fallback information to readme (#52) 2023-03-02 12:54:38 +01:00
Robert Kaussow 3cd05d4e3f
feat: add fallback to /dev/tcp on bash if netcat not found (#51) 2023-03-02 12:50:14 +01:00
renovate[bot] 3774a8541a chore(docker): update alpine:3.17 docker digest to 69665d0 2023-02-11 12:51:51 +00:00
renovate[bot] bb872933b3 chore(docker): update alpine:3.17 docker digest to c8deccd 2023-02-11 02:54:33 +00:00
Robert Kaussow 2a845277db
ci: bump container build plugin to drone-docker-buildx:23 (#48) 2023-02-09 19:39:54 +01:00
Robert Kaussow 1676a004d0
sign drone config 2023-02-08 21:38:26 +01:00
Robert Kaussow 6b7c59c515
fix drone-matrix template 2023-02-08 21:33:49 +01:00
17 changed files with 296 additions and 284 deletions

View File

@ -1,23 +0,0 @@
# Changelog
{{ range .Versions -}}
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pull/${2}") | trim }}
{{ end }}
{{- end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

View File

@ -1,25 +0,0 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/thegeeklab/wait-for
options:
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
chore: Others
test: Testing
ci: CI Pipeline
docs: Documentation
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE

3
.dictionary Normal file
View File

@ -0,0 +1,3 @@
Netcat
synchronizer
eficode

View File

@ -1,225 +0,0 @@
---
kind: pipeline
name: test
platform:
os: linux
arch: amd64
steps:
- name: lint
image: koalaman/shellcheck-alpine:stable
commands:
- shellcheck ./wait-for
- name: test
image: bats/bats
commands:
- bats ./wait-for.bats
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: build-package
platform:
os: linux
arch: amd64
steps:
- name: checksum
image: alpine
commands:
- sha256sum wait-for > sha256sum.txt
- name: changelog-generate
image: thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- name: changelog-format
image: thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
- name: publish-github
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- wait-for
- sha256sum.txt
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container
platform:
os: linux
arch: amd64
steps:
- name: dryrun
image: thegeeklab/drone-docker-buildx:20
settings:
dockerfile: Dockerfile.multiarch
dry_run: true
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
- name: publish-dockerhub
image: thegeeklab/drone-docker-buildx:20
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker-buildx:20
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
password:
from_secret: quay_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: pushrm-dockerhub
pull: always
image: chko/docker-pushrm:1
environment:
DOCKER_PASS:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
PUSHRM_FILE: README.md
PUSHRM_SHORT: Poor-mans docker service synchronizer
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-quay
pull: always
image: chko/docker-pushrm:1
environment:
APIKEY__QUAY_IO:
from_secret: quay_token
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: matrix
image: thegeeklab/drone-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
trigger:
ref:
- refs/heads/main
- refs/tags/**
status:
- success
- failure
depends_on:
- build-container
---
kind: signature
hmac: c9ba430b27bdede43e21fdf8789eb962c9d7048062c7a7c274c08f52d7faeb63
...

View File

@ -50,7 +50,10 @@ branches:
required_status_checks:
strict: false
contexts:
- continuous-integration/drone/pr
enforce_admins: true
- ci/woodpecker/pr/test
- ci/woodpecker/pr/build-package
- ci/woodpecker/pr/build-container
- ci/woodpecker/pr/docs
enforce_admins: false
required_linear_history: true
restrictions: null

47
.gitsv/config.yml Normal file
View File

@ -0,0 +1,47 @@
---
version: "1.1"
versioning:
update-major: []
update-minor: [feat]
update-patch: [fix, perf, refactor, chore, test, ci, docs]
tag:
pattern: "v%d.%d.%d"
release-notes:
sections:
- name: Features
commit-types: [feat]
section-type: commits
- name: Bug Fixes
commit-types: [fix]
section-type: commits
- name: Performance Improvements
commit-types: [perf]
section-type: commits
- name: Code Refactoring
commit-types: [refactor]
section-type: commits
- name: Others
commit-types: [chore]
section-type: commits
- name: Testing
commit-types: [test]
section-type: commits
- name: CI Pipeline
commit-types: [ci]
section-type: commits
- name: Documentation
commit-types: [docs]
section-type: commits
- name: Breaking Changes
section-type: breaking-changes
commit-message:
footer:
issue:
key: issue
add-value-prefix: "#"
issue:
regex: "#?[0-9]+"

6
.markdownlint.yml Normal file
View File

@ -0,0 +1,6 @@
---
default: True
MD013: False
MD041: False
MD004:
style: dash

View File

@ -1,3 +1,2 @@
.drone.yml
*.tpl.md
LICENSE

View File

@ -0,0 +1,72 @@
---
when:
- event: [pull_request, tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
steps:
dryrun:
image: quay.io/thegeeklab/wp-docker-buildx:4
settings:
containerfile: Containerfile.multiarch
dry_run: true
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${CI_REPO_NAME}
when:
- event: [pull_request]
publish-dockerhub:
group: build
image: quay.io/thegeeklab/wp-docker-buildx:4
settings:
auto_tag: true
containerfile: Containerfile.multiarch
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${CI_REPO_NAME}
username:
from_secret: docker_username
when:
- event: [tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
publish-quay:
group: build
image: quay.io/thegeeklab/wp-docker-buildx:4
settings:
auto_tag: true
containerfile: Containerfile.multiarch
password:
from_secret: quay_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
registry: quay.io
repo: quay.io/thegeeklab/${CI_REPO_NAME}
username:
from_secret: quay_username
when:
- event: [tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
depends_on:
- test

View File

@ -0,0 +1,36 @@
---
when:
- event: [pull_request, tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
steps:
checksum:
image: quay.io/thegeeklab/alpine-tools
commands:
- sha256sum wait-for > sha256sum.txt
changelog:
image: quay.io/thegeeklab/git-sv
commands:
- git sv current-version
- git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md
- cat CHANGELOG.md
publish-github:
image: docker.io/plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- wait-for
- sha256sum.txt
note: CHANGELOG.md
overwrite: true
title: ${CI_COMMIT_TAG}
when:
- event: [tag]
depends_on:
- test

55
.woodpecker/docs.yml Normal file
View File

@ -0,0 +1,55 @@
---
when:
- event: [pull_request, tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
steps:
markdownlint:
image: quay.io/thegeeklab/markdownlint-cli
commands:
- markdownlint 'README.md' 'CONTRIBUTING.md'
spellcheck:
image: quay.io/thegeeklab/alpine-tools
commands:
- spellchecker --files 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls
environment:
FORCE_COLOR: "true"
NPM_CONFIG_LOGLEVEL: "error"
pushrm-dockerhub:
image: docker.io/chko/docker-pushrm:1
secrets:
- source: docker_password
target: DOCKER_PASS
- source: docker_username
target: DOCKER_USER
environment:
PUSHRM_FILE: README.md
PUSHRM_SHORT: Poor-mans service synchronizer
PUSHRM_TARGET: ${CI_REPO}
when:
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
status: [success]
pushrm-quay:
image: docker.io/chko/docker-pushrm:1
secrets:
- source: quay_token
target: APIKEY__QUAY_IO
environment:
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/${CI_REPO}
when:
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
status: [success]
depends_on:
- build-package
- build-container

26
.woodpecker/notify.yml Normal file
View File

@ -0,0 +1,26 @@
---
when:
- event: [tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
runs_on: [success, failure]
steps:
matrix:
image: quay.io/thegeeklab/wp-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
username:
from_secret: matrix_username
when:
- status: [success, failure]
depends_on:
- docs

25
.woodpecker/test.yml Normal file
View File

@ -0,0 +1,25 @@
---
when:
- event: [pull_request, tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
steps:
lint:
group: test
image: docker.io/koalaman/shellcheck-alpine:stable
commands:
- shellcheck ./wait-for
test-ncat:
group: test
image: docker.io/bats/bats
commands:
- bats ./wait-for.bats
test-bash:
image: docker.io/bats/bats
commands:
- rm -rf /usr/bin/nc
- bats ./wait-for.bats

View File

@ -3,7 +3,7 @@
## Security
If you think you have found a **security issue**, please do not mention it in this repository.
Instead, send an email to security@thegeeklab.de with as many details as possible so it can be handled confidential.
Instead, send an email to `security@thegeeklab.de` with as many details as possible so it can be handled confidential.
## Bug Reports and Feature Requests

View File

@ -1,4 +1,4 @@
FROM alpine:3.17@sha256:f271e74b17ced29b915d351685fd4644785c6d1559dd1f2d4189a5e851ef753a
FROM alpine:3.19@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"

View File

@ -1,8 +1,8 @@
# wait-for
Poor-mans servie synchronizer
Poor-mans service synchronizer
[![Build Status](https://img.shields.io/drone/build/thegeeklab/wait-for?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/wait-for)
[![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/wait-for/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/wait-for)
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/wait-for)
[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/wait-for)
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/wait-for)](https://github.com/thegeeklab/wait-for/graphs/contributors)
@ -29,7 +29,7 @@ optional arguments:
## Dependencies
- Installed Netcat
- Installed Netcat or Bash (to use `/dev/tcp`)
## Examples

View File

@ -24,7 +24,12 @@ USAGE
wait_for() {
for _ in $(seq "$WAITFOR_TIMEOUT"); do
nc -w 1 -z "$WAITFOR_HOST" "$WAITFOR_PORT" >/dev/null 2>&1
if [ "$HAS_NC" = 1 ]; then
nc -w 1 -z "$WAITFOR_HOST" "$WAITFOR_PORT" >/dev/null 2>&1
elif [ "$HAS_BASH" = 1 ]; then
# shellcheck disable=SC3025
bash -c "</dev/tcp/$WAITFOR_HOST/$WAITFOR_PORT" >/dev/null 2>&1
fi
result=$?
if [ $result -eq 0 ]; then
@ -73,8 +78,16 @@ while [ $# -gt 0 ]; do
esac
done
if ! [ -x "$(command -v nc)" ]; then
echoerr "error: netcat is required for wait-for to run"
if [ -x "$(command -v nc)" ]; then
HAS_NC=1
fi
if [ -x "$(command -v bash)" ]; then
HAS_BASH=1
fi
if [ "$HAS_NC" != 1 ] && [ "$HAS_BASH" != 1 ]; then
echoerr "error: netcat or bash is required for wait-for to run"
exit 1
fi