Skip to content

Commit

Permalink
Package solana as a snap
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 18, 2018
1 parent 70d951c commit f6acf4b
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 3 deletions.
1 change: 1 addition & 0 deletions ci/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules/
/package-lock.json
/snapcraft.credentials
7 changes: 5 additions & 2 deletions ci/buildkite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 7 additions & 1 deletion ci/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -35,6 +40,7 @@ ARGS+=(
--env BUILDKITE_TAG
--env CODECOV_TOKEN
--env CRATES_IO_TOKEN
--env SNAPCRAFT_CREDENTIALS_KEY
)

set -x
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions ci/publish-snap.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 34 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f6acf4b

Please sign in to comment.