-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add snap package configuration
Simplify keeping the snap package up to date by including the snapcraft.yaml in the repo. We can then wire up the snapstore to autobuild the package for amd64,i386,arm* etc. Many thanks to @ElOpio for the work of getting ipfs into the snap store in the first place, and to @bertrandfalguiere and @mkg20001 for pushing it forwards. See: https://github.com/ipfs-shipyard/ipfs-snap for more info. Fixes ipfs#7250 WIP ipfs#3595 License: MIT Signed-off-by: Oli Evans <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM golang:1.14.4-buster | ||
# Note: when updating the go minor version here, also update the go-channel in snap/snapcraft.yml | ||
FROM golang:1.14.4-buster | ||
LABEL maintainer="Steven Allen <[email protected]>" | ||
|
||
# Install deps | ||
|
This file contains 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,46 @@ | ||
# This snap will build go-ipfs from source. | ||
# See: https://github.com/ipfs-shipyard/ipfs-snap for more details | ||
name: ipfs | ||
summary: global, versioned, peer-to-peer filesystem # 79 char long summary | ||
description: | | ||
IPFS combines good ideas from Git, BitTorrent, Kademlia, SFS, and the Web. | ||
It is like a single bittorrent swarm, exchanging git objects. IPFS provides | ||
an interface as simple as the HTTP web, but with permanence built in. You | ||
can also mount the world at /ipfs. | ||
# fetch the version number in the `ipfs` part rather than hardcode it here | ||
# see: https://snapcraft.io/docs/using-external-metadata#heading--scriptlet | ||
adopt-info: ipfs | ||
base: core18 | ||
grade: stable | ||
confinement: strict | ||
|
||
apps: | ||
ipfs: | ||
command: ipfs | ||
plugs: [network, network-bind, removable-media] | ||
environment: | ||
# Snaps versions are isolated by default. This keeps the same ipfs repo across upgrades. | ||
IPFS_PATH: "$SNAP_USER_COMMON" | ||
|
||
parts: | ||
ipfs: | ||
source: '.' | ||
# TODO: set this to master when porting this file to ipfs/go-ipfs. | ||
# Setting it explicitly lets us build the missing versions 0.5 and 0.6 | ||
source-tag: master | ||
plugin: go | ||
# keep me up to date with the go version that go-ipfs expects to be built with. | ||
go-channel: 1.14/stable | ||
go-importpath: github.com/ipfs/go-ipfs | ||
build-packages: | ||
- build-essential | ||
|
||
# use `make` to build and set the snap version from `ipfs version` output | ||
override-build: | | ||
export GOPATH=$SNAPCRAFT_PART_BUILD/go | ||
make install | ||
cp $SNAPCRAFT_PART_BUILD/go/bin/ipfs $SNAPCRAFT_PART_INSTALL | ||
export IPFS_VERSION=$($SNAPCRAFT_PART_BUILD/go/bin/ipfs version --commit | cut -c 14-) | ||
echo "found version $IPFS_VERSION" | ||
snapcraftctl set-version $IPFS_VERSION |