SomberNight
4 years ago
11 changed files with 275 additions and 199 deletions
@ -0,0 +1,68 @@ |
|||||
|
#!/bin/bash |
||||
|
# |
||||
|
# env vars: |
||||
|
# - ELECBUILD_NOCACHE: if set, forces rebuild of docker image |
||||
|
# - ELECBUILD_COMMIT: if set, do a fresh clone and git checkout |
||||
|
|
||||
|
set -e |
||||
|
|
||||
|
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../.." |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$PROJECT_ROOT" |
||||
|
CONTRIB="$PROJECT_ROOT/contrib" |
||||
|
CONTRIB_ANDROID="$CONTRIB/android" |
||||
|
DISTDIR="$PROJECT_ROOT/dist" |
||||
|
|
||||
|
. "$CONTRIB"/build_tools_util.sh |
||||
|
|
||||
|
|
||||
|
DOCKER_BUILD_FLAGS="" |
||||
|
if [ ! -z "$ELECBUILD_NOCACHE" ] ; then |
||||
|
info "ELECBUILD_NOCACHE is set. forcing rebuild of docker image." |
||||
|
DOCKER_BUILD_FLAGS="--pull --no-cache" |
||||
|
fi |
||||
|
|
||||
|
info "building docker image." |
||||
|
cp "$CONTRIB/deterministic-build/requirements-build-android.txt" "$CONTRIB_ANDROID/requirements-build-android.txt" |
||||
|
sudo docker build \ |
||||
|
$DOCKER_BUILD_FLAGS \ |
||||
|
-t electrum-android-builder-img \ |
||||
|
"$CONTRIB_ANDROID" |
||||
|
rm "$CONTRIB_ANDROID/requirements-build-android.txt" |
||||
|
|
||||
|
|
||||
|
# maybe do fresh clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
info "ELECBUILD_COMMIT=$ELECBUILD_COMMIT. doing fresh clone and git checkout." |
||||
|
FRESH_CLONE="$CONTRIB_ANDROID/fresh_clone/electrum" && \ |
||||
|
sudo rm -rf "$FRESH_CLONE" && \ |
||||
|
umask 0022 && \ |
||||
|
git clone "$PROJECT_ROOT" "$FRESH_CLONE" && \ |
||||
|
cd "$FRESH_CLONE" |
||||
|
git checkout "$ELECBUILD_COMMIT" |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$FRESH_CLONE" |
||||
|
else |
||||
|
info "not doing fresh clone." |
||||
|
fi |
||||
|
|
||||
|
DOCKER_RUN_FLAGS="" |
||||
|
if [[ -n "$1" && "$1" == "release" ]] ; then |
||||
|
info "'release' mode selected. mounting ~/.keystore inside container." |
||||
|
DOCKER_RUN_FLAGS="-v $HOME/.keystore:/home/user/.keystore" |
||||
|
fi |
||||
|
|
||||
|
info "building binary..." |
||||
|
mkdir --parents "$PROJECT_ROOT_OR_FRESHCLONE_ROOT"/.buildozer/.gradle |
||||
|
sudo docker run -it --rm \ |
||||
|
--name electrum-android-builder-cont \ |
||||
|
-v "$PROJECT_ROOT_OR_FRESHCLONE_ROOT":/home/user/wspace/electrum \ |
||||
|
-v "$PROJECT_ROOT_OR_FRESHCLONE_ROOT"/.buildozer/.gradle:/home/user/.gradle \ |
||||
|
$DOCKER_RUN_FLAGS \ |
||||
|
--workdir /home/user/wspace/electrum \ |
||||
|
electrum-android-builder-img \ |
||||
|
./contrib/android/make_apk "$@" |
||||
|
|
||||
|
# make sure resulting binary location is independent of fresh_clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
mkdir --parents "$DISTDIR/" |
||||
|
sudo cp -f "$FRESH_CLONE/dist"/* "$DISTDIR/" |
||||
|
fi |
@ -1,10 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
|
|
||||
set -e |
|
||||
|
|
||||
CONTRIB_ANDROID="$(dirname "$(readlink -e "$0")")" |
|
||||
CONTRIB="$CONTRIB_ANDROID"/.. |
|
||||
|
|
||||
cp "$CONTRIB/deterministic-build/requirements-build-android.txt" "$CONTRIB_ANDROID/requirements-build-android.txt" |
|
||||
sudo docker build -t electrum-android-builder-img "$CONTRIB_ANDROID" |
|
||||
rm "$CONTRIB_ANDROID/requirements-build-android.txt" |
|
@ -0,0 +1,57 @@ |
|||||
|
#!/bin/bash |
||||
|
# |
||||
|
# env vars: |
||||
|
# - ELECBUILD_NOCACHE: if set, forces rebuild of docker image |
||||
|
# - ELECBUILD_COMMIT: if set, do a fresh clone and git checkout |
||||
|
|
||||
|
set -e |
||||
|
|
||||
|
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../../.." |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$PROJECT_ROOT" |
||||
|
CONTRIB="$PROJECT_ROOT/contrib" |
||||
|
CONTRIB_APPIMAGE="$CONTRIB/build-linux/appimage" |
||||
|
DISTDIR="$PROJECT_ROOT/dist" |
||||
|
|
||||
|
. "$CONTRIB"/build_tools_util.sh |
||||
|
|
||||
|
|
||||
|
DOCKER_BUILD_FLAGS="" |
||||
|
if [ ! -z "$ELECBUILD_NOCACHE" ] ; then |
||||
|
info "ELECBUILD_NOCACHE is set. forcing rebuild of docker image." |
||||
|
DOCKER_BUILD_FLAGS="--pull --no-cache" |
||||
|
fi |
||||
|
|
||||
|
info "building docker image." |
||||
|
sudo docker build \ |
||||
|
$DOCKER_BUILD_FLAGS \ |
||||
|
-t electrum-appimage-builder-img \ |
||||
|
"$CONTRIB_APPIMAGE" |
||||
|
|
||||
|
# maybe do fresh clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
info "ELECBUILD_COMMIT=$ELECBUILD_COMMIT. doing fresh clone and git checkout." |
||||
|
FRESH_CLONE="$CONTRIB_APPIMAGE/fresh_clone/electrum" && \ |
||||
|
sudo rm -rf "$FRESH_CLONE" && \ |
||||
|
umask 0022 && \ |
||||
|
git clone "$PROJECT_ROOT" "$FRESH_CLONE" && \ |
||||
|
cd "$FRESH_CLONE" |
||||
|
git checkout "$ELECBUILD_COMMIT" |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$FRESH_CLONE" |
||||
|
else |
||||
|
info "not doing fresh clone." |
||||
|
fi |
||||
|
|
||||
|
info "building binary..." |
||||
|
sudo docker run -it \ |
||||
|
--name electrum-appimage-builder-cont \ |
||||
|
-v "$PROJECT_ROOT_OR_FRESHCLONE_ROOT":/opt/electrum \ |
||||
|
--rm \ |
||||
|
--workdir /opt/electrum/contrib/build-linux/appimage \ |
||||
|
electrum-appimage-builder-img \ |
||||
|
./make_appimage.sh |
||||
|
|
||||
|
# make sure resulting binary location is independent of fresh_clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
mkdir --parents "$DISTDIR/" |
||||
|
sudo cp -f "$FRESH_CLONE/dist"/* "$DISTDIR/" |
||||
|
fi |
@ -0,0 +1,57 @@ |
|||||
|
#!/bin/bash |
||||
|
# |
||||
|
# env vars: |
||||
|
# - ELECBUILD_NOCACHE: if set, forces rebuild of docker image |
||||
|
# - ELECBUILD_COMMIT: if set, do a fresh clone and git checkout |
||||
|
|
||||
|
set -e |
||||
|
|
||||
|
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../../.." |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$PROJECT_ROOT" |
||||
|
CONTRIB="$PROJECT_ROOT/contrib" |
||||
|
CONTRIB_SDIST="$CONTRIB/build-linux/sdist" |
||||
|
DISTDIR="$PROJECT_ROOT/dist" |
||||
|
|
||||
|
. "$CONTRIB"/build_tools_util.sh |
||||
|
|
||||
|
|
||||
|
DOCKER_BUILD_FLAGS="" |
||||
|
if [ ! -z "$ELECBUILD_NOCACHE" ] ; then |
||||
|
info "ELECBUILD_NOCACHE is set. forcing rebuild of docker image." |
||||
|
DOCKER_BUILD_FLAGS="--pull --no-cache" |
||||
|
fi |
||||
|
|
||||
|
info "building docker image." |
||||
|
sudo docker build \ |
||||
|
$DOCKER_BUILD_FLAGS \ |
||||
|
-t electrum-sdist-builder-img \ |
||||
|
"$CONTRIB_SDIST" |
||||
|
|
||||
|
# maybe do fresh clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
info "ELECBUILD_COMMIT=$ELECBUILD_COMMIT. doing fresh clone and git checkout." |
||||
|
FRESH_CLONE="$CONTRIB_SDIST/fresh_clone/electrum" && \ |
||||
|
sudo rm -rf "$FRESH_CLONE" && \ |
||||
|
umask 0022 && \ |
||||
|
git clone "$PROJECT_ROOT" "$FRESH_CLONE" && \ |
||||
|
cd "$FRESH_CLONE" |
||||
|
git checkout "$ELECBUILD_COMMIT" |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$FRESH_CLONE" |
||||
|
else |
||||
|
info "not doing fresh clone." |
||||
|
fi |
||||
|
|
||||
|
info "building binary..." |
||||
|
sudo docker run -it \ |
||||
|
--name electrum-sdist-builder-cont \ |
||||
|
-v "$PROJECT_ROOT_OR_FRESHCLONE_ROOT":/opt/electrum \ |
||||
|
--rm \ |
||||
|
--workdir /opt/electrum/contrib/build-linux/sdist \ |
||||
|
electrum-sdist-builder-img \ |
||||
|
./make_sdist.sh |
||||
|
|
||||
|
# make sure resulting binary location is independent of fresh_clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
mkdir --parents "$DISTDIR/" |
||||
|
sudo cp -f "$FRESH_CLONE/dist"/* "$DISTDIR/" |
||||
|
fi |
@ -0,0 +1,56 @@ |
|||||
|
#!/bin/bash |
||||
|
# |
||||
|
# env vars: |
||||
|
# - ELECBUILD_NOCACHE: if set, forces rebuild of docker image |
||||
|
# - ELECBUILD_COMMIT: if set, do a fresh clone and git checkout |
||||
|
|
||||
|
set -e |
||||
|
|
||||
|
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../.." |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$PROJECT_ROOT" |
||||
|
CONTRIB="$PROJECT_ROOT/contrib" |
||||
|
CONTRIB_WINE="$CONTRIB/build-wine" |
||||
|
|
||||
|
. "$CONTRIB"/build_tools_util.sh |
||||
|
|
||||
|
|
||||
|
DOCKER_BUILD_FLAGS="" |
||||
|
if [ ! -z "$ELECBUILD_NOCACHE" ] ; then |
||||
|
info "ELECBUILD_NOCACHE is set. forcing rebuild of docker image." |
||||
|
DOCKER_BUILD_FLAGS="--pull --no-cache" |
||||
|
fi |
||||
|
|
||||
|
info "building docker image." |
||||
|
sudo docker build \ |
||||
|
$DOCKER_BUILD_FLAGS \ |
||||
|
-t electrum-wine-builder-img \ |
||||
|
"$CONTRIB_WINE" |
||||
|
|
||||
|
# maybe do fresh clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
info "ELECBUILD_COMMIT=$ELECBUILD_COMMIT. doing fresh clone and git checkout." |
||||
|
FRESH_CLONE="$CONTRIB_WINE/fresh_clone/electrum" && \ |
||||
|
sudo rm -rf "$FRESH_CLONE" && \ |
||||
|
umask 0022 && \ |
||||
|
git clone "$PROJECT_ROOT" "$FRESH_CLONE" && \ |
||||
|
cd "$FRESH_CLONE" |
||||
|
git checkout "$ELECBUILD_COMMIT" |
||||
|
PROJECT_ROOT_OR_FRESHCLONE_ROOT="$FRESH_CLONE" |
||||
|
else |
||||
|
info "not doing fresh clone." |
||||
|
fi |
||||
|
|
||||
|
info "building binary..." |
||||
|
sudo docker run -it \ |
||||
|
--name electrum-wine-builder-cont \ |
||||
|
-v "$PROJECT_ROOT_OR_FRESHCLONE_ROOT":/opt/wine64/drive_c/electrum \ |
||||
|
--rm \ |
||||
|
--workdir /opt/wine64/drive_c/electrum/contrib/build-wine \ |
||||
|
electrum-wine-builder-img \ |
||||
|
./make_win.sh |
||||
|
|
||||
|
# make sure resulting binary location is independent of fresh_clone |
||||
|
if [ ! -z "$ELECBUILD_COMMIT" ] ; then |
||||
|
mkdir --parents "$PROJECT_ROOT/contrib/build-wine/dist/" |
||||
|
sudo cp -f "$FRESH_CLONE/contrib/build-wine/dist"/* "$PROJECT_ROOT/contrib/build-wine/dist/" |
||||
|
fi |
Loading…
Reference in new issue