Skip to content

Commit d02dccc

Browse files
[DPE-6749] Initial standalone snap (#1)
* Initial standalone snap * Removed charmed reference from readme * Jira components * Bump lock format * Wrong link * Fix license location * Third time's the charm * Cleanup tests * Bump dpw * Update snap/local/start-postgresql.sh Co-authored-by: Alex Lutay <[email protected]> * Add custom marker * Don't print command output * Check output tests * Remove cfg hook --------- Co-authored-by: Alex Lutay <[email protected]>
1 parent 2637863 commit d02dccc

File tree

13 files changed

+723
-0
lines changed

13 files changed

+723
-0
lines changed

.github/.jira_sync_config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Sync GitHub issues to Jira issues
2+
3+
# Configuration syntax:
4+
# https://github.com/canonical/gh-jira-sync-bot/blob/main/README.md#client-side-configuration
5+
settings:
6+
# Repository specific settings
7+
components: # Jira components that will be added to Jira issue
8+
- postgresql-vm
9+
- snap
10+
11+
# Settings shared across Data Platform repositories
12+
label_mapping:
13+
# If the GitHub issue does not have a label in this mapping, the Jira issue will be created as a Bug
14+
enhancement: Story
15+
jira_project_key: DPE # https://warthogs.atlassian.net/browse/DPE
16+
status_mapping:
17+
opened: untriaged
18+
closed: done # GitHub issue closed as completed
19+
not_planned: rejected # GitHub issue closed as not planned
20+
add_gh_comment: true
21+
sync_description: false
22+
sync_comments: false

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: File a bug report
4+
labels: bug
5+
6+
---
7+
8+
<!-- Thank you for submitting a bug report! All fields are required unless marked optional. -->
9+
10+
## Steps to reproduce
11+
1.
12+
13+
## Expected behavior
14+
15+
16+
## Actual behavior
17+
<!-- If applicable, add screenshots -->
18+
19+
20+
## Versions
21+
22+
<!-- Run `lsb_release -sd` -->
23+
Operating system:
24+
25+
## Log output
26+
<!-- (Optional) Copy the logs that are relevant to the bug & paste inside triple backticks below -->
27+
28+
29+
## Additional context
30+
<!-- (Optional) Add any additional information here -->

.github/renovate.json5

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>canonical/data-platform//renovate_presets/charm.json5"],
4+
"reviewers": ["team:data-platform-postgresql"],
5+
}

.github/workflows/ci.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
name: Tests
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
on:
10+
pull_request:
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
16+
17+
build:
18+
name: Build snap
19+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
20+
21+
smoke:
22+
name: Smoke test snap
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 5
25+
needs:
26+
- lint
27+
- build
28+
steps:
29+
- name: Uninstall Postgresql
30+
run: |
31+
sudo apt --purge remove postgresql*
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Install tox & poetry
35+
run: |
36+
pipx install tox
37+
pipx install poetry
38+
- name: Download snap package(s)
39+
uses: actions/download-artifact@v4
40+
with:
41+
pattern: ${{ needs.build.outputs.artifact-prefix }}-*
42+
merge-multiple: true
43+
- name: Run tests
44+
run: tox run -e smoke

.github/workflows/release.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
name: Release to Snap Store
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
on:
10+
push:
11+
branches:
12+
- 14/edge
13+
paths:
14+
- snap/**
15+
workflow_dispatch:
16+
17+
jobs:
18+
build:
19+
name: Build snap
20+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
21+
22+
release:
23+
name: Release snap
24+
needs:
25+
- build
26+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
27+
with:
28+
channel: 14/edge
29+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
30+
secrets:
31+
snap-store-token: ${{ secrets.SNAP_STORE_TOKEN }}
32+
permissions:
33+
contents: write # Needed to create GitHub release

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# PostgreSQL Snap
2+
[![Release to Snap Store](https://github.com/canonical/postgresql-snap/actions/workflows/release.yaml/badge.svg)](https://github.com/canonical/postgresql-snap/actions/workflows/release.yaml)
3+
4+
This repository contains the packaging metadata for creating a snap of PostgreSQL built from the official Ubuntu repositories. For more information on snaps, visit [snapcraft.io](https://snapcraft.io/).
5+
6+
## Installing the Snap
7+
The snap can be installed directly from the Stap Store. Follow the link below for more information.
8+
<br>
9+
10+
[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/postgresql)
11+
12+
## Building the Snap
13+
### Clone Repository
14+
```bash
15+
git clone [email protected]:canonical/postgresql-snap.git
16+
cd postgresql-snap
17+
```
18+
### Installing and Configuring Prerequisites
19+
```bash
20+
sudo snap install snapcraft
21+
sudo snap install lxd
22+
sudo lxd init --auto
23+
```
24+
### Packing and Installing the Snap
25+
```bash
26+
snapcraft pack
27+
sudo snap install ./postgresql*.snap --devmode
28+
```
29+
30+
## License
31+
The PostgreSQL Snap is free software, distributed under the Apache
32+
Software License, version 2.0. See
33+
[LICENSE](https://github.com/canonical/postgresql-snap/blob/14/edge/LICENSE)
34+
for more information.

0 commit comments

Comments
 (0)