Compare commits

..

No commits in common. "master" and "v0.4.2" have entirely different histories.

10 changed files with 72 additions and 293 deletions

View File

@ -16,7 +16,7 @@ steps:
- name: markdown lint - name: markdown lint
commands: commands:
- markdownlint *.md - markdownlint *.md
image: git.cryptic.systems/volker.raschek/markdownlint:0.44.0 image: git.cryptic.systems/volker.raschek/markdownlint:0.43.0
resources: resources:
limits: limits:
cpu: 150 cpu: 150
@ -67,7 +67,7 @@ steps:
- name: unit-test - name: unit-test
commands: commands:
- go test -v ./... - go test -v ./...
image: docker.io/library/golang:1.24.2 image: docker.io/library/golang:1.24.0
trigger: trigger:
event: event:
@ -92,7 +92,7 @@ steps:
- name: unit-test - name: unit-test
commands: commands:
- go test -v ./... - go test -v ./...
image: docker.io/library/golang:1.24.2 image: docker.io/library/golang:1.24.0
trigger: trigger:
event: event:
@ -123,7 +123,7 @@ steps:
image: git.cryptic.systems/volker.raschek/git:1.4.0 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.18.8 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -190,7 +190,7 @@ steps:
image: git.cryptic.systems/volker.raschek/git:1.4.0 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.18.8 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -257,7 +257,7 @@ steps:
image: git.cryptic.systems/volker.raschek/git:1.4.0 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.18.8 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -322,7 +322,7 @@ steps:
image: git.cryptic.systems/volker.raschek/git:1.4.0 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.18.8 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -506,7 +506,7 @@ steps:
image: git.cryptic.systems/volker.raschek/git:1.4.0 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.18.8 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: true auto_tag: true
auto_tag_suffix: amd64 auto_tag_suffix: amd64
@ -566,7 +566,7 @@ steps:
image: git.cryptic.systems/volker.raschek/git:1.4.0 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.18.8 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: true auto_tag: true
auto_tag_suffix: arm64-v8 auto_tag_suffix: arm64-v8

View File

@ -1,21 +0,0 @@
name: Golang Tests
on:
pull_request:
types: [ "opened", "reopened", "synchronize" ]
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
jobs:
unittest:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.4.0
with:
go-version: stable
- env:
GOPROXY: ${{ vars.GOPROXY }}
run: make test/unit

View File

@ -1,20 +0,0 @@
name: Markdown linter
on:
pull_request:
types: [ "opened", "reopened", "synchronize" ]
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
workflow_dispatch: {}
jobs:
markdown-lint:
container:
image: git.cryptic.systems/volker.raschek/markdownlint:0.44.0
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Lint Markdown files
run: markdownlint --config .markdownlint.yaml .

View File

@ -1,52 +0,0 @@
name: Release
on:
push:
tags: [ '**' ]
permissions:
contents: write
jobs:
release:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: docker/setup-qemu-action@v3.6.0
- uses: actions/setup-go@v5.4.0
with:
go-version: stable
- uses: docker/login-action@v3.4.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- env:
GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
GONOSUMDB: ${{ vars.GONOSUMDB }}
GOPROXY: ${{ vars.GOPROXY }}
uses: goreleaser/goreleaser-action@v6.3.0
with:
version: "~> v2"
args: release --clean
sync-to-hub-docker-io:
needs:
- release
runs-on: ubuntu-latest
steps:
- name: Copy images to docker.io
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
apt-get update --yes
apt-get install --yes skopeo
skopeo copy \
--all \
--dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \
--dest-username ${{ secrets.DOCKER_IO_USERNAME }} \
--src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \
--src-username volker.raschek \
docker://git.cryptic.systems/volker.raschek/dcmerge:${TAG} \
docker://docker.io/volkerraschek/dcmerge:${TAG}

View File

@ -1,19 +0,0 @@
name: Update Docker Hub Description
on:
push:
branches: [ 'master' ]
paths: [ 'README.md' ]
jobs:
update-description-on-hub-docker-io:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: peter-evans/dockerhub-description@v4.0.2
with:
username: ${{ secrets.DOCKER_IO_USERNAME }}
password: ${{ secrets.DOCKER_IO_PASSWORD }}
repository: volkerraschek/dcmerge
readme-filepath: README.md

View File

@ -1,154 +0,0 @@
project_name: dcmerge
archives:
- formats: [ "tar.xz" ]
files:
- README.md
- LICENSE
before:
hooks:
- go mod tidy
builds:
- main: main.go
binary: >-
{{ .ProjectName }}-
{{- .Version }}-
{{- .Os }}-
{{- if eq .Arch "amd64" }}amd64
{{- else if eq .Arch "amd64_v1" }}amd64
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}-{{ .Arm }}{{ end }}
env:
- CGO_ENABLED=0
- GONOSUMDB={{ .Env.GONOSUMDB }}
- GOPROXY={{ .Env.GOPROXY }}
goos:
- linux
goarch:
- amd64
- arm
- arm64
goarm:
- "6"
- "7"
flags:
- -trimpath
ldflags:
- -s -w -X 'main.version={{ trimprefix .Tag "v" }}'
changelog:
filters:
exclude:
- '^chore'
- '^docs'
- '^test'
- Merge pull request
- Merge branch
- go mod tidy
format: "{{.SHA}}: {{.Message}} (@{{.AuthorUsername}})"
groups:
- title: Features
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: "Bug fixes"
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 1
- title: Others
order: 999
sort: asc
use: git
dockers:
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/amd64
- --pull
dockerfile: Dockerfile
goarch: amd64
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-amd64'
skip_push: false
use: buildx
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/arm/v6
- --pull
dockerfile: Dockerfile
goarch: arm
goarm: "6"
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v6'
skip_push: false
use: buildx
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/arm/v7
- --pull
dockerfile: Dockerfile
goarch: arm
goarm: "7"
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v7'
skip_push: false
use: buildx
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/arm64
- --pull
dockerfile: Dockerfile
goarch: arm64
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm64'
skip_push: false
use: buildx
docker_manifests:
- name_template: 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}'
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-amd64'
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v6'
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v7'
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm64'
gitea_urls:
api: https://git.cryptic.systems/api/v1
download: https://git.cryptic.systems
version: 2

View File

@ -1,5 +1,20 @@
FROM scratch AS build FROM docker.io/library/golang:1.23.4-alpine3.19 AS build
COPY dcmerge-* /usr/bin/dcmerge RUN apk add git make
WORKDIR /workspace
ADD ./ /workspace
RUN make install \
DESTDIR=/cache \
PREFIX=/usr \
VERSION=${VERSION}
FROM docker.io/library/alpine:3.21
COPY --from=build /cache /
WORKDIR /workspace
VOLUME [ "/workspace" ]
ENTRYPOINT [ "/usr/bin/dcmerge" ] ENTRYPOINT [ "/usr/bin/dcmerge" ]

View File

@ -26,7 +26,11 @@ DCMERGE_IMAGE_UNQUALIFIED=${DCMERGE_IMAGE_NAMESPACE}/${DCMERGE_IMAGE_NAME}:${DCM
# ============================================================================== # ==============================================================================
dcmerge: dcmerge:
CGO_ENABLED=0 \ CGO_ENABLED=0 \
GOPRIVATE=$(shell go env GOPRIVATE) \
GOPROXY=$(shell go env GOPROXY) \ GOPROXY=$(shell go env GOPROXY) \
GONOPROXY=$(shell go env GONOPROXY) \
GONOSUMDB=$(shell go env GONOSUMDB) \
GOSUMDB=$(shell go env GOSUMDB) \
go build -ldflags "-X 'main.version=${VERSION}'" -o ${@} main.go go build -ldflags "-X 'main.version=${VERSION}'" -o ${@} main.go
# CLEAN # CLEAN
@ -39,20 +43,14 @@ clean:
# ============================================================================== # ==============================================================================
PHONY+=test/unit PHONY+=test/unit
test/unit: test/unit:
CGO_ENABLED=0 \
GOPROXY=$(shell go env GOPROXY) \
go test -v -p 1 -coverprofile=coverage.txt -covermode=count -timeout 1200s ./pkg/... go test -v -p 1 -coverprofile=coverage.txt -covermode=count -timeout 1200s ./pkg/...
PHONY+=test/integration PHONY+=test/integration
test/integration: test/integration:
CGO_ENABLED=0 \
GOPROXY=$(shell go env GOPROXY) \
go test -v -p 1 -count=1 -timeout 1200s ./it/... go test -v -p 1 -count=1 -timeout 1200s ./it/...
PHONY+=test/coverage PHONY+=test/coverage
test/coverage: test/unit test/coverage: test/unit
CGO_ENABLED=0 \
GOPROXY=$(shell go env GOPROXY) \
go tool cover -html=coverage.txt go tool cover -html=coverage.txt
# GOLANGCI-LINT # GOLANGCI-LINT

View File

@ -1,5 +1,6 @@
# dcmerge # dcmerge
[![Build Status](https://drone.cryptic.systems/api/badges/volker.raschek/dcmerge/status.svg)](https://drone.cryptic.systems/volker.raschek/dcmerge)
[![Docker Pulls](https://img.shields.io/docker/pulls/volkerraschek/dcmerge)](https://hub.docker.com/r/volkerraschek/dcmerge) [![Docker Pulls](https://img.shields.io/docker/pulls/volkerraschek/dcmerge)](https://hub.docker.com/r/volkerraschek/dcmerge)
`dcmerge` is a small program to merge docker-compose files from multiple sources. It is available via RPM and docker. `dcmerge` is a small program to merge docker-compose files from multiple sources. It is available via RPM and docker.

View File

@ -1,10 +1,41 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ "assignees": [ "volker.raschek" ],
"local>volker.raschek/renovate-config:default#master", "labels": [ "renovate" ],
"local>volker.raschek/renovate-config:container#master", "packageRules": [
"local>volker.raschek/renovate-config:actions#master", {
"local>volker.raschek/renovate-config:golang#master", "addLabels": [ "renovate/droneci", "renovate/automerge" ],
"local>volker.raschek/renovate-config:regexp#master" "automerge": true,
"matchManagers": "droneci",
"matchUpdateTypes": [ "minor", "patch"]
},
{
"description": "Automatically update patch version of used container images in docker files",
"addLabels": [ "renovate/container-image", "renovate/automerge" ],
"automerge": true,
"matchBaseBranches": [ "master" ],
"matchManagers": [ "dockerfile" ],
"matchUpdateTypes": [ "minor", "patch" ]
},
{
"description": "Automatically update minor and patch versions of go modules",
"addLabels": [ "renovate/gomod", "renovate/automerge" ],
"automerge": true,
"matchManagers": [ "gomod" ],
"matchUpdateTypes": [ "minor", "patch" ]
},
{
"description": "Disable major update version of go modules",
"enabled": false,
"matchManagers": [ "gomod" ],
"matchPackageNames": [
"gopkg.in/yaml.v2"
] ]
}
],
"postUpdateOptions": [
"gomodTidy"
],
"rebaseLabel": "renovate/rebase",
"rebaseWhen": "behind-base-branch"
} }