Merge bootstack-ops:add-snapcraft-base into bootstack-ops:master

Proposed by James Hebden
Status: Merged
Approved by: David O Neill
Approved revision: 3ec3503205ad2500c304a2617673a37e38c41069
Merged at revision: 8000536ab90b4abb8a3368acc651578c98f079a5
Proposed branch: bootstack-ops:add-snapcraft-base
Merge into: bootstack-ops:master
Diff against target: 49 lines (+17/-4)
2 files modified
README.md (+10/-0)
snap/snapcraft.yaml (+7/-4)
Reviewer Review Type Date Requested Status
David O Neill (community) Approve
Review via email: mp+367557@code.launchpad.net

Commit message

Moved to using snapcraft bases and updated for snapcraft 3.0

Description of the change

Snapcraft 3.0 introduces the concept of bases, which allows the building of snaps on multipass-based core images, to prevent dependency hell, and streamline the build process.

This merge adds the core snap as a base, which is the 16.04 core snap. In the future, we should move to core18, however the dependency on the 9.5 postgresql client requires more thought for this to happen. As such, I've used the core snap instead of core18.

Snapcraft 3.0 also removes the 'install' property for running a script during the snap build, which we use to update the alternative for pg_dumpall to point to postgresql 9.5. The way to accomplish the same thing is to use the build-override setting, which is also included in this merge for the purpose of ensuring Snapcraft 3.0 compatibility.

Also updated the README.md with build instructions.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
David O Neill (dmzoneill) :
review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 8000536ab90b4abb8a3368acc651578c98f079a5

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README.md b/README.md
2index 58a14d0..b958108 100644
3--- a/README.md
4+++ b/README.md
5@@ -55,3 +55,13 @@ echo "0 4 * * * jujumanage PATH=\${PATH}:/snap/bin bootstack-ops.backup --cloud-
6
7 Note for both these, we export JUJU_DATA - this is so that we can use the
8 existing configured Juju client rather than having to configure our own.
9+
10+### Building the snap ###
11+
12+This snap makes use of the snapcraft 3.0 bases functionality to automatically configure a compatible build environment and base core snap.
13+It uses the core18 (Bionic) base snap. By default, building this snap will use multipass to install a compatible build environment and automatically use this to build the
14+snap. This prevents dependency issues when building on newer versions of Ubuntu, which may have newer standard libraries that the core snap upon which snaps run.
15+
16+To build the snap and all dependencies on a supported version of core, using multipass, simply run: `snapcraft`
17+
18+This will build the snap to a .snap file which you can deploy with --devmode. This snap is not yet published to the store.
19diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
20index 5b36ff4..e1ebf50 100644
21--- a/snap/snapcraft.yaml
22+++ b/snap/snapcraft.yaml
23@@ -1,5 +1,6 @@
24 name: bootstack-ops
25 version: '0.3' # just for humans, typically '1.2+git' or '1.3.2'
26+base: core
27 summary: Bootstack tooling for Bootstack clouds
28 description: |
29 BootStack is a managed service where the world-class team at Canonical build
30@@ -52,15 +53,17 @@ apps:
31 parts:
32 bootstack-ops:
33 plugin: python
34- requirements: requirements.txt
35+ override-build: |
36+ snapcraftctl build
37+ rm $SNAPCRAFT_PART_INSTALL/usr/bin/pg_dumpall
38+ ln -s ../lib/postgresql/9.5/bin/pg_dumpall $SNAPCRAFT_PART_INSTALL/usr/bin/pg_dumpall
39+ requirements:
40+ - requirements.txt
41 source: ./
42 stage-packages:
43 - libc6
44 - postgresql-client-9.5
45 - locales
46 - rsync
47- install: |
48- rm $SNAPCRAFT_PART_INSTALL/usr/bin/pg_dumpall
49- ln -s ../lib/postgresql/9.5/bin/pg_dumpall $SNAPCRAFT_PART_INSTALL/usr/bin/pg_dumpall
50
51

Subscribers

People subscribed via source and target branches

to all changes: