generated from cloudnative-pg/cnpg-template
-
Notifications
You must be signed in to change notification settings - Fork 17
feat: new extension scaffolding #79
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6214ccd
feat: new extension scaffolding dagger command
GabriFedi97 74170f6
feat: add task entry
GabriFedi97 e43ecf3
feat: add task entry
GabriFedi97 484a9b1
docs: create new extension
GabriFedi97 975ed4f
chore: check if extension already exists
GabriFedi97 2e011f8
docs: reordered the section in the BUILD file
gbartolini 49095b5
chore: reviewed templates
gbartolini afddcf5
chore: add renovate
gbartolini e09dc44
docs: moved prereqs at the start
gbartolini d98117c
fix: renovate in readme template
GabriFedi97 9b2df8d
docs: add component ownership and licenses
gbartolini d79faa3
chore: fix template comment
NiccoloFei b1b8f1a
feat: add input validation to Create function
mnencia fdf04b2
feat: improve template error handling in Create function
mnencia 6f49d14
fix: remove hardcoded content from README template
mnencia 9a8a5d4
chore: improve Dockerfile template comments
mnencia d15fe0f
chore: improve create-extension task validation
mnencia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # SPDX-FileCopyrightText: Copyright © contributors to CloudNativePG, established as CloudNativePG a Series of LF Projects, LLC. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| {{ $packageName := replaceAll .Package "%version%" "${PG_MAJOR}" }} | ||
| ARG BASE=ghcr.io/cloudnative-pg/postgresql:{{ .DefaultVersion }}-minimal-{{ .DefaultDistro }} | ||
| FROM $BASE AS builder | ||
|
|
||
| ARG PG_MAJOR | ||
| ARG EXT_VERSION | ||
|
|
||
| USER 0 | ||
|
|
||
| # TODO: Remove this comment block after customizing the Dockerfile | ||
| # Instructions: | ||
| # 1. Remove all TODO comment blocks after completing the customization. | ||
| # 2. Uncomment and customize the COPY/RUN commands below. | ||
| # 3. If your extension requires additional system libraries, ensure they are | ||
| # copied to /lib. | ||
|
|
||
| # Install extension via `apt-get` | ||
| # RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| # "{{ $packageName }}=${EXT_VERSION}" | ||
|
|
||
| FROM scratch | ||
| ARG PG_MAJOR | ||
|
|
||
| # Licenses | ||
| # TODO: Uncomment and customize the COPY command below | ||
| # Including license files is essential for legal compliance and transparency. | ||
| # It ensures proper attribution to original authors, fulfills open source license | ||
| # requirements, and enables automated compliance scanning tools to verify licensing. | ||
| # COPY --from=builder /usr/share/doc/{{ $packageName }}/copyright /licenses/{{ $packageName }}/ | ||
|
|
||
| # Libraries | ||
| # TODO: Uncomment and customize the COPY command below | ||
| # Include the extension's shared objects and related dependencies under the /lib directory. | ||
| # CNPG will configure PostgreSQL to locate these libraries at runtime by configuring | ||
| # the "dynamic_library_path" GUC to include this path. | ||
| # For more details, see: https://cloudnative-pg.io/docs/current/imagevolume_extensions#how-it-works | ||
| # COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/{{ .Name }}* /lib/ | ||
|
|
||
| # Share | ||
| # TODO: Uncomment and customize the COPY command below | ||
| # Include the extension's SQL scripts and control files under the /share/extension directory. | ||
| # CNPG will configure PostgreSQL to include this path via the "extension_control_path" GUC to | ||
| # seamlessly find and manage the current extension. | ||
| # For more details, see: https://cloudnative-pg.io/docs/current/imagevolume_extensions#how-it-works | ||
| # COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/{{ .Name }}* /share/extension/ | ||
|
|
||
| USER 65532:65532 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!