Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(melange): Add sub for output directory #1490

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Melange provides the following default substitutions which can be referenced in
| `${{package.epoch}}` | Package epoch |
| `${{package.full-version}}` | `${{package.version}}-r${{package.epoch}}` |
| `${{package.description}}` | Package description |
| `${{targets.outdir}}` | Directory where targets will be stored |
| `${{package.contextdir}}` | Directory where targets will be stored for main packages and subpackages |
| `${{targets.destdir}}` | Directory where targets will be stored for main |
| `${{targets.subpkgdir}}` | Directory where targets will be stored for subpackages |
Expand Down
1 change: 1 addition & 0 deletions pkg/build/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func NewSubstitutionMap(cfg *config.Configuration, arch apko_types.Architecture,
config.SubstitutionPackageVersion: pkg.Version,
config.SubstitutionPackageEpoch: strconv.FormatUint(pkg.Epoch, 10),
config.SubstitutionPackageFullVersion: fmt.Sprintf("%s-r%s", config.SubstitutionPackageVersion, config.SubstitutionPackageEpoch),
config.SubstitutionTargetsOutdir: "/home/build/melange-out",
config.SubstitutionTargetsDestdir: fmt.Sprintf("/home/build/melange-out/%s", pkg.Name),
config.SubstitutionTargetsContextdir: fmt.Sprintf("/home/build/melange-out/%s", pkg.Name),
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/pipelines/split/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pipeline:
- runs: |
PACKAGE_DIR="${{targets.destdir}}"
if [ -n "${{inputs.package}}" ]; then
PACKAGE_DIR="/home/build/melange-out/${{inputs.package}}"
PACKAGE_DIR="${{targets.outdir}}/${{inputs.package}}"
fi

if [ "$PACKAGE_DIR" == "${{targets.contextdir}}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/pipelines/split/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline:
- runs: |
PACKAGE_DIR="${{targets.destdir}}"
if [ -n "${{inputs.package}}" ]; then
PACKAGE_DIR="/home/build/melange-out/${{inputs.package}}"
PACKAGE_DIR="${{targets.outdir}}/${{inputs.package}}"
fi

if [ "$PACKAGE_DIR" == "${{targets.contextdir}}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/pipelines/split/infodir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline:
- runs: |
PACKAGE_DIR="${{targets.destdir}}"
if [ -n "${{inputs.package}}" ]; then
PACKAGE_DIR="/home/build/melange-out/${{inputs.package}}"
PACKAGE_DIR="${{targets.outdir}}/${{inputs.package}}"
fi

if [ "$PACKAGE_DIR" == "${{targets.contextdir}}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/pipelines/split/locales.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline:
- runs: |
PACKAGE_DIR="${{targets.destdir}}"
if [ -n "${{inputs.package}}" ]; then
PACKAGE_DIR="/home/build/melange-out/${{inputs.package}}"
PACKAGE_DIR="${{targets.outdir}}/${{inputs.package}}"
fi

if [ "$PACKAGE_DIR" == "${{targets.contextdir}}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/pipelines/split/manpages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline:
- runs: |
PACKAGE_DIR="${{targets.destdir}}"
if [ -n "${{inputs.package}}" ]; then
PACKAGE_DIR="/home/build/melange-out/${{inputs.package}}"
PACKAGE_DIR="${{targets.outdir}}/${{inputs.package}}"
fi

if [ "$PACKAGE_DIR" == "${{targets.contextdir}}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/pipelines/split/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline:
- runs: |
PACKAGE_DIR="${{targets.destdir}}"
if [ -n "${{inputs.package}}" ]; then
PACKAGE_DIR="/home/build/melange-out/${{inputs.package}}"
PACKAGE_DIR="${{targets.outdir}}/${{inputs.package}}"
fi

if [ "$PACKAGE_DIR" == "${{targets.contextdir}}" ]; then
Expand Down
1 change: 1 addition & 0 deletions pkg/config/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
SubstitutionPackageFullVersion = "${{package.full-version}}"
SubstitutionPackageEpoch = "${{package.epoch}}"
SubstitutionPackageDescription = "${{package.description}}"
SubstitutionTargetsOutdir = "${{targets.outdir}}"
SubstitutionTargetsDestdir = "${{targets.destdir}}"
SubstitutionTargetsContextdir = "${{targets.contextdir}}"
SubstitutionSubPkgDir = "${{targets.subpkgdir}}"
Expand Down
Loading