mirror of
https://github.com/thegeeklab/wait-for.git
synced 2024-09-27 17:58:13 +00:00
Compare commits
82 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
91f47a04f8 | ||
|
1eedb3a8b4 | ||
|
6040578c39 | ||
|
bfc0e1cf6c | ||
|
d8e2c1c48e | ||
|
e712a9f6af | ||
|
8b75d58e61 | ||
|
a1fdbd35d2 | ||
3a5cd76960 | |||
|
70370f7407 | ||
e4d973ef81 | |||
|
bf941589d8 | ||
|
2f0f46d725 | ||
|
dbfeb75f8f | ||
4d5fbcb449 | |||
|
22f01fba8b | ||
e4cd9b9bda | |||
bbabed7ceb | |||
8ee5cd001d | |||
6b19718e32 | |||
2195b48f64 | |||
9b1ca89664 | |||
d10ad6d8de | |||
|
08ca642858 | ||
|
3b55d2b615 | ||
|
e569aa1272 | ||
|
7811ed7497 | ||
768d713216 | |||
|
a53c1f4b63 | ||
|
8a75871fab | ||
8cc47a9e2a | |||
39a235a9e0 | |||
847108a7c9 | |||
3cd05d4e3f | |||
|
3774a8541a | ||
|
bb872933b3 | ||
2a845277db | |||
1676a004d0 | |||
6b7c59c515 | |||
2fc8b95346 | |||
|
672c82442b | ||
f4a954f3c2 | |||
|
86f9f9d42e | ||
|
4480818e00 | ||
|
c7e91d808e | ||
|
3759fab112 | ||
|
1e953050d2 | ||
217ef44582 | |||
|
0e71669e19 | ||
2aff7ba92c | |||
d86854cde4 | |||
|
1c29418e76 | ||
|
65b88c6f2e | ||
|
1aefe678a6 | ||
|
8286a297fc | ||
|
7c84118cb2 | ||
|
67ec2f14d9 | ||
7c1abfc165 | |||
|
53fedfcfa8 | ||
|
fb6377959f | ||
|
3a7af11987 | ||
|
cb0743ba85 | ||
0ef8d50723 | |||
064696b222 | |||
b68e5cc674 | |||
e829496461 | |||
ed2bca16d9 | |||
|
25ff8498e5 | ||
|
4aaf084431 | ||
|
82cf8ff037 | ||
|
724fd5b8d1 | ||
|
439994d744 | ||
|
669875dd2a | ||
|
c4f62fffb1 | ||
|
a44ed3857d | ||
a8b79786f6 | |||
b8578cce69 | |||
|
54b3f4a250 | ||
|
e1d5e9002e | ||
|
5fb0915d3e | ||
263216d419 | |||
|
fdd64f69cf |
@ -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 }}{{ .Subject }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end -}}
|
|
||||||
|
|
||||||
{{- if .NoteGroups -}}
|
|
||||||
{{ range .NoteGroups -}}
|
|
||||||
### {{ .Title }}
|
|
||||||
|
|
||||||
{{ range .Notes }}
|
|
||||||
{{ .Body }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
@ -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
3
.dictionary
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Netcat
|
||||||
|
synchronizer
|
||||||
|
eficode
|
241
.drone.jsonnet
241
.drone.jsonnet
@ -1,241 +0,0 @@
|
|||||||
local PipelineTest = {
|
|
||||||
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/master', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineBuildPackage = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'build-package',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'checksum',
|
|
||||||
image: 'alpine',
|
|
||||||
commands: [
|
|
||||||
'sha256sum wait-for > sha256sum.txt',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'changelog',
|
|
||||||
image: 'thegeeklab/git-chglog',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}',
|
|
||||||
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-github',
|
|
||||||
image: 'plugins/github-release',
|
|
||||||
settings: {
|
|
||||||
overwrite: true,
|
|
||||||
api_key: { from_secret: 'github_token' },
|
|
||||||
files: ['wait-for', 'sha256sum.txt'],
|
|
||||||
title: '${DRONE_TAG}',
|
|
||||||
note: 'CHANGELOG.md',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'test',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineBuildContainer(arch='amd64') = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'build-container-' + arch,
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: arch,
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'dryrun',
|
|
||||||
image: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
dry_run: true,
|
|
||||||
dockerfile: 'docker/Dockerfile.' + arch,
|
|
||||||
repo: 'thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
username: { from_secret: 'docker_username' },
|
|
||||||
password: { from_secret: 'docker_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/pull/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-dockerhub',
|
|
||||||
image: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
auto_tag: true,
|
|
||||||
auto_tag_suffix: arch,
|
|
||||||
dockerfile: 'docker/Dockerfile.' + arch,
|
|
||||||
repo: 'thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
username: { from_secret: 'docker_username' },
|
|
||||||
password: { from_secret: 'docker_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/heads/master', 'refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-quay',
|
|
||||||
image: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
auto_tag: true,
|
|
||||||
auto_tag_suffix: arch,
|
|
||||||
dockerfile: 'docker/Dockerfile.' + arch,
|
|
||||||
registry: 'quay.io',
|
|
||||||
repo: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
username: { from_secret: 'quay_username' },
|
|
||||||
password: { from_secret: 'quay_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/heads/master', 'refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'test',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineNotifications = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'notifications',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
image: 'plugins/manifest',
|
|
||||||
name: 'manifest-dockerhub',
|
|
||||||
settings: {
|
|
||||||
ignore_missing: true,
|
|
||||||
auto_tag: true,
|
|
||||||
username: { from_secret: 'docker_username' },
|
|
||||||
password: { from_secret: 'docker_password' },
|
|
||||||
spec: 'docker/manifest.tmpl',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'plugins/manifest',
|
|
||||||
name: 'manifest-quay',
|
|
||||||
settings: {
|
|
||||||
ignore_missing: true,
|
|
||||||
auto_tag: true,
|
|
||||||
username: { from_secret: 'quay_username' },
|
|
||||||
password: { from_secret: 'quay_password' },
|
|
||||||
spec: 'docker/manifest-quay.tmpl',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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: 'plugins/matrix',
|
|
||||||
settings: {
|
|
||||||
homeserver: { from_secret: 'matrix_homeserver' },
|
|
||||||
roomid: { from_secret: 'matrix_roomid' },
|
|
||||||
template: 'Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}',
|
|
||||||
username: { from_secret: 'matrix_username' },
|
|
||||||
password: { from_secret: 'matrix_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success', 'failure'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'build-container-amd64',
|
|
||||||
'build-container-arm',
|
|
||||||
'build-container-arm64',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/master', 'refs/tags/**'],
|
|
||||||
status: ['success', 'failure'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
[
|
|
||||||
PipelineTest,
|
|
||||||
PipelineBuildPackage,
|
|
||||||
PipelineBuildContainer(arch='amd64'),
|
|
||||||
PipelineBuildContainer(arch='arm64'),
|
|
||||||
PipelineBuildContainer(arch='arm'),
|
|
||||||
PipelineNotifications,
|
|
||||||
]
|
|
364
.drone.yml
364
.drone.yml
@ -1,364 +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/master
|
|
||||||
- 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
|
|
||||||
image: thegeeklab/git-chglog
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}
|
|
||||||
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
|
|
||||||
|
|
||||||
- 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/master
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-amd64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
dockerfile: docker/Dockerfile.amd64
|
|
||||||
dry_run: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
- name: publish-dockerhub
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: amd64
|
|
||||||
dockerfile: docker/Dockerfile.amd64
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
- name: publish-quay
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: amd64
|
|
||||||
dockerfile: docker/Dockerfile.amd64
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
registry: quay.io
|
|
||||||
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-arm64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
dockerfile: docker/Dockerfile.arm64
|
|
||||||
dry_run: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
- name: publish-dockerhub
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm64
|
|
||||||
dockerfile: docker/Dockerfile.arm64
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
- name: publish-quay
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm64
|
|
||||||
dockerfile: docker/Dockerfile.arm64
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
registry: quay.io
|
|
||||||
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-arm
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
dry_run: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
- name: publish-dockerhub
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
- name: publish-quay
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
registry: quay.io
|
|
||||||
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: notifications
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: manifest-dockerhub
|
|
||||||
image: plugins/manifest
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
ignore_missing: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
spec: docker/manifest.tmpl
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
|
|
||||||
- name: manifest-quay
|
|
||||||
image: plugins/manifest
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
ignore_missing: true
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
spec: docker/manifest-quay.tmpl
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
|
|
||||||
- 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: plugins/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 }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
|
|
||||||
username:
|
|
||||||
from_secret: matrix_username
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/**
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- build-container-amd64
|
|
||||||
- build-container-arm
|
|
||||||
- build-container-arm64
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: signature
|
|
||||||
hmac: b13616fead2f7e74acb1de005f187debac0ff31355cbcd12ac2e7bc2e5a80239
|
|
||||||
|
|
||||||
...
|
|
18
.github/settings.yml
vendored
18
.github/settings.yml
vendored
@ -1,14 +1,14 @@
|
|||||||
repository:
|
repository:
|
||||||
name: wait-for
|
name: wait-for
|
||||||
description: Poor-mans docker service synchronizer
|
description: Poor-mans service synchronizer
|
||||||
topics: cli, tools, docker
|
topics: cli, tools, oci
|
||||||
|
|
||||||
private: false
|
private: false
|
||||||
has_issues: true
|
has_issues: true
|
||||||
has_wiki: false
|
has_wiki: false
|
||||||
has_downloads: true
|
has_downloads: true
|
||||||
|
|
||||||
default_branch: master
|
default_branch: main
|
||||||
|
|
||||||
allow_squash_merge: true
|
allow_squash_merge: true
|
||||||
allow_merge_commit: true
|
allow_merge_commit: true
|
||||||
@ -44,12 +44,16 @@ labels:
|
|||||||
description: This will not be worked on
|
description: This will not be worked on
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
- name: master
|
- name: main
|
||||||
protection:
|
protection:
|
||||||
required_pull_request_reviews: null
|
required_pull_request_reviews: null
|
||||||
required_status_checks:
|
required_status_checks:
|
||||||
strict: true
|
strict: false
|
||||||
contexts:
|
contexts:
|
||||||
- continuous-integration/drone/pr
|
- ci/woodpecker/pr/test
|
||||||
enforce_admins: null
|
- ci/woodpecker/pr/build-package
|
||||||
|
- ci/woodpecker/pr/build-container
|
||||||
|
- ci/woodpecker/pr/docs
|
||||||
|
enforce_admins: false
|
||||||
|
required_linear_history: true
|
||||||
restrictions: null
|
restrictions: null
|
||||||
|
47
.gitsv/config.yml
Normal file
47
.gitsv/config.yml
Normal 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
6
.markdownlint.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
default: True
|
||||||
|
MD013: False
|
||||||
|
MD041: False
|
||||||
|
MD004:
|
||||||
|
style: dash
|
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*.tpl.md
|
||||||
|
LICENSE
|
72
.woodpecker/build-container.yml
Normal file
72
.woodpecker/build-container.yml
Normal 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:5
|
||||||
|
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:5
|
||||||
|
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:5
|
||||||
|
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
|
36
.woodpecker/build-package.yml
Normal file
36
.woodpecker/build-package.yml
Normal 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
55
.woodpecker/docs.yml
Normal 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
26
.woodpecker/notify.yml
Normal 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
25
.woodpecker/test.yml
Normal 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
|
@ -3,7 +3,7 @@
|
|||||||
## Security
|
## Security
|
||||||
|
|
||||||
If you think you have found a **security issue**, please do not mention it in this repository.
|
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
|
## Bug Reports and Feature Requests
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM amd64/alpine:3.13@sha256:4661fb57f7890b9145907a1fe2555091d333ff3d28db86c3bb906f6a2be93c87
|
FROM alpine:3.20@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 Robert Kaussow <mail@geeklabor.de>
|
Copyright (c) 2022 Robert Kaussow <mail@thegeeklab.de>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
17
README.md
17
README.md
@ -1,15 +1,15 @@
|
|||||||
# wait-for
|
# wait-for
|
||||||
|
|
||||||
Poor-mans docker service 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)
|
[![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)
|
[![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)
|
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/wait-for)](https://github.com/thegeeklab/wait-for/graphs/contributors)
|
||||||
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/wait-for)
|
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/wait-for)
|
||||||
[![License: MIT](https://img.shields.io/github/license/thegeeklab/wait-for)](https://github.com/thegeeklab/wait-for/blob/master/LICENSE)
|
[![License: MIT](https://img.shields.io/github/license/thegeeklab/wait-for)](https://github.com/thegeeklab/wait-for/blob/main/LICENSE)
|
||||||
|
|
||||||
wait-for is a script designed to synchronize services like docker containers. It is [sh](https://en.wikipedia.org/wiki/Bourne_shell) and [alpine](https://alpinelinux.org/) compatible and was forked from [eficode/wait-for](https://github.com/eficode/wait-for).
|
wait-for is a script designed to synchronize services like containers. It is [sh](https://en.wikipedia.org/wiki/Bourne_shell) and [alpine](https://alpinelinux.org/) compatible and was forked from [eficode/wait-for](https://github.com/eficode/wait-for).
|
||||||
|
|
||||||
When using this tool, you only need to pick the `wait-for` file as part of your project.
|
When using this tool, you only need to pick the `wait-for` file as part of your project.
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ When using this tool, you only need to pick the `wait-for` file as part of your
|
|||||||
$ wait-for --help
|
$ wait-for --help
|
||||||
usage: wait-for host:port [-t timeout] [-- command args]
|
usage: wait-for host:port [-t timeout] [-- command args]
|
||||||
|
|
||||||
Synchronize services like docker containers and wait for readiness.
|
Synchronize services like containers and wait for readiness.
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-q | --quiet Do not output any status messages
|
-q | --quiet Do not output any status messages
|
||||||
@ -29,7 +29,7 @@ optional arguments:
|
|||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
- Installed Netcat
|
- Installed Netcat or Bash (to use `/dev/tcp`)
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@ -59,9 +59,8 @@ services:
|
|||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
Special thanks goes to all [contributors](https://github.com/thegeeklab/wait-for/graphs/contributors). If you would like to contribute,
|
Special thanks to all [contributors](https://github.com/thegeeklab/wait-for/graphs/contributors). If you would like to contribute, please see the [instructions](https://github.com/thegeeklab/wait-for/blob/main/CONTRIBUTING.md).
|
||||||
please see the [instructions](https://github.com/thegeeklab/wait-for/blob/master/CONTRIBUTING.md).
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the MIT License - see the [LICENSE](https://github.com/thegeeklab/wait-for/blob/master/LICENSE) file for details.
|
This project is licensed under the MIT License - see the [LICENSE](https://github.com/thegeeklab/wait-for/blob/main/LICENSE) file for details.
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
FROM arm32v7/alpine:3.13@sha256:db5f021b29ec8fcf605f00d2aac06345756b0ffbdea0e7994044fe9172619a0a
|
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.title="wait-for"
|
|
||||||
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/wait-for"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/wait-for"
|
|
||||||
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/wait-for"
|
|
||||||
|
|
||||||
ADD wait-for /usr/local/bin/wait-for
|
|
||||||
|
|
||||||
RUN apk --no-cache add netcat-openbsd
|
|
||||||
|
|
||||||
USER root
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/usr/local/bin/wait-for"]
|
|
@ -1,16 +0,0 @@
|
|||||||
FROM arm64v8/alpine:3.13@sha256:c45a1db6e04b73aad9e06b08f2de11ce8e92d894141b2e801615fa7a8f68314a
|
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.title="wait-for"
|
|
||||||
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/wait-for"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/wait-for"
|
|
||||||
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/wait-for"
|
|
||||||
|
|
||||||
ADD wait-for /usr/local/bin/wait-for
|
|
||||||
|
|
||||||
RUN apk --no-cache add netcat-openbsd
|
|
||||||
|
|
||||||
USER root
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/usr/local/bin/wait-for"]
|
|
@ -1,24 +0,0 @@
|
|||||||
image: quay.io/thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
|
||||||
{{#if build.tags}}
|
|
||||||
tags:
|
|
||||||
{{#each build.tags}}
|
|
||||||
- {{this}}
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
manifests:
|
|
||||||
- image: quay.io/thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
- image: quay.io/thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
||||||
|
|
||||||
- image: quay.io/thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
|
|
||||||
platform:
|
|
||||||
architecture: arm
|
|
||||||
os: linux
|
|
||||||
variant: v7
|
|
@ -1,24 +0,0 @@
|
|||||||
image: thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
|
||||||
{{#if build.tags}}
|
|
||||||
tags:
|
|
||||||
{{#each build.tags}}
|
|
||||||
- {{this}}
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
manifests:
|
|
||||||
- image: thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
- image: thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
||||||
|
|
||||||
- image: thegeeklab/wait-for:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
|
|
||||||
platform:
|
|
||||||
architecture: arm
|
|
||||||
os: linux
|
|
||||||
variant: v7
|
|
50
wait-for
50
wait-for
@ -9,10 +9,10 @@ echoerr() {
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
exitcode="$1"
|
exitcode="$1"
|
||||||
cat << USAGE >&2
|
cat <<USAGE >&2
|
||||||
usage: wait-for host:port [-t timeout] [-- command args]
|
usage: wait-for host:port [-t timeout] [-- command args]
|
||||||
|
|
||||||
Synchronize services like docker containers and wait for readiness.
|
Synchronize services like containers and wait for readiness.
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-q | --quiet Do not output any status messages
|
-q | --quiet Do not output any status messages
|
||||||
@ -23,12 +23,17 @@ USAGE
|
|||||||
}
|
}
|
||||||
|
|
||||||
wait_for() {
|
wait_for() {
|
||||||
for _ in $(seq "$WAITFOR_TIMEOUT") ; do
|
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=$?
|
result=$?
|
||||||
if [ $result -eq 0 ] ; then
|
if [ $result -eq 0 ]; then
|
||||||
if [ $# -gt 0 ] ; then
|
if [ $# -gt 0 ]; then
|
||||||
exec "$@"
|
exec "$@"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
@ -39,43 +44,50 @@ wait_for() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]; do
|
||||||
do
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*:* )
|
*:*)
|
||||||
WAITFOR_HOST=$(printf "%s\n" "$1"| cut -d : -f 1)
|
WAITFOR_HOST=$(printf "%s\n" "$1" | cut -d : -f 1)
|
||||||
WAITFOR_PORT=$(printf "%s\n" "$1"| cut -d : -f 2)
|
WAITFOR_PORT=$(printf "%s\n" "$1" | cut -d : -f 2)
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
-q | --quiet)
|
-q | --quiet)
|
||||||
WAITFOR_QUIET=1
|
WAITFOR_QUIET=1
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
-t)
|
-t)
|
||||||
WAITFOR_TIMEOUT="$2"
|
WAITFOR_TIMEOUT="$2"
|
||||||
if [ "$WAITFOR_TIMEOUT" = "" ]; then break; fi
|
if [ "$WAITFOR_TIMEOUT" = "" ]; then break; fi
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--timeout=*)
|
--timeout=*)
|
||||||
WAITFOR_TIMEOUT="${1#*=}"
|
WAITFOR_TIMEOUT="${1#*=}"
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
--help)
|
--help)
|
||||||
usage 0
|
usage 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echoerr "unknown argument: $1"
|
echoerr "unknown argument: $1"
|
||||||
usage 1
|
usage 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! [ -x "$(command -v nc)" ]; then
|
if [ -x "$(command -v nc)" ]; then
|
||||||
echoerr "error: netcat is required for wait-for to run"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user