51 Commits

Author SHA1 Message Date
volker.raschek 86695b62ec Merge pull request 'chore(deps): update docker.io/library/alpine docker tag to v3.19.0' (#24) from renovate/docker.io-library-alpine-3.x into master
continuous-integration/drone/push Build is passing
Reviewed-on: #24
2023-12-20 11:16:03 +00:00
CSRBot dc861f13b1 chore(deps): update docker.io/library/alpine docker tag to v3.19.0
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-12-13 17:43:44 +00:00
CSRBot 9a3c64e91a chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.38.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-09 14:33:36 +00:00
CSRBot 610dd87a4b chore(deps): update quay.io/skopeo/stable docker tag to v1.14.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-06 17:17:51 +01:00
CSRBot 165cd6a778 chore(deps): update docker.io/library/alpine docker tag to v3.18.5
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-06 02:03:16 +01:00
CSRBot 2f9a7d0dd5 chore(deps): update docker.io/library/golang docker tag to v1.21.5
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-05 23:05:16 +00:00
volker.raschek b83efda648 test(assets): add depends_on as example
continuous-integration/drone/push Build is passing
2023-11-25 18:21:07 +01:00
volker.raschek 5dea30fec0 fix(domain): iterate when merging over custom configs
The normal dcmerge did not work, as the check and addition was only
possible if at least one attribute such as service, network or volume
was presentThe normal dcmerge did not work, as the check and addition
was only possible if at least one attribute such as service, network or
volume was present.

The logic was adjusted.

The logic was adjusted.
2023-11-25 18:21:07 +01:00
volker.raschek 3d97ee0ab8 fix(lint): increase line length to 120 2023-11-25 18:21:07 +01:00
volker.raschek 8b68c9587c feat: support depends_on 2023-11-25 18:21:07 +01:00
CSRBot 669ebd0f25 chore(deps): update docker.io/plugins/docker docker tag to v20.17.1
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-15 14:07:06 +00:00
CSRBot 8f794494a2 chore(deps): update docker.io/library/golang docker tag to v1.21.4
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-07 23:05:08 +00:00
CSRBot 8e411cc486 chore(deps): update module github.com/spf13/cobra to v1.8.0
continuous-integration/drone/push Build is passing
2023-11-05 23:24:28 +01:00
CSRBot d7e8970860 Merge pull request 'chore(deps): update docker.io/plugins/docker docker tag to v20.17.0' (#1) from renovate/docker.io-plugins-docker-20.x into master
continuous-integration/drone/push Build is passing
2023-10-31 02:06:11 +00:00
CSRBot 8603eca0b5 chore(deps): update docker.io/plugins/docker docker tag to v20.17.0
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-10-30 23:05:33 +00:00
volker.raschek d8ada5578b fix(ci): unsupport arm v7
continuous-integration/drone/push Build is passing
2023-10-30 21:32:36 +01:00
CSRBot 4f5d115926 chore(deps): update docker.io/library/golang docker tag to v1.21.3
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-11 07:49:22 +02:00
CSRBot dac3be4e2d chore(deps): update docker.io/library/golang docker tag to v1.21.2
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-06 20:32:36 +02:00
CSRBot 173637693f chore(deps): update git.cryptic.systems/volker.raschek/drone-email docker tag to v0.1.5
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-03 19:18:35 +02:00
CSRBot 3ba641aa12 chore(deps): update git.cryptic.systems/volker.raschek/git docker tag to v1.3.1
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-03 10:27:29 +02:00
CSRBot 768a49319d chore(deps): update quay.io/skopeo/stable docker tag to v1.13.3
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-29 00:38:35 +02:00
CSRBot 66f5fff92a chore(deps): update docker.io/library/alpine docker tag to v3.18.4
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-29 00:15:33 +02:00
CSRBot b6b2e069cd chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.37.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-22 19:33:41 +02:00
CSRBot 2c738d0417 chore(deps): update docker.io/library/golang docker tag to v1.21.1
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-06 21:31:18 +02:00
volker.raschek 46dd067b48 fix(renovate): exclude updating docker.io/plugins/docker
continuous-integration/drone/push Build is passing
2023-09-03 16:37:08 +02:00
CSRBot 9669685997 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.36.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-03 13:52:59 +02:00
CSRBot 9a76f3432a chore(deps): update quay.io/skopeo/stable docker tag to v1.13.2
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-29 22:02:10 +02:00
volker.raschek 751bb810d2 fix(dockerCompose): protect of empty attributes 2023-08-28 11:37:24 +02:00
volker.raschek 9b469bd8c6 fix: rename firstWin to existingWin 2023-08-28 11:13:32 +02:00
volker.raschek 4ad9da6d63 fix(cmd): add flag first-win 2023-08-28 10:57:36 +02:00
volker.raschek 2ea83b7591 fix(dockerCompose): add MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 6f673e4a72 test: add example docker-compose 2023-08-28 10:57:36 +02:00
volker.raschek d9ecf068c9 fix(dockerCompose): add Service.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 4c3c6cd5d2 fix(dockerCompose): add ServiceDeploy.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 23290fbd5d fix(dockerCompose): add ServiceDeployResources.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 07673bfd53 fix(dockerCompose): add ServiceDeployResourcesLimits.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 405a0258f1 fix(dockerCompose): add ServiceNetwork.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 462299d5cd fix(dockerCompose): add ServiceUlimits.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 6524785871 test(dockerCompose): add ServiceUlimitsNoFile.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 1207bcfcab test(dockerCompose): add Volume.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek a656dc2db1 fix(dockerCompose): add ServiceUlimitsNoFile.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 14c645dd96 fix(dockerCompose): add Volume.MergeFirstWin() 2023-08-28 10:57:36 +02:00
volker.raschek 7b0109caf4 Merge pull request 'chore(deps): update dependency docker.io/library/golang to v1.21.0' (#6) from renovate/docker.io-library-golang-1.x into master
continuous-integration/drone/push Build is passing
Reviewed-on: #6
2023-08-16 17:48:01 +00:00
CSRBot 6bfd49947e chore(deps): update dependency docker.io/library/golang to v1.21.0
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-08-10 15:41:23 +02:00
CSRBot 04e0d98dde chore(deps): update dependency docker.io/library/alpine to v3.18.3
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-07 23:42:48 +02:00
volker.raschek 87ec3349ea fix(ci): execute linter and unit-test in parallel
continuous-integration/drone/push Build is passing
2023-08-02 23:26:19 +02:00
volker.raschek ad1cf8cbef fix(ci): execute unit tests on dry-run
continuous-integration/drone/push Build encountered an error
2023-08-02 23:20:38 +02:00
volker.raschek 16f1f5e9da fix(ci): execute unit tests
continuous-integration/drone/push Build is passing
2023-08-02 23:19:08 +02:00
CSRBot 35d35f0b20 chore(deps): update dependency docker.io/library/golang to v1.20.7
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-02 00:43:07 +02:00
CSRBot 0375ccbf69 chore(deps): update dependency quay.io/skopeo/stable to v1.13.1
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-31 01:22:48 +02:00
volker.raschek ce48d6dd0c fix(dockerCompose): mergeLastWinImage
continuous-integration/drone/push Build is passing
2023-07-26 14:44:12 +02:00
13 changed files with 2626 additions and 268 deletions
+88 -223
View File
@@ -11,12 +11,12 @@ platform:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: markdown lint
commands:
- markdownlint *.md
image: git.cryptic.systems/volker.raschek/markdownlint:0.35.0
image: git.cryptic.systems/volker.raschek/markdownlint:0.38.0
resources:
limits:
cpu: 150
@@ -34,7 +34,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
resources:
limits:
cpu: 150
@@ -49,6 +49,59 @@ trigger:
exclude:
- tag
---
kind: pipeline
type: docker
name: unit-test-amd64
clone:
disable: true
platform:
arch: amd64
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: unit-test
commands:
- go test -v ./...
image: docker.io/library/golang:1.21.5
trigger:
event:
exclude:
- tag
---
kind: pipeline
type: docker
name: unit-test-arm64
clone:
disable: true
platform:
arch: arm64
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: unit-test
commands:
- go test -v ./...
image: docker.io/library/golang:1.21.5
trigger:
event:
include:
- pull_request
- push
exclude:
- tag
---
kind: pipeline
type: docker
@@ -59,6 +112,7 @@ clone:
depends_on:
- linter
- unit-test-amd64
platform:
os: linux
@@ -66,10 +120,10 @@ platform:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build
image: docker.io/plugins/docker:20.10.9
image: docker.io/plugins/docker:20.17.1
settings:
auto_tag: false
dockerfile: Dockerfile
@@ -99,73 +153,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
when:
status:
- changed
- failure
trigger:
branch:
exclude:
- master
event:
- pull_request
- push
repo:
- volker.raschek/dcmerge
---
kind: pipeline
type: docker
name: dry-run-arm-v7
clone:
disable: true
depends_on:
- linter
platform:
os: linux
arch: arm
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
- name: build
image: docker.io/plugins/docker:20.10.9
settings:
auto_tag: false
dockerfile: Dockerfile
dry_run: true
force_tag: true
no_cache: true
purge: true
mirror:
from_secret: docker_io_mirror
registry: git.cryptic.systems
repo: git.cryptic.systems/volker.raschek/dcmerge
tags: latest-arm-v7
username:
from_secret: git_cryptic_systems_container_registry_user
password:
from_secret: git_cryptic_systems_container_registry_password
- name: email-notification
environment:
SMTP_FROM_ADDRESS:
from_secret: smtp_from_address
SMTP_FROM_NAME:
from_secret: smtp_from_name
SMTP_HOST:
from_secret: smtp_host
SMTP_USERNAME:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
when:
status:
- changed
@@ -191,6 +179,7 @@ clone:
depends_on:
- linter
- unit-test-arm64
platform:
os: linux
@@ -198,10 +187,10 @@ platform:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build
image: docker.io/plugins/docker:20.10.9
image: docker.io/plugins/docker:20.17.1
settings:
auto_tag: false
dockerfile: Dockerfile
@@ -231,7 +220,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
when:
status:
- changed
@@ -257,6 +246,7 @@ clone:
depends_on:
- linter
- unit-test-amd64
platform:
os: linux
@@ -264,10 +254,10 @@ platform:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build
image: docker.io/plugins/docker:20.10.9
image: docker.io/plugins/docker:20.17.1
settings:
auto_tag: false
dockerfile: Dockerfile
@@ -296,71 +286,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
when:
status:
- changed
- failure
trigger:
branch:
- master
event:
- cron
- push
repo:
- volker.raschek/dcmerge
---
kind: pipeline
type: docker
name: latest-arm-v7
clone:
disable: true
depends_on:
- linter
platform:
os: linux
arch: arm
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
- name: build
image: docker.io/plugins/docker:20.10.9
settings:
auto_tag: false
dockerfile: Dockerfile
force_tag: true
no_cache: true
purge: true
mirror:
from_secret: docker_io_mirror
registry: git.cryptic.systems
repo: git.cryptic.systems/volker.raschek/dcmerge
tags: latest-arm-v7
username:
from_secret: git_cryptic_systems_container_registry_user
password:
from_secret: git_cryptic_systems_container_registry_password
- name: email-notification
environment:
SMTP_FROM_ADDRESS:
from_secret: smtp_from_address
SMTP_FROM_NAME:
from_secret: smtp_from_name
SMTP_HOST:
from_secret: smtp_host
SMTP_USERNAME:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
when:
status:
- changed
@@ -385,6 +311,7 @@ clone:
depends_on:
- linter
- unit-test-arm64
platform:
os: linux
@@ -392,10 +319,10 @@ platform:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build
image: docker.io/plugins/docker:20.10.9
image: docker.io/plugins/docker:20.17.1
settings:
auto_tag: false
dockerfile: Dockerfile
@@ -424,7 +351,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
when:
status:
- changed
@@ -449,7 +376,6 @@ clone:
depends_on:
- latest-amd64
- latest-arm-v7
- latest-arm64-v8
# docker.io/plugins/manifest only for amd64 architectures available
@@ -459,7 +385,7 @@ node_selector:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build-manifest
image: docker.io/plugins/manifest:1.4.0
@@ -484,7 +410,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
resources:
limits:
cpu: 150
@@ -516,7 +442,7 @@ depends_on:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: latest-sync
commands:
@@ -530,7 +456,7 @@ steps:
from_secret: container_image_registry_user
DEST_CRED_PASSWORD:
from_secret: container_image_registry_password
image: quay.io/skopeo/stable:v1.13.0
image: quay.io/skopeo/stable:v1.14.0
- name: email-notification
environment:
@@ -544,7 +470,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
resources:
limits:
cpu: 150
@@ -577,10 +503,10 @@ platform:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build
image: docker.io/plugins/docker:20.10.9
image: docker.io/plugins/docker:20.17.1
settings:
auto_tag: true
auto_tag_suffix: amd64
@@ -611,67 +537,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
when:
status:
- changed
- failure
trigger:
event:
- tag
repo:
- volker.raschek/dcmerge
---
kind: pipeline
type: docker
name: tagged-arm-v7
clone:
disable: true
platform:
os: linux
arch: arm
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
- name: build
image: docker.io/plugins/docker:20.10.9
settings:
auto_tag: true
auto_tag_suffix: arm-v7
dockerfile: Dockerfile
force_tag: true
no_cache: true
purge: true
mirror:
from_secret: docker_io_mirror
registry: git.cryptic.systems
repo: git.cryptic.systems/volker.raschek/dcmerge
username:
from_secret: git_cryptic_systems_container_registry_user
password:
from_secret: git_cryptic_systems_container_registry_password
build_args:
- VERSION=${DRONE_TAG}
- name: email-notification
environment:
SMTP_FROM_ADDRESS:
from_secret: smtp_from_address
SMTP_FROM_NAME:
from_secret: smtp_from_name
SMTP_HOST:
from_secret: smtp_host
SMTP_USERNAME:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
when:
status:
- changed
@@ -697,10 +563,10 @@ platform:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build
image: docker.io/plugins/docker:20.10.9
image: docker.io/plugins/docker:20.17.1
settings:
auto_tag: true
auto_tag_suffix: arm64-v8
@@ -731,7 +597,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
when:
status:
- changed
@@ -753,7 +619,6 @@ clone:
depends_on:
- tagged-amd64
- tagged-arm-v7
- tagged-arm64-v8
# docker.io/plugins/manifest only for amd64 architectures available
@@ -763,7 +628,7 @@ node_selector:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: build-manifest
image: docker.io/plugins/manifest:1.4.0
@@ -788,7 +653,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
resources:
limits:
cpu: 150
@@ -817,7 +682,7 @@ depends_on:
steps:
- name: clone
image: git.cryptic.systems/volker.raschek/git:1.2.1
image: git.cryptic.systems/volker.raschek/git:1.3.1
- name: tagged-sync
commands:
@@ -831,7 +696,7 @@ steps:
from_secret: container_image_registry_user
DEST_CRED_PASSWORD:
from_secret: container_image_registry_password
image: quay.io/skopeo/stable:v1.13.0
image: quay.io/skopeo/stable:v1.14.0
- name: email-notification
environment:
@@ -845,7 +710,7 @@ steps:
from_secret: smtp_username
SMTP_PASSWORD:
from_secret: smtp_password
image: git.cryptic.systems/volker.raschek/drone-email:0.1.2
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
resources:
limits:
cpu: 150
+3 -3
View File
@@ -45,11 +45,11 @@ MD012:
# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 80
line_length: 120
# Number of characters for headings
heading_line_length: 80
heading_line_length: 120
# Number of characters for code blocks
code_block_line_length: 80
code_block_line_length: 120
# Include code blocks
code_blocks: false
# Include tables
+3
View File
@@ -0,0 +1,3 @@
{
"rewrap.wrappingColumn": 120,
}
+2 -2
View File
@@ -1,4 +1,4 @@
FROM docker.io/library/golang:1.20.6-alpine3.18 AS build
FROM docker.io/library/golang:1.21.5-alpine3.18 AS build
RUN apk add git make
@@ -10,7 +10,7 @@ RUN make install \
PREFIX=/usr \
VERSION=${VERSION}
FROM docker.io/library/alpine:3.18.2
FROM docker.io/library/alpine:3.19.0
COPY --from=build /cache /
+13 -20
View File
@@ -3,22 +3,18 @@
[![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)
`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.
The dynamic pattern of a docker-compose file, that for example `environments`
can be specified as a string slice or a list of objects is currently not
supported. `dcmerge` expect a strict pattern layout. The `environments`, `ports`
and `volumes` must be declared as a slice of strings.
The dynamic pattern of a docker-compose file, that for example `environments` can be specified as a string slice or a
list of objects is currently not supported. `dcmerge` expect a strict pattern layout. The `environments`, `ports` and
`volumes` must be declared as a slice of strings.
Dockercompose file can be read-in from different sources. Currently are the
following sources supported:
Dockercompose file can be read-in from different sources. Currently are the following sources supported:
- File
- HTTP/HTTPS
Furthermore, `dcmerge` support different ways to merge multiple docker-compose
files.
Furthermore, `dcmerge` support different ways to merge multiple docker-compose files.
- The default merge, add missing secrets, services, networks and volumes.
- The existing-win merge, add and protect existing attributes.
@@ -26,9 +22,8 @@ files.
## default
Merge only missing secrets, services, networks and volumes without respecting
their attributes. For example, when the service `app` is already declared, it is
not possible to add the service `app` twice. The second service will be
Merge only missing secrets, services, networks and volumes **without respecting their attributes**. For example, when
the service `app` is already declared, it is not possible to add the service `app` twice. The second service will be
completely skipped.
```yaml
@@ -68,10 +63,9 @@ services:
## existing-win
The existing-win merge protects existing attributes. For example there are two
different docker-compose files, but booth has the same environment variable
`CLIENT_SECRET` defined with different values. The first declaration of the
attribute wins and is for overwriting protected.
The existing-win merge protects existing attributes. For example there are two different docker-compose files, but booth
has the same environment variable `CLIENT_SECRET` defined with different values. The first declaration of the attribute
wins and is for overwriting protected.
```yaml
---
@@ -99,9 +93,8 @@ services:
## last-win
The last-win merge overwrite recursive existing attributes. For example there
are two different docker-compose files, but booth has the same environment
variable `CLIENT_SECRET` defined with different values. The last passed
The last-win merge overwrite recursive existing attributes. For example there are two different docker-compose files,
but booth has the same environment variable `CLIENT_SECRET` defined with different values. The last passed
docker-compose file which contains this environment wins.
```yaml
+11 -2
View File
@@ -42,6 +42,7 @@ dcmerge docker-compose.yml https://git.example.local/user/repo/docker-compose.ym
RunE: run,
Version: version,
}
rootCmd.Flags().BoolP("existing-win", "f", false, "Protect existing attributes")
rootCmd.Flags().BoolP("last-win", "l", false, "Overwrite existing attributes")
rootCmd.Flags().StringP("output-file", "o", "", "Write instead on stdout into a file")
rootCmd.AddCommand(completionCmd)
@@ -50,6 +51,11 @@ dcmerge docker-compose.yml https://git.example.local/user/repo/docker-compose.ym
}
func run(cmd *cobra.Command, args []string) error {
mergeExisting, err := cmd.Flags().GetBool("existing-win")
if err != nil {
return fmt.Errorf("Failed to parse flag last-win: %s", err)
}
mergeLastWin, err := cmd.Flags().GetBool("last-win")
if err != nil {
return fmt.Errorf("Failed to parse flag last-win: %s", err)
@@ -69,12 +75,15 @@ func run(cmd *cobra.Command, args []string) error {
for _, config := range dockerComposeConfigs {
switch {
case mergeLastWin:
case mergeExisting && mergeLastWin:
return fmt.Errorf("Neither --first-win or --last-win can be specified - not booth.")
case mergeExisting && !mergeLastWin:
dockerComposeConfig.MergeExistingWin(config)
case !mergeExisting && mergeLastWin:
dockerComposeConfig.MergeLastWin(config)
default:
dockerComposeConfig.Merge(config)
}
}
switch {
+1 -1
View File
@@ -3,7 +3,7 @@ module git.cryptic.systems/volker.raschek/dcmerge
go 1.20
require (
github.com/spf13/cobra v1.7.0
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.8.4
gopkg.in/yaml.v2 v2.4.0
)
+3 -3
View File
@@ -1,4 +1,4 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -6,8 +6,8 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-6
View File
@@ -12,12 +12,6 @@ manifests:
platform:
architecture: amd64
os: linux
-
image: git.cryptic.systems/volker.raschek/dcmerge:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-arm-v7
platform:
architecture: arm
os: linux
variant: v7
-
image: git.cryptic.systems/volker.raschek/dcmerge:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-arm64-v8
platform:
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+12
View File
@@ -0,0 +1,12 @@
version: "3.3"
services:
app:
depends_on:
- oracle
environment:
- HTTP_PROXY=1.2.3.4:8080
image: repository:version
ports:
- 8080:80
volumes:
- /etc/localtime:/etc/localtime
+12
View File
@@ -0,0 +1,12 @@
version: "3.3"
services:
app:
depends_on:
- postgres
environment:
- HTTP_PROXY=4.3.2.1:8080
image: repository:version
ports:
- 10080:80
volumes:
- /usr/share/zoneinfo/UTC:/etc/localtime