beacon-node-builds: Use debian image for docker, add --force
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
f484a8617f
commit
fafcfee4f6
|
@ -11,12 +11,12 @@ beacon_node_builds_docker_hub_token: ~
|
|||
beacon_node_build_timer_timeout: 1200
|
||||
|
||||
beacon_node_builds_branches:
|
||||
- name: 'master'
|
||||
branch: 'master'
|
||||
frequency: '*-*-* 02:00:00'
|
||||
- name: 'devel'
|
||||
branch: 'devel'
|
||||
frequency: '*-*-* 10:00:00'
|
||||
- name: 'master'
|
||||
branch: 'master'
|
||||
frequency: '*-*-* 02:00:00'
|
||||
- name: 'libp2p'
|
||||
branch: 'nim-libp2p-auto-bump'
|
||||
frequency: '*-*-* 18:00:00'
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
FROM alpine:3.12.1
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG COMMIT
|
||||
|
||||
RUN apk add --no-cache libgcc pcre
|
||||
RUN apt-get -qq update \
|
||||
&& apt-get -qq -y install libpcre3-dev &>/dev/null \
|
||||
&& apt-get -qq clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
COPY repo/build/* /usr/local/bin/
|
||||
COPY repo/build/beacon_node repo/build/signing_process /usr/local/bin/
|
||||
|
||||
STOPSIGNAL SIGINT
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/beacon_node"]
|
||||
|
||||
CMD ["--help"]
|
||||
|
|
|
@ -8,28 +8,36 @@ if [[ "${USER}" != "{{ beacon_node_builds_user }}" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
IMAGE="{{ beacon_node_builds_image_name }}:{{ item.name }}"
|
||||
IMAGE="{{ beacon_node_builds_image_name }}"
|
||||
TAG="{{ item.name }}"
|
||||
|
||||
# Build the Beacon node binaries
|
||||
{
|
||||
cd repo
|
||||
COMMIT_BEFORE=$(git rev-parse --short=8 HEAD)
|
||||
git pull
|
||||
COMMIT_AFTER=$(git rev-parse --short=8 HEAD)
|
||||
pushd repo
|
||||
|
||||
if [[ "${COMMIT_BEFORE}" == "${COMMIT_AFTER}" ]]; then
|
||||
echo "Nothing new to build."
|
||||
exit
|
||||
fi
|
||||
COMMIT_BEFORE=$(git rev-parse --short=8 HEAD)
|
||||
git pull
|
||||
COMMIT_AFTER=$(git rev-parse --short=8 HEAD)
|
||||
|
||||
make update
|
||||
make \
|
||||
if [[ "$1" == "--force" ]]; then
|
||||
echo "Forcing rebuild!"
|
||||
elif [[ "${COMMIT_BEFORE}" == "${COMMIT_AFTER}" ]]; then
|
||||
echo "Nothing new to build."
|
||||
exit
|
||||
fi
|
||||
|
||||
make update
|
||||
make \
|
||||
LOG_LEVEL="TRACE" \
|
||||
MAKEFLAGS="-j$(nproc)" \
|
||||
NIMFLAGS="-d:insecure -d:testnet_servers_image" \
|
||||
beacon_node signing_process
|
||||
}
|
||||
|
||||
popd
|
||||
|
||||
# Add binary into a simple Alpine image
|
||||
docker build -t "${IMAGE}" --build-arg=COMMIT=${COMMIT_AFTER} .
|
||||
docker push "${IMAGE}"
|
||||
docker build -t "${IMAGE}:${COMMIT_AFTER}" --build-arg=COMMIT=${COMMIT_AFTER} .
|
||||
docker tag "${IMAGE}:${COMMIT_AFTER}" "${IMAGE}:${TAG}"
|
||||
docker push "${IMAGE}:${COMMIT_AFTER}"
|
||||
docker push "${IMAGE}:${TAG}"
|
||||
|
||||
echo "SUCCESS - pushed: ${IMAGE}:${TAG}"
|
||||
|
|
Loading…
Reference in New Issue