Package solana as a snap

This commit is contained in:
Michael Vines 2018-06-18 13:45:53 -07:00
parent 8ebc5c6b07
commit 9040d00110
6 changed files with 79 additions and 3 deletions

1
ci/.gitignore vendored
View File

@ -1,2 +1,3 @@
/node_modules/
/package-lock.json
/snapcraft.credentials

View File

@ -26,6 +26,9 @@ steps:
agents:
- "queue=cuda"
- wait
- command: "ci/publish.sh"
- command: "ci/docker-run.sh snapcraft/xenial-amd64 ci/publish-snap.sh"
timeout_in_minutes: 20
name: "publish release artifacts"
name: "publish snap"
- command: "ci/publish-crate.sh"
timeout_in_minutes: 20
name: "publish crate"

View File

@ -19,7 +19,12 @@ fi
docker pull "$IMAGE"
shift
ARGS=(--workdir /solana --volume "$PWD:/solana" --rm)
ARGS=(
--workdir /solana
--volume "$PWD:/solana"
--env "HOME=/solana"
--rm
)
ARGS+=(--env "CARGO_HOME=/solana/.cargo")
@ -35,6 +40,7 @@ ARGS+=(
--env BUILDKITE_TAG
--env CODECOV_TOKEN
--env CRATES_IO_TOKEN
--env SNAPCRAFT_CREDENTIALS_KEY
)
set -x

32
ci/publish-snap.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash -e
cd "$(dirname "$0")/.."
DRYRUN=
if [[ -z $BUILDKITE_BRANCH || $BUILDKITE_BRANCH =~ pull/* ]]; then
DRYRUN="echo"
fi
if [[ -z "$BUILDKITE_TAG" ]]; then
SNAP_CHANNEL=edge
else
SNAP_CHANNEL=beta
fi
if [[ -n $SNAPCRAFT_CREDENTIALS_KEY ]]; then
(
openssl aes-256-cbc -d \
-in ci/snapcraft.credentials.enc \
-out ci/snapcraft.credentials \
-k "$SNAPCRAFT_CREDENTIALS_KEY"
snapcraft login --with ci/snapcraft.credentials
) || {
rm -f ci/snapcraft.credentials;
exit 1
}
fi
set -x
snapcraft
$DRYRUN snapcraft push solana_*.snap --release $SNAP_CHANNEL

34
snap/snapcraft.yaml Normal file
View File

@ -0,0 +1,34 @@
name: solana
version: git
summary: Blockchain, Rebuilt for Scale
description: |
710,000 tx/s with off-the-shelf hardware and no sharding.
Scales with Moore's Law.
grade: devel
confinement: strict
apps:
fullnode:
command: solana-fullnode
plugs:
- network
- network-bind
- home
fullnode-config:
command: solana-fullnode-config
plugs:
- network
- network-bind
genesis:
command: solana-genesis
genesis-demo:
command: solana-genesis-demo
mint:
command: solana-mint
mint-demo:
command: solana-mint-demo
parts:
solana:
plugin: rust
rust-channel: stable