Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build.snapcraft.io integration #3489

Merged
merged 3 commits into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,52 +264,6 @@ jobs:
make localnet-start
./scripts/localnet-blocks-test.sh 40 5 10 localhost

snap-edge:
working_directory: /home/circleci/.snap_workspace/src/github.com/cosmos/cosmos-sdk
machine: true
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
GOPATH: /tmp/workspace
GOBIN: /tmp/workspace/bin
parallelism: 1
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install prerequitistes
command: |
sudo sh -c "echo '#!/bin/sh' > /usr/sbin/update-initramfs"
sudo sh -c "echo 'exit 0' >> /usr/sbin/update-initramfs"
sudo apt update -y &>/dev/null
sudo apt install -y build-essential snapd
sudo snap install snapcraft --edge --classic
- run:
name: prepping snap build
command: |
/snap/bin/snapcraft version
make snapcraft.yaml
- run:
name: build edge snap
command: /snap/bin/snapcraft
- run:
name: Create credentials file
command: |
echo '[login.ubuntu.com]' > credentials
echo "macaroon = $SNAPCRAFT_CREDENTIALS_MACAROON" >> credentials
echo "unbound_discharge = $SNAPCRAFT_CREDENTIALS_UNBOUND_DISCHARGE" >> credentials
echo "email = $SNAPCRAFT_CREDENTIALS_EMAIL" >> credentials
- run:
name: Authenticate snapcraft
command: /snap/bin/snapcraft login --with credentials
- run:
name: Push/release snap
command: /snap/bin/snapcraft push *.snap --release edge
- run:
name: Clean up credentials file
command: rm -vf credentials

deploy_docs:
<<: *docs_deploy
steps:
Expand Down Expand Up @@ -430,14 +384,6 @@ workflows:
- localnet:
requires:
- setup_dependencies
- snap-edge:
requires:
- setup_dependencies
filters:
branches:
only:
- master
- develop
- upload_coverage:
requires:
- test_cover
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ draw_deps: tools
@goviz -i github.com/cosmos/cosmos-sdk/cmd/gaia/cmd/gaiad -d 2 | dot -Tpng -o dependency-graph.png

clean:
rm -f devtools-stamp vendor-deps snapcraft.yaml
rm -f devtools-stamp vendor-deps snapcraft-local.yaml

distclean: clean
rm -rf vendor/
Expand Down Expand Up @@ -256,14 +256,9 @@ localnet-stop:
########################################
### Packaging

snapcraft.yaml: snapcraft.yaml.in
snapcraft-local.yaml: snapcraft-local.yaml.in
sed "s/@VERSION@/${VERSION}/g" < $< > $@

build-snap-edge: snapcraft.yaml
snapcraft clean
snapcraft


# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
Expand All @@ -274,4 +269,4 @@ build-linux build-docker-gaiadnode localnet-start localnet-stop \
format check-ledger test_sim_gaia_nondeterminism test_sim_modules test_sim_gaia_fast \
test_sim_gaia_custom_genesis_fast test_sim_gaia_custom_genesis_multi_seed \
test_sim_gaia_multi_seed test_sim_gaia_import_export update_tools update_dev_tools \
build-snap-edge devtools-clean
devtools-clean
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

[![version](https://img.shields.io/github/tag/cosmos/cosmos-sdk.svg)](https://github.com/cosmos/cosmos-sdk/releases/latest)
[![CircleCI](https://circleci.com/gh/cosmos/cosmos-sdk/tree/master.svg?style=shield)](https://circleci.com/gh/cosmos/cosmos-sdk/tree/master)
[![Snap Status](https://build.snapcraft.io/badge/cosmos/cosmos-sdk.svg)](https://build.snapcraft.io/user/cosmos/cosmos-sdk)
[![codecov](https://codecov.io/gh/cosmos/cosmos-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/cosmos/cosmos-sdk)
[![Go Report Card](https://goreportcard.com/badge/github.com/cosmos/cosmos-sdk)](https://goreportcard.com/report/github.com/cosmos/cosmos-sdk)
[![license](https://img.shields.io/github/license/cosmos/cosmos-sdk.svg)](https://github.com/cosmos/cosmos-sdk/blob/master/LICENSE)
Expand Down
20 changes: 7 additions & 13 deletions snapcraft-full.yaml.in → snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: gaia # you probably want to 'snapcraft register <name>'
# base: core18 # the base snap is the execution environment for this snap
version: '@VERSION@' # just for humans, typically '1.2+git' or '1.3.2'
name: gaia
version: git
summary: Gaia Daemon # 79 char long summary
description: |
This snap provides the Gaia daemon gaiad and the command line
tool gaiacli.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
confinement: strict

apps:
gaiad:
Expand All @@ -24,17 +23,12 @@ parts:
rootdir=$(pwd)
gitroot=$(git rev-parse --show-toplevel)
cd ${gitroot} && git archive \
-o ${rootdir}/gaia-@VERSION@.tar.gz \
--format tar.gz -9 --prefix gaia-@VERSION@/ HEAD
-o ${rootdir}/gaia-git.tar.gz \
--format tar.gz -9 --prefix gaia-git/ HEAD
cd ${rootdir}
tar xf gaia-@VERSION@.tar.gz ; rm -f gaia-@VERSION@.tar.gz
tar xf gaia-git.tar.gz ; rm -f gaia-git.tar.gz
mkdir -p go/src/github.com/cosmos bin
mv gaia-@VERSION@/ go/src/github.com/cosmos/cosmos-sdk/

# Use the following instructions to build a package from a release.
# wget https://github.com/cosmos/cosmos-sdk/archive/v@[email protected]
# tar xvf v@[email protected]
# rm v@[email protected]
mv gaia-git/ go/src/github.com/cosmos/cosmos-sdk/

build-snaps: [go]
override-build: |
Expand Down