From bb6e4569c11fe82ea130e0df7d05fe1f026c306c Mon Sep 17 00:00:00 2001 From: David Braun Date: Fri, 23 Mar 2018 01:20:41 -0400 Subject: [PATCH] build: Specify commits for Gaia and Voyager. --- .circleci/config.yml | 6 +++--- README.md | 21 +++++++++++++++++---- tasks/build/Dockerfile | 15 +++------------ tasks/build/entrypoint.sh | 11 +++++++++++ 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 66a14eee20..001cfb1af9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/README.md b/README.md index eb9dee051a..eada309011 100644 --- a/README.md +++ b/README.md @@ -95,17 +95,30 @@ $ 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 Git commit hash for a pre-built Gaia binary (e.g., +`decb23bed0179244e4f42d697dcd4bf759200a2d` for `v0.5.0`). + +The second argument is a commit for Voyager and can be any kind of reference +(e.g., the tag `0.4.3`). + +Optional arguments (such as `--platform`) must follow the first two arguments. + +```bash +yarn run build decb23bed0179244e4f42d697dcd4bf759200a2d 0.4.3 --platform={darwin|win32|linux} +``` + +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 decb23bed0179244e4f42d697dcd4bf759200a2d 0.4.3 --platform=darwin --skip-pack ``` To test if your build worked run: diff --git a/tasks/build/Dockerfile b/tasks/build/Dockerfile index 8de777e359..4a9ea48b76 100644 --- a/tasks/build/Dockerfile +++ b/tasks/build/Dockerfile @@ -5,18 +5,9 @@ FROM node:9.4.0 RUN dpkg --add-architecture i386 \ && apt-get update \ && apt-get --yes install \ - wine \ - wine32 \ - libwine - -# 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 - - + wine \ + wine32 \ + libwine COPY entrypoint.sh / RUN mkdir -p /usr/src/app diff --git a/tasks/build/entrypoint.sh b/tasks/build/entrypoint.sh index dec5e3f13c..9ba35e4486 100755 --- a/tasks/build/entrypoint.sh +++ b/tasks/build/entrypoint.sh @@ -1,5 +1,16 @@ #!/bin/sh +set -o errexit + +# Download Gaia. We're trusting HTTPS and Interblock here. :-/ +wget --output-document=/usr/local/bin/gaia \ + https://tendermint-packages.interblock.io/binaries/gaia_linux_amd64/gaia_$1 + git clone /.git . +git checkout $2 + +# Remove the commits before passing the arguments along to release.js. +shift 2 + ln --symbolic /builds yarn node tasks/release.js --binary=/usr/local/bin/gaia "$@"