| # | |
| # Licensed to the Apache Software Foundation (ASF) under one | |
| # or more contributor license agreements. See the NOTICE file | |
| # distributed with this work for additional information | |
| # regarding copyright ownership. The ASF licenses this file | |
| # to you under the Apache License, Version 2.0 (the | |
| # "License"); you may not use this file except in compliance | |
| # with the License. You may obtain a copy of the License at | |
| # | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, | |
| # software distributed under the License is distributed on an | |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| # KIND, either express or implied. See the License for the | |
| # specific language governing permissions and limitations | |
| # under the License. | |
| # | |
| services: | |
| releaser: | |
| build: | |
| context: .. | |
| dockerfile: ./tools/Dockerfile | |
| # Builds all modules and uses an alternate maven local repo and deploys artifacts to a local directory. | |
| command: ["/ws/mvnw", "-e", "-Dskip-pgp-signing=true", "-P", "with-c,with-go,with-java,apache-release", "-Dmaven.repo.local=/ws/out/.repository", "-DaltDeploymentRepository=snapshot-repo::file:/ws/out/.local-snapshots-dir", "clean", "deploy"] | |
| # The build writes into the bind mount below. Running as root, everything it creates - "out", | |
| # every "target", the commits the release plugin makes - stays owned by root once the container | |
| # is gone. That only hurts on Linux: Docker Desktop on macOS and Windows remaps the ownership to | |
| # the calling user anyway. The release scripts export RELEASE_UID/RELEASE_GID on Linux, and the | |
| # "0:0" default below keeps the previous behaviour everywhere else. | |
| user: "${RELEASE_UID:-0}:${RELEASE_GID:-0}" | |
| environment: | |
| # That uid has no entry in the image's "/etc/passwd", so HOME would fall back to "/", which is | |
| # not writable - and "mvnw" unpacks Maven below HOME. Inside the mount it is writable for the | |
| # same user and survives between runs. | |
| - HOME=/ws/out/home | |
| volumes: | |
| # Bind the local directory as "/ws" | |
| - type: bind | |
| source: .. | |
| target: /ws |