-
Notifications
You must be signed in to change notification settings - Fork 381
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
WIP: Add gitian-build.sh script for Gitian builds #837
Open
stevenroose
wants to merge
1
commit into
ElementsProject:master
Choose a base branch
from
stevenroose:gitian-build-script
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
|
||
# This script is to be used to generate Gitian builds for Elements releases. | ||
# Requirements: | ||
# - One needs the OSX SDK file in the following location: | ||
# bec9d089ebf2e2dd59b1a811a38ec78ebd5da18cbbcd6ab39d1e59f64ac5033f $HOME/blockstream/gitian/MacOSX10.11.sdk.tar.gz | ||
# The file can be downloaded here: | ||
# https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz | ||
# | ||
# - On an Arch machine, I had to install and start apt-cacher-ng. | ||
# Any non-Debian environment probably should do the same. | ||
# $ sudo systemctl start apt-cacher-ng | ||
# | ||
# - You'll need a bunch of basic packages from your distro. Non-exhaustive: | ||
# git, docker | ||
# | ||
# - User must have access to /tmp. /tmp/gitian and /tmp/elements are used in the process. | ||
# | ||
# | ||
# | ||
# Using the script: | ||
# Just invoke the script and pass the tag you want to build as an argument: | ||
# ./gitian-build.sh elements-0.18.1.6 | ||
|
||
|
||
|
||
: ${1?Need commit hash or tag} | ||
|
||
rm -fr /tmp/gitian /tmp/elements | ||
export USE_DOCKER=1 | ||
export NUM_JOB=$(cat /proc/cpuinfo | grep ^processor | wc -l) | ||
|
||
export CI_PROJECT_DIR=/tmp/elements | ||
export CI_COMMIT_TAG=$1 | ||
git clone https://github.com/devrandom/gitian-builder.git /tmp/gitian | ||
|
||
RESULT_DIR=$HOME/blockstream/gitian/out/$CI_COMMIT_TAG | ||
mkdir -p "$RESULT_DIR" | ||
|
||
git clone https://github.com/ElementsProject/elements.git ${CI_PROJECT_DIR} | ||
cd ${CI_PROJECT_DIR} | ||
mkdir /tmp/gitian/inputs | ||
cp $HOME/blockstream/gitian/MacOSX10.11.sdk.tar.gz /tmp/gitian/inputs/MacOSX10.11.sdk.tar.gz | ||
|
||
cd /tmp/gitian | ||
|
||
bin/make-base-vm --docker --suite bionic --arch amd64 | ||
|
||
bin/gbuild --num-make ${NUM_JOB} --memory 10000 --url elements=${CI_PROJECT_DIR} --commit elements=${CI_COMMIT_TAG} ${CI_PROJECT_DIR}/contrib/gitian-descriptors/gitian-linux.yml | ||
|
||
cp result/* $RESULT_DIR | ||
cp -r build/out/* $RESULT_DIR | ||
|
||
bin/gbuild --num-make ${NUM_JOB} --memory 10000 --url elements=${CI_PROJECT_DIR} --commit elements=${CI_COMMIT_TAG} ${CI_PROJECT_DIR}/contrib/gitian-descriptors/gitian-win.yml | ||
|
||
cp result/* $RESULT_DIR | ||
cp -r build/out/* $RESULT_DIR | ||
|
||
bin/gbuild --num-make ${NUM_JOB} --memory 10000 --url elements=${CI_PROJECT_DIR} --commit elements=${CI_COMMIT_TAG} ${CI_PROJECT_DIR}/contrib/gitian-descriptors/gitian-osx.yml | ||
|
||
cp result/* $RESULT_DIR | ||
cp -r build/out/* $RESULT_DIR | ||
|
||
# Afterwards, move all but the following files into another folder (I call it `unused`): | ||
# - elements-<version>-aarch64-linux-gnu.tar.gz | ||
# - elements-<version>-arm-linux-gnueabihf.tar.gz | ||
# - elements-<version>-i686-pc-linux-gnu.tar.gz | ||
# - elements-<version>-osx64.tar.gz | ||
# - elements-<version>-osx-unsigned.dmg | ||
# - elements-<version>-osx-unsigned.tar.gz | ||
# - elements-<version>-riscv64-linux-gnu.tar.gz | ||
# - elements-<version>-win32-setup-unsigned.exe | ||
# - elements-<version>-win32.zip | ||
# - elements-<version>-win64-setup-unsigned.exe | ||
# - elements-<version>-win64.zip | ||
# - elements-<version>-win-unsigned.tar.gz | ||
# - elements-<version>-x86_64-linux-gnu.tar.gz | ||
|
||
# Then create SHA256SUMS.asc as follows: | ||
#sha256sum <all files except unused; you get this by typing * then tab> | gpg2 --armor --clearsign > SHA256SUMS.asc | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be wrapped in a for loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm not sure I like that better. Like this it's very easy to comment parts out if something goes wrong and it's also very easy to do the steps manually by copy pasting them one by one. Which is probably what one should do using this for the first time.