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

Enable package and offline_package to support nested project structures #542

Merged
merged 2 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,15 @@ path: ..
offline_packages:
- source: paketo-buildpacks/adoptium
target: gcr.io/tanzu-buildpacks/adoptium
path: subdir/adoptium
platform:
os: linux
```

`offline_packages` is a list of objects that describe a `source` GitHub repository and a `target` Docker registry location. If defined, each object will create a `create-package` workflow that is responsible for detecting a new online buildpackage release and creating a matching offline buildpackage release and publishing it.

`path` is the path to the buildpack's directory relative to the repository's root.
andrew-su marked this conversation as resolved.
Show resolved Hide resolved

`platform` describes what platform the created package should be built for. `os` can be set to `linux` or `windows` (`linux` by default).

#### `republish_images`
Expand Down
5 changes: 4 additions & 1 deletion octo/create-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ set -euo pipefail

if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then
create-package \
--source ${SOURCE_PATH:-.} \
--cache-location "${HOME}"/carton-cache \
--destination "${HOME}"/buildpack \
--include-dependencies \
--version "${VERSION}"
else
create-package \
--source ${SOURCE_PATH:-.} \
--destination "${HOME}"/buildpack \
--version "${VERSION}"
fi

[[ -e package.toml ]] && cp package.toml "${HOME}"/package.toml
PACKAGE_FILE=${SOURCE_PATH:-.}/package.toml
[[ -e ${PACKAGE_FILE} ]] && cp ${PACKAGE_FILE} "${HOME}"/package.toml
printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}"/buildpack "${OS}" >> "${HOME}"/package.toml
7 changes: 4 additions & 3 deletions octo/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ type Dependency struct {
}

type OfflinePackage struct {
Source string
Target string
Platform Platform
Source string
Target string
SourcePath string `yaml:"source_path"`
Platform Platform
}

type RepublishImage struct {
Expand Down
1 change: 1 addition & 0 deletions octo/offline_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func contributeOfflinePackage(descriptor Descriptor, offlinePackage OfflinePacka
"INCLUDE_DEPENDENCIES": "true",
"OS": offlinePackage.Platform.OS,
"VERSION": "${{ steps.version.outputs.version }}",
"SOURCE_PATH": offlinePackage.SourcePath,
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion octo/statik/statik.go

Large diffs are not rendered by default.