-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsnapcraft.yaml
57 lines (48 loc) · 2.77 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: serve
version: "0.3.2"
# The summary must not exceed 78 characters.
summary: serve starts a simple temporary static file server in your current directory
description: |
serve starts a simple temporary static file server in your current directory
and prints your IP address to share with colleagues.
Run `serve -h` to print its usage.
Press Ctrl+C in the terminal to stop the server.
# Title and license are "new" and not supported in older versions of snapcraft.
title: Temporary static file server
license: MPL-2.0
type: app # "app" is the default, but set it explicitly anyway
grade: stable # devel or stable. devel can't be published to the candidate or stable channels.
confinement: strict # devmode or strict. devmode snaps can't be published to the stable channel. strict leads to no access outside of declared interfaces through plugs.
# "Without specifying the base property in the snapcraft.yaml Snapcraft will operate in legacy mode,
# which is essentially a 2.4X old version of Snapcraft and will lose the functionalities and bug fixes introduced in the new version".
#
# Maybe "bare" might be a better fit in the future, but it's currently not supported in snapcraft/snapd.
# "Bare" might also require serve to be compiled with CGO_ENABLED=0 and/or "netgo" + "osusergo" compile flags and/or `-extldflags "-static"` and/or more.
base: core18
# There currently seem to be several issues with cross compiling a snap with the go plugin.
# Without this, and without "--target-arch=...", the snap will be built for the same arch the build is running on.
# In the future we should check for updates of snapcraft and revisit this option.
#architectures: ...
parts:
serve:
# Go plugin source code: https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/go.py
plugin: go
# Set go-channel to an empty string so that the Go plugin doesn't use the unofficial Go snap for building.
# We want to use the OS's package manager's Go package.
# When using a recent version of snapcraft, building a snap is done in a VM which is currently Ubuntu 18.04,
# so even when using an older Ubuntu 16 as host, at least Go 1.10 is used.
go-channel: ""
# Using the repository instead of "." makes it possible to use this file standalone
# and also leads to reproducable builds thanks to the tag (in case it's used instead of a source-depth of 1).
source: https://github.com/philippgille/serve
source-type: git
# Either use a source-depth of 1 for the latest commit, OR a source-tag
source-depth: 1
source-branch: master
#source-tag: v0.3.2
apps:
serve:
command: serve
plugs:
- network-bind # For acting as HTTP server
- home # For access to the user's $HOME directory, needed to serve its files. No access to hidden files though.