Add Snapcraft metadata and install/maintenance hooks #666

Злито
RAOF об'єднав 5 комітів з add-snapcraft в master 2019-09-16 10:33:26 +00:00
RAOF прокоментував(ла) 2019-09-07 07:52:00 +00:00 (Перенесено з github.com)

This is somewhat of a proof of concept; it currently:

  • Lets you configure BASE_URL, addresses, and such through snap set plume base-url="blog.cooperteam.net"
  • Generates a ROCKET_SECRET at install time, and
  • Runs the DB migrations on upgrade

Everything works, modulo the media upload directory not being configurable, and the base directory being read-only…

This is somewhat of a proof of concept; it currently: * Lets you configure `BASE_URL`, addresses, and such through `snap set plume base-url="blog.cooperteam.net"` * Generates a `ROCKET_SECRET` at install time, and * Runs the DB migrations on upgrade Everything works, modulo the media upload directory not being configurable, and the base directory being read-only…
codecov[bot] прокоментував(ла) 2019-09-07 08:14:09 +00:00 (Перенесено з github.com)

Codecov Report

Merging #666 into master will increase coverage by 0.52%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #666      +/-   ##
==========================================
+ Coverage   34.58%   35.11%   +0.52%     
==========================================
  Files          68       68              
  Lines        8020     7943      -77     
  Branches     1890     1889       -1     
==========================================
+ Hits         2774     2789      +15     
+ Misses       4468     4374      -94     
- Partials      778      780       +2
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=h1) Report > Merging [#666](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/d4a1bd6de72055baf1d6cec678bfcea463c8f9ca?src=pr&el=desc) will **increase** coverage by `0.52%`. > The diff coverage is `n/a`. ```diff @@ Coverage Diff @@ ## master #666 +/- ## ========================================== + Coverage 34.58% 35.11% +0.52% ========================================== Files 68 68 Lines 8020 7943 -77 Branches 1890 1889 -1 ========================================== + Hits 2774 2789 +15 + Misses 4468 4374 -94 - Partials 778 780 +2 ```
codecov[bot] прокоментував(ла) 2019-09-07 08:14:11 +00:00 (Перенесено з github.com)

Codecov Report

Merging #666 into master will increase coverage by 0.52%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #666      +/-   ##
==========================================
+ Coverage   34.58%   35.11%   +0.52%     
==========================================
  Files          68       68              
  Lines        8020     7943      -77     
  Branches     1890     1889       -1     
==========================================
+ Hits         2774     2789      +15     
+ Misses       4468     4374      -94     
- Partials      778      780       +2
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=h1) Report > Merging [#666](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/d4a1bd6de72055baf1d6cec678bfcea463c8f9ca?src=pr&el=desc) will **increase** coverage by `0.52%`. > The diff coverage is `n/a`. ```diff @@ Coverage Diff @@ ## master #666 +/- ## ========================================== + Coverage 34.58% 35.11% +0.52% ========================================== Files 68 68 Lines 8020 7943 -77 Branches 1890 1889 -1 ========================================== + Hits 2774 2789 +15 + Misses 4468 4374 -94 - Partials 778 780 +2 ```
codecov[bot] прокоментував(ла) 2019-09-07 08:14:12 +00:00 (Перенесено з github.com)

Codecov Report

Merging #666 into master will increase coverage by 0.52%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #666      +/-   ##
==========================================
+ Coverage   34.58%   35.11%   +0.52%     
==========================================
  Files          68       68              
  Lines        8020     7943      -77     
  Branches     1890     1889       -1     
==========================================
+ Hits         2774     2789      +15     
+ Misses       4468     4374      -94     
- Partials      778      780       +2
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=h1) Report > Merging [#666](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/d4a1bd6de72055baf1d6cec678bfcea463c8f9ca?src=pr&el=desc) will **increase** coverage by `0.52%`. > The diff coverage is `n/a`. ```diff @@ Coverage Diff @@ ## master #666 +/- ## ========================================== + Coverage 34.58% 35.11% +0.52% ========================================== Files 68 68 Lines 8020 7943 -77 Branches 1890 1889 -1 ========================================== + Hits 2774 2789 +15 + Misses 4468 4374 -94 - Partials 778 780 +2 ```
codecov[bot] прокоментував(ла) 2019-09-07 08:14:15 +00:00 (Перенесено з github.com)

Codecov Report

Merging #666 into master will increase coverage by 0.52%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #666      +/-   ##
==========================================
+ Coverage   34.58%   35.11%   +0.52%     
==========================================
  Files          68       68              
  Lines        8020     7943      -77     
  Branches     1890     1889       -1     
==========================================
+ Hits         2774     2789      +15     
+ Misses       4468     4374      -94     
- Partials      778      780       +2
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=h1) Report > Merging [#666](https://codecov.io/gh/Plume-org/Plume/pull/666?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/d4a1bd6de72055baf1d6cec678bfcea463c8f9ca?src=pr&el=desc) will **increase** coverage by `0.52%`. > The diff coverage is `n/a`. ```diff @@ Coverage Diff @@ ## master #666 +/- ## ========================================== + Coverage 34.58% 35.11% +0.52% ========================================== Files 68 68 Lines 8020 7943 -77 Branches 1890 1889 -1 ========================================== + Hits 2774 2789 +15 + Misses 4468 4374 -94 - Partials 778 780 +2 ```
RAOF прокоментував(ла) 2019-09-07 10:09:21 +00:00 (Перенесено з github.com)

To test this you need to build the snap by running snapcraft in a checkout; this should make plume_0.3.0_amd64.snap (or whatever, as appropriate for your architecture). This can be installed with sudo snap install --dangerous plume_0.3.0_amd64.snap.

Minimal setup is then something like:

sudo snap set plume base-url=cooperteam.net db.type=sqlite

(only sqlite is actually supported at the moment).
While the snap will run migrations on updates, you still need to manually do the initial migration, with something like:
sudo plume.plm migrate --path=/var/snap/plume/current

To test this you need to build the snap by running `snapcraft` in a checkout; this should make `plume_0.3.0_amd64.snap` (or whatever, as appropriate for your architecture). This can be installed with `sudo snap install --dangerous plume_0.3.0_amd64.snap`. Minimal setup is then something like: ``` sudo snap set plume base-url=cooperteam.net db.type=sqlite ``` (only sqlite is actually supported at the moment). While the snap will run migrations on *updates*, you still need to manually do the initial migration, with something like: `sudo plume.plm migrate --path=/var/snap/plume/current`
igalic прокоментував(ла) 2019-09-07 10:13:36 +00:00 (Перенесено з github.com)

why is the installation --dangerous?

why is the installation `--dangerous`?
RAOF прокоментував(ла) 2019-09-07 10:18:43 +00:00 (Перенесено з github.com)

Because it's a local file (and you haven't pre-acknowledged its nonexistent signature), so it hasn't had any of the normal automated review. Once uploaded to the snap store that --dangerous will go away.

(This is standard for installing locally-built snaps)

Because it's a local file (and you haven't pre-acknowledged its nonexistent signature), so it hasn't had any of the normal automated review. Once uploaded to the snap store that `--dangerous` will go away. (This is standard for installing locally-built snaps)
igalic (Перенесено з github.com) рецензовано 2019-09-07 10:35:46 +00:00
igalic (Перенесено з github.com) додав коментар

igalic (Перенесено з github.com) прокоментував(ла) 2019-09-07 10:30:58 +00:00

why is this commented out?

why is this commented out?
igalic (Перенесено з github.com) прокоментував(ла) 2019-09-07 10:35:22 +00:00

what do we need / usr diesel-cli for?

what do we need / usr diesel-cli for?
RAOF (Перенесено з github.com) рецензовано 2019-09-07 10:52:41 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-07 10:52:41 +00:00

Because I forgot to remove it, apparently!

Because I forgot to remove it, apparently!
RAOF (Перенесено з github.com) рецензовано 2019-09-07 10:55:43 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-07 10:55:42 +00:00

The compile plume instructions say to install diesel_cli. Is that not necessary?

The [compile plume](https://docs.joinplu.me/installation/with/source-code) instructions say to install diesel_cli. Is that not necessary?
RAOF (Перенесено з github.com) рецензовано 2019-09-07 10:59:09 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-07 10:59:08 +00:00

It would be good to fix this up so that the server doesn't try to start until setup the been completed. This was a manual attempt at doing that, but didn't quite work.

It would be good to fix this up so that the server doesn't try to start until setup the been completed. This *was* a manual attempt at doing that, but didn't quite work.
igalic (Перенесено з github.com) рецензовано 2019-09-07 12:13:26 +00:00
igalic (Перенесено з github.com) прокоментував(ла) 2019-09-07 12:13:26 +00:00

i don't think it's necessary.

@fdb-hiroshima?

*i* don't think it's necessary. @fdb-hiroshima?
elegaanz (Перенесено з github.com) рецензовано 2019-09-07 13:52:05 +00:00
elegaanz (Перенесено з github.com) прокоментував(ла) 2019-09-07 13:52:05 +00:00

It is for the 0.3.0 tag, but not for master (we have plm migration run now).

It is for the 0.3.0 tag, but not for master (we have `plm migration run` now).
elegaanz (Перенесено з github.com) рецензовано 2019-09-07 13:59:24 +00:00
elegaanz (Перенесено з github.com) додав коментар

Here is what I get when I run snapcraft:

Pulling cargo-web 
Clonage dans '/home/ana/Projects/plume/parts/cargo-web/src'...
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (26/26), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 2355 (delta 9), reused 16 (delta 5), pack-reused 2329
Réception d'objets: 100% (2355/2355), 730.66 KiB | 858.00 KiB/s, fait.
Résolution des deltas: 100% (1437/1437), fait.
Note : extraction de 'a9895bf536e8ac6a0806382886b7be90138f01f3'.

Vous êtes dans l'état « HEAD détachée ». Vous pouvez visiter, faire des modifications
expérimentales et les valider. Il vous suffit de faire une autre extraction pour
abandonner les commits que vous faites dans cet état sans impacter les autres branches

Si vous voulez créer une nouvelle branche pour conserver les commits que vous créez,
il vous suffit d'utiliser « checkout -b » (maintenant ou plus tard) comme ceci :

  git checkout -b <nom-de-la-nouvelle-branche>

Downloading 'rustup.sh'[=================================================================================================================================================================================================================] 100%
/home/ana/Projects/plume/parts/cargo-web/rust/rustup.sh --prefix=/home/ana/Projects/plume/parts/cargo-web/rust --disable-sudo --save
info: downloading installer
error: Found argument '--prefix' which wasn't expected, or isn't valid in this context

USAGE:
    rustup-init [FLAGS] [OPTIONS]

For more information try --help
Failed to run '/home/ana/Projects/plume/parts/cargo-web/rust/rustup.sh --prefix=/home/ana/Projects/plume/parts/cargo-web/rust --disable-sudo --save' for 'cargo-web': Exited with code 1.
Verify that the part is using the correct parameters and try again.

(the french part are messages from git, nothing important)

I have snapcraft 2.43.1 and snap 2013-11-29-8, which seems quite old, maybe that is the issue?

Here is what I get when I run `snapcraft`: <details> ``` Pulling cargo-web Clonage dans '/home/ana/Projects/plume/parts/cargo-web/src'... remote: Enumerating objects: 26, done. remote: Counting objects: 100% (26/26), done. remote: Compressing objects: 100% (21/21), done. remote: Total 2355 (delta 9), reused 16 (delta 5), pack-reused 2329 Réception d'objets: 100% (2355/2355), 730.66 KiB | 858.00 KiB/s, fait. Résolution des deltas: 100% (1437/1437), fait. Note : extraction de 'a9895bf536e8ac6a0806382886b7be90138f01f3'. Vous êtes dans l'état « HEAD détachée ». Vous pouvez visiter, faire des modifications expérimentales et les valider. Il vous suffit de faire une autre extraction pour abandonner les commits que vous faites dans cet état sans impacter les autres branches Si vous voulez créer une nouvelle branche pour conserver les commits que vous créez, il vous suffit d'utiliser « checkout -b » (maintenant ou plus tard) comme ceci : git checkout -b <nom-de-la-nouvelle-branche> Downloading 'rustup.sh'[=================================================================================================================================================================================================================] 100% /home/ana/Projects/plume/parts/cargo-web/rust/rustup.sh --prefix=/home/ana/Projects/plume/parts/cargo-web/rust --disable-sudo --save info: downloading installer error: Found argument '--prefix' which wasn't expected, or isn't valid in this context USAGE: rustup-init [FLAGS] [OPTIONS] For more information try --help Failed to run '/home/ana/Projects/plume/parts/cargo-web/rust/rustup.sh --prefix=/home/ana/Projects/plume/parts/cargo-web/rust --disable-sudo --save' for 'cargo-web': Exited with code 1. Verify that the part is using the correct parameters and try again. ``` (the french part are messages from git, nothing important) </details> I have snapcraft 2.43.1 and snap 2013-11-29-8, which seems quite old, maybe that is the issue?
elegaanz (Перенесено з github.com) прокоментував(ла) 2019-09-07 13:52:57 +00:00

Could this file go in the snap directory too, or not?

Could this file go in the `snap` directory too, or not?
elegaanz (Перенесено з github.com) прокоментував(ла) 2019-09-07 13:54:40 +00:00

Maybe you are already aware of that, but just to have reminder: this description should probably be updated.

Maybe you are already aware of that, but just to have reminder: this description should probably be updated.
RAOF (Перенесено з github.com) рецензовано 2019-09-08 00:49:23 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-08 00:49:23 +00:00

I think it can go in snap/local. I'll give it a try.

I *think* it can go in `snap/local`. I'll give it a try.
RAOF (Перенесено з github.com) рецензовано 2019-09-16 06:17:59 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-16 06:17:59 +00:00

Done! Plume now doesn't try to run until it's been enabled, and doesn't let you enable it until you've set the minimum configuration items.

Done! Plume now doesn't try to run until it's been enabled, and doesn't let you enable it until you've set the minimum configuration items.
RAOF (Перенесено з github.com) рецензовано 2019-09-16 06:18:15 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-16 06:18:14 +00:00

It can. Done!

It can. Done!
RAOF (Перенесено з github.com) рецензовано 2019-09-16 06:18:34 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-16 06:18:34 +00:00

Removed

Removed
RAOF (Перенесено з github.com) рецензовано 2019-09-16 06:19:36 +00:00
RAOF (Перенесено з github.com) прокоментував(ла) 2019-09-16 06:19:36 +00:00

Updated. Please give the verbiage a once-over!

Updated. Please give the verbiage a once-over!
RAOF прокоментував(ла) 2019-09-16 06:22:22 +00:00 (Перенесено з github.com)

This is now updated (sorry about leaving it hanging here). It definitely builds with snapcraft 3.8, 'cause that's what I've been using 😁

You now need to set all the configuration options (eg: sudo snap set plume base-url=cooperteam.net db.type=sqlite) and then enable Plume (sudo snap set plume enabled=true). This will run the initial migrations, and so will be all ready to be configured with plume.plm ....

This is now updated (sorry about leaving it hanging here). It *definitely* builds with snapcraft 3.8, 'cause that's what I've been using :grin: You now need to set all the configuration options (eg: `sudo snap set plume base-url=cooperteam.net db.type=sqlite`) and then enable Plume (`sudo snap set plume enabled=true`). This will run the initial migrations, and so will be all ready to be configured with `plume.plm ...`.
igalic (Перенесено з github.com) зміни затверджено 2019-09-16 07:41:46 +00:00
igalic (Перенесено з github.com) додав коментар

👍

👍
Підпишіться щоб приєднатися до обговорення.
Немає рецензентів
Етап відсутній
Проєкт відсутній
Немає виконавців
1 учасник
Сповіщення
Дата завершення
Термін дії недійсний або знаходиться за межами допустимого діапазону. Будь ласка, використовуйте формат «рррр-мм-дд».

Термін виконання не встановлено.

Залежності

Залежностей не встановлено.

Reference: Plume/Plume#666
Немає опису.