这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ contrib
build
docs
tests
!build/dokku.deb
!build/package/*
!tests/dhparam.pem
!contrib/bash-completion
!contrib/docker
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN addgroup --gid $DOKKU_GID dokku \
&& adduser --uid $DOKKU_UID --gid $DOKKU_GID --disabled-password --gecos "" "dokku"

COPY ./tests/dhparam.pem /tmp/dhparam.pem
COPY ./build/dokku.deb /tmp/dokku.deb
COPY ./build/package/ /tmp

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3005,DL3008
Expand All @@ -28,7 +28,7 @@ RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections
&& apt-get update -qq \
&& apt-get upgrade -qq -y \
&& apt-get -qq -y --no-install-recommends --only-upgrade install openssl openssh-server \
&& apt-get -qq -y --no-install-recommends install rsync /tmp/dokku.deb \
&& apt-get -qq -y --no-install-recommends install rsync "/tmp/dokku-$(dpkg --print-architecture).deb" \
&& apt-get purge -qq -y syslog-ng-core \
&& apt-get autoremove -qq -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
20 changes: 20 additions & 0 deletions contrib/build-dokku.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,24 @@ RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \
GOARCH=arm make version copyfiles \
&& DOKKU_ARCHITECTURE=armhf GOARCH=arm make deb-dokku

FROM builder as arm64

COPY --from=armhf /tmp /tmp
COPY --from=amd64 /usr/local/share/man/man1/dokku.1 /usr/local/share/man/man1/dokku.1-generated

RUN rm -rf /tmp/build-dokku

ARG PLUGIN_MAKE_TARGET
ARG DOKKU_VERSION=master
ARG DOKKU_GIT_REV
ARG IS_RELEASE=false

RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \
DOKKU_VERSION=${DOKKU_VERSION} \
DOKKU_GIT_REV=${DOKKU_GIT_REV} \
IS_RELEASE=${IS_RELEASE} \
SKIP_GO_CLEAN=true \
GOARCH=arm64 make version copyfiles \
&& DOKKU_ARCHITECTURE=arm64 GOARCH=arm64 make deb-dokku

RUN ls -lha /tmp/
35 changes: 23 additions & 12 deletions contrib/release-dokku
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,21 @@ fn-require-bin() {

fn-build-docker-image() {
declare desc="Builds the dokku docker image and tags it with the given version"
declare VERSION="$1"
docker build -t "dokku/dokku:$VERSION" .
declare VERSION="$1" IS_RELEASE="$2"

if [[ "$IS_RELEASE" == "true" ]]; then
docker buildx build \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--progress plain \
--push \
--tag "dokku/dokku:latest" \
--tag "dokku/dokku:$VERSION" .
else
docker buildx build \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--progress plain \
--tag "dokku/dokku:$VERSION" .
fi
}

main() {
Expand Down Expand Up @@ -392,31 +405,29 @@ main() {
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION" || log-fail "Error building package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_armhf.deb" || log-fail "Error extracting deb package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_arm64.deb" || log-fail "Error extracting deb package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error extracting deb package"
fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
cp -f "build/dokku_${NEXT_VERSION}_amd64.deb" build/dokku.deb
mkdir -p build/package
cp -f "build/dokku_${NEXT_VERSION}_amd64.deb" build/package/dokku-amd64.deb
cp -f "build/dokku_${NEXT_VERSION}_arm64.deb" build/package/dokku-arm64.deb
cp -f "build/dokku_${NEXT_VERSION}_armhf.deb" build/package/dokku-armhf.deb
cp -f "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" build/package/dokku-amd64.rpm

if [[ "$RELEASE" != "build" ]]; then
fn-publish-package "$IS_RELEASE" "raspbian" "build/dokku_${NEXT_VERSION}_armhf.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "deb" "build/dokku_${NEXT_VERSION}_arm64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "deb" "build/dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fn-build-docker-image "$NEXT_VERSION" || log-fail "Error building docker image"
fn-build-docker-image "$NEXT_VERSION" "$IS_RELEASE" || log-fail "Error building docker image"

if [[ "$IS_RELEASE" == "true" ]]; then
docker tag "dokku/dokku:$NEXT_VERSION" "dokku/dokku:latest"
docker push "dokku/dokku:$NEXT_VERSION"
docker push "dokku/dokku:latest"
fi
fn-repo-push-tags "$IS_RELEASE"
fi

if [[ "$IS_RELEASE" != "true" ]]; then
git reset -q HEAD plugins/*/plugin.toml
git checkout -- plugins/*/plugin.toml
fi

echo "build/dokku_${NEXT_VERSION}_amd64.deb" >build/deb-filename
echo "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" >build/rpm-filename
}

main "$@"
11 changes: 5 additions & 6 deletions tests/ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,13 @@ build_dokku() {

echo "=====> build_dokku on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
"${ROOT_DIR}/contrib/release-dokku" build
cp "$(cat "${ROOT_DIR}/build/deb-filename")" "${ROOT_DIR}/build/dokku.deb"
cp "$(cat "${ROOT_DIR}/build/rpm-filename")" "${ROOT_DIR}/build/dokku.rpm"
}

install_dokku() {
echo "=====> install_dokku on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"

if [[ ! -f "${ROOT_DIR}/build/deb-filename" ]]; then
local architecture="$(dpkg --print-architecture)"
if [[ ! -f "${ROOT_DIR}/build/package/dokku-${architecture}.deb" ]]; then
build_dokku
fi

Expand All @@ -98,9 +97,9 @@ EOF
echo "-----> End debconf selections"

sleep 5
echo "-----> Start install $(cat "${ROOT_DIR}/build/deb-filename") via dpkg"
sudo TRACE=1 dpkg -i "$(cat "${ROOT_DIR}/build/deb-filename")"
echo "-----> End install $(cat "${ROOT_DIR}/build/deb-filename") via dpkg"
echo "-----> Start install ${ROOT_DIR}/build/package/dokku-${architecture}.deb via dpkg"
sudo TRACE=1 dpkg -i "${ROOT_DIR}/build/package/dokku-${architecture}.deb"
echo "-----> End install ${ROOT_DIR}/build/package/dokku-${architecture}.deb via dpkg"
}

build_dokku_docker_image() {
Expand Down