Fix permission issues
Use local and container path variables
This commit is contained in:
parent
b2f83fcc9c
commit
92b5ae82c8
@ -13,6 +13,11 @@ COPY input-sources/ /home/debian/input-sources/
|
|||||||
COPY bin/build-bitcoin.sh /home/debian/
|
COPY bin/build-bitcoin.sh /home/debian/
|
||||||
COPY bin/sign.sh /home/debian/
|
COPY bin/sign.sh /home/debian/
|
||||||
|
|
||||||
|
COPY gitian-gbuild.patch /home/debian/
|
||||||
|
|
||||||
|
## patch to not attempt removal of build directory (will be a volume)
|
||||||
|
RUN cd gitian-builder && patch -p1 < ../gitian-gbuild.patch && rm ../gitian-gbuild.patch
|
||||||
|
|
||||||
WORKDIR /home/debian
|
WORKDIR /home/debian
|
||||||
|
|
||||||
RUN chown -R debian.debian input-sources build-bitcoin.sh sign.sh
|
RUN chown -R debian.debian input-sources build-bitcoin.sh sign.sh
|
||||||
|
13
docker/gitian-bitcoin-host/gitian-gbuild.patch
Normal file
13
docker/gitian-bitcoin-host/gitian-gbuild.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- a/bin/gbuild 2015-01-14 10:25:27.275143892 +0100
|
||||||
|
+++ b/bin/gbuild 2015-01-14 10:25:56.171144093 +0100
|
||||||
|
@@ -182,8 +182,8 @@
|
||||||
|
cache_dir = 'cache'
|
||||||
|
enable_cache = build_desc["enable_cache"]
|
||||||
|
|
||||||
|
-FileUtils.rm_rf(build_dir)
|
||||||
|
-FileUtils.mkdir(build_dir)
|
||||||
|
+## build dir is cleaned up outside container running gitian-builder
|
||||||
|
+FileUtils.mkdir_p(build_dir)
|
||||||
|
FileUtils.mkdir_p(result_dir)
|
||||||
|
|
||||||
|
package_name = build_desc["name"] or raise "must supply name"
|
@ -40,21 +40,27 @@ fi
|
|||||||
set -o pipefail && \
|
set -o pipefail && \
|
||||||
MOSTRECENT="$(curl -s https://api.github.com/repos/bitcoin/bitcoin/tags | jq -r '.[0].name' | awk '{ print substr($0, 2) }')" || exit $?
|
MOSTRECENT="$(curl -s https://api.github.com/repos/bitcoin/bitcoin/tags | jq -r '.[0].name' | awk '{ print substr($0, 2) }')" || exit $?
|
||||||
|
|
||||||
## volumes inside container
|
## volumes inside container that are provided externally (bind mount)
|
||||||
SRCV="/home/debian/gitian-builder/cache/common"
|
LSOURCE="$SCRIPTS/gitian-cache"
|
||||||
DSTV="/home/debian/gitian-build/build/out"
|
LDEST="$SCRIPTS/gitian-built"
|
||||||
|
CSOURCE="/home/debian/gitian-builder/cache"
|
||||||
|
CDEST="/home/debian/gitian-builder/build"
|
||||||
|
|
||||||
## run all necessary containers, detached
|
## run all necessary containers, detached
|
||||||
## setup proper volumes for input/output collection
|
## setup proper volumes for input/output collection
|
||||||
function run_all() {
|
function run_all() {
|
||||||
local OS
|
local OS
|
||||||
|
|
||||||
mkdir -p "$SCRIPTS/cache" "$SCRIPTS/built" && \
|
for OS in "$@"; do
|
||||||
chown 1000.1000 "$SCRIPTS/cache" "$SCRIPTS/built" || return $?
|
mkdir -p "$LSOURCE/${OS}" && \
|
||||||
|
rm -rf "$LDEST" && \
|
||||||
|
mkdir -p "$LDEST" || return $?
|
||||||
|
done
|
||||||
|
mkdir -p "$LSOURCE" "$LDEST" && \
|
||||||
|
chown -R 1000.1000 "$LDEST" "$LSOURCE" || return $?
|
||||||
|
|
||||||
for OS in "$@"; do
|
for OS in "$@"; do
|
||||||
mkdir -p "$SCRIPTS/cache/${OS}-inputs" "$SCRIPTS/built/${OS}" && \
|
echo "docker run -d --privileged -v $LSOURCE/${OS}:${CSOURCE} -v $LDEST/${OS}:$CDEST gdm85/gitian-bitcoin-host" || return $?
|
||||||
echo "docker run -d --privileged -v $SCRIPTS/cache/${OS}-inputs:${SRCV} -v $SCRIPTS/built/${OS}:${DSTV} gdm85/gitian-bitcoin-host" || return $?
|
|
||||||
done | $PARALLEL
|
done | $PARALLEL
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +78,7 @@ function build_all() {
|
|||||||
OS=${OSES[$I]}
|
OS=${OSES[$I]}
|
||||||
|
|
||||||
## first, fix rights of mounted volumes
|
## first, fix rights of mounted volumes
|
||||||
# echo -n "docker exec $CID chown -R debian.debian '$SRCV' '$DSTV' && " && \
|
echo -n "docker exec $CID chown -R debian.debian '$CSOURCE' '$CDEST' && " && \
|
||||||
echo "docker exec $CID su -c 'cd /home/debian && source .bash_profile && ./build-bitcoin.sh $MOSTRECENT ${OS}' debian"
|
echo "docker exec $CID su -c 'cd /home/debian && source .bash_profile && ./build-bitcoin.sh $MOSTRECENT ${OS}' debian"
|
||||||
let I+=1
|
let I+=1
|
||||||
done | $PARALLEL
|
done | $PARALLEL
|
||||||
@ -84,6 +90,8 @@ build_all $CREATED $@ && \
|
|||||||
echo "Build results are available in '$SCRIPTS/built/'"
|
echo "Build results are available in '$SCRIPTS/built/'"
|
||||||
RV=$?
|
RV=$?
|
||||||
|
|
||||||
|
exit $RV
|
||||||
|
|
||||||
## cleanup
|
## cleanup
|
||||||
echo "Cleaning up created containers..."
|
echo "Cleaning up created containers..."
|
||||||
for CID in $CREATED; do
|
for CID in $CREATED; do
|
||||||
|
Loading…
Reference in New Issue
Block a user