Skip to content

Commit

Permalink
build: Specify commit (& optional Gaia commit).
Browse files Browse the repository at this point in the history
  • Loading branch information
David Braun authored and David Braun committed Mar 23, 2018
1 parent c9cfb5f commit 47f40e1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
- node_modules
key: v1-dependencies-root-{{ checksum "package.json" }}

- run:
- run:
name: Add Gaia
command: |
sudo wget https://www.dropbox.com/s/vkyuut8hnzse614/gaia-0.5.0-linux-32?dl=1 -O ~/repo/gaia
sudo wget https://tendermint-packages.interblock.io/binaries/gaia_linux_amd64/gaia_decb23bed0179244e4f42d697dcd4bf759200a2d -O ~/repo/gaia
sudo chmod o+wx /home/circleci/repo/gaia
- run: yarn run test
- run: bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,32 @@ $ COSMOS_NODE=localhost yarn testnet
### Production

Building requires that [Docker](https://www.docker.com/get-docker) is installed
on your system. The build is made from code in the commit at `HEAD`, not from the files in the working tree.
on your system.

Build and run the app.
Build the app:

The first argument is a commit for Voyager (e.g., the tag `0.4.3`). Optional
arguments (such as `--platform`) must come afterwards.

```bash
yarn run build 0.4.3 --platform={darwin|win32|linux}
```

You can specify a commit hash for the version of Gaia to use if it has been prebuilt:

```bash
GAIA_COMMIT=decb23bed0179244e4f42d697dcd4bf759200a2d yarn run build 0.4.3
```


Run the app.
```bash
yarn run build --platform={darwin|win32|linux}
open builds/Cosmos-{platform}-x64/Cosmos.app
```

When you are testing the build system you can skip the repackaging of the JS files.
```bash
$ yarn run build --platform=darwin --skip-pack
$ yarn run build 0.4.3 --platform=darwin --skip-pack
```

To test if your build worked run:
Expand Down
10 changes: 4 additions & 6 deletions tasks/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ RUN dpkg --add-architecture i386 \
wine32 \
libwine

# Download Gaia.
# Use Gaia v0.5.0 by default.
ARG GAIA_COMMIT=decb23bed0179244e4f42d697dcd4bf759200a2d

# Download Gaia.
RUN wget --output-document=/usr/local/bin/gaia \
https://tendermint-packages.interblock.io/binaries/gaia_linux_amd64/gaia_decb23bed0179244e4f42d697dcd4bf759200a2d

RUN echo "9f6e79e52d809a4321440f09890e94bad6843de685d50b9b41b5246421918cb5 */usr/local/bin/gaia" \
| sha256sum --check -

https://tendermint-packages.interblock.io/binaries/gaia_linux_amd64/gaia_$GAIA_COMMIT

COPY entrypoint.sh /
RUN mkdir -p /usr/src/app
Expand Down
3 changes: 2 additions & 1 deletion tasks/build/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh
set -o errexit
set -o xtrace

docker build --tag cosmos/voyager-builder .
docker build --build-arg GAIA_COMMIT --tag cosmos/voyager-builder .
mkdir -p ../../builds

docker run \
Expand Down
4 changes: 4 additions & 0 deletions tasks/build/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh
set -o errexit

git clone /.git .
git checkout $1
shift
ln --symbolic /builds
yarn
node tasks/release.js --binary=/usr/local/bin/gaia "$@"

0 comments on commit 47f40e1

Please sign in to comment.