Skip to content

Commit 1bf4be9

Browse files
committed
Add v3.4.1
This updates release process, and used dockerfiles.
1 parent a290207 commit 1bf4be9

36 files changed

+689
-93
lines changed

.dockerignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
tmp/
2+
build/
23
release/
3-
**/Dockerfile
4-
**/Dockerfile.client
4+
dockerfiles/Dockerfile*
5+
.env.mk

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
docker-compose.override.yml
2-
tmp/
32
proxmox-backup-client*.tgz
43
/.env.mk
4+
/tmp/
5+
/build/
56
/release/

Makefile

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ BUILD_ARCHS = amd64 arm64v8
22
CLIENT_BUILD_ARCHS = amd64 arm64v8
33
REGISTRY ?= ayufan/proxmox-backup-server
44
SHELL = /usr/bin/env bash
5-
6-
ifeq (,$(VERSION))
7-
VERSION := $(shell ls versions | grep -E -v '.(tmp|debug)' | sort -V | tail -n 1)
8-
endif
5+
include repos/version.mk
96

107
ifeq (,$(TAG))
118
TAG := $(VERSION)
@@ -40,7 +37,7 @@ dev-%:
4037
--build-arg ARCH=$(addsuffix /,$(DOCKER_ARCH)) \
4138
--build-arg TAG=$(TAG) \
4239
--build-arg VERSION=$(VERSION) \
43-
-f versions/$(VERSION)/Dockerfile \
40+
-f dockerfiles/Dockerfile \
4441
.
4542

4643
docker-build: $(addsuffix -docker-build, $(BUILD_ARCHS))
@@ -86,7 +83,7 @@ dockerhub-latest-release: $(addsuffix -dockerhub-latest-release, $(BUILD_ARCHS))
8683
--build-arg DOCKER_ARCH=$(DOCKER_ARCH) \
8784
--build-arg TAG=$(TAG) \
8885
--build-arg VERSION=$(VERSION) \
89-
-f versions/$(VERSION)/Dockerfile.client \
86+
-f dockerfiles/Dockerfile.client \
9087
.
9188

9289
mkdir -p release/$(TAG)
@@ -108,18 +105,14 @@ deb: $(addsuffix -deb, $(BUILD_ARCHS))
108105
# Development Helpers
109106

110107
tmp-env:
111-
mkdir -p "tmp/$(VERSION)"
112-
cd "tmp/$(VERSION)" && ../../versions/$(VERSION)/clone.bash
113-
cd "tmp/$(VERSION)" && ../../scripts/apply-patches.bash ../../versions/$(VERSION)/server/*.patch
114-
cd "tmp/$(VERSION)" && ../../scripts/strip-cargo.bash
115-
cd "tmp/$(VERSION)" && ../../scripts/resolve-dependencies.bash
116-
117-
tmp-env-client:
118-
mkdir -p "tmp/$(VERSION)-client"
119-
cd "tmp/$(VERSION)-client" && ../../versions/$(VERSION)/clone.bash
120-
cd "tmp/$(VERSION)-client" && ../../scripts/apply-patches.bash ../../versions/$(VERSION)/server/*.patch ./../versions/$(VERSION)/client*/*.patch
121-
cd "tmp/$(VERSION)-client" && ../../scripts/strip-cargo.bash
122-
cd "tmp/$(VERSION)-client" && ../../scripts/resolve-dependencies.bash
108+
mkdir -p build
109+
cd build && ../../scripts/git-clone.bash ../../repos/versions
110+
cd build && ../../scripts/apply-patches.bash ../../repos/patches/
111+
cd build && ../../scripts/strip-cargo.bash
112+
cd build && ../../scripts/resolve-dependencies.bash
113+
114+
tmp-env-client: tmp-env
115+
cd build && ../../scripts/apply-patches.bash ../../repos/patches-client*/
123116

124117
tmp-docker-shell:
125118
docker build \
@@ -128,11 +121,11 @@ tmp-docker-shell:
128121
--build-arg TAG=$(TAG) \
129122
--build-arg VERSION=$(VERSION) \
130123
--target toolchain \
131-
-f versions/$(VERSION)/Dockerfile \
124+
-f dockerfiles/Dockerfile \
132125
.
133126
docker run --name=tmp-docker-shell --net=host --rm -it \
134127
-v "$(CURDIR):$(CURDIR)" \
135-
-w "$(CURDIR)/tmp/$(VERSION)" \
128+
-w "$(CURDIR)/build" \
136129
tmp-docker-shell
137130

138131
dev-run: dev-docker-build
@@ -142,19 +135,7 @@ dev-run: dev-docker-build
142135
dev-shell: dev-docker-build
143136
TAG=$(TAG)-dev docker-compose run --rm pbs bash
144137

145-
# Version management
146-
147-
fork-version:
148-
ifndef NEW_VERSION
149-
@echo "Missing 'make fork-version NEW_VERSION=...'"
150-
@exit 1
151-
endif
152-
153-
rm -rf "versions/v$(NEW_VERSION).tmp"
154-
cp -rv "versions/$(VERSION)" "versions/v$(NEW_VERSION).tmp"
155-
"versions/v$(NEW_VERSION).tmp/clone.bash" show-sha $(firstword $(NEW_SHA) $(NEW_VERSION)) > "versions/v$(NEW_VERSION).tmp/versions.tmp"
156-
mv "versions/v$(NEW_VERSION).tmp/versions.tmp" "versions/v$(NEW_VERSION).tmp/versions"
157-
mv "versions/v$(NEW_VERSION).tmp" "versions/v$(NEW_VERSION)"
138+
# Release Helpers
158139

159140
release: dockerhub client deb
160141

PROCESS.md

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,29 @@
33
## My own release procedure
44

55
```bash
6-
# Fork the build
7-
make fork-version NEW_VERSION=3.2.7 NEW_SHA=cb3d41e838dec0e1002aaf5ee4c0e6cd28284c74
6+
# Update repos to latest version
7+
# Find the sha from the https://git.proxmox.com/?p=proxmox-backup.git;a=summary
8+
scripts/update-version.bash v3.2.7 cb3d41e838dec0e1002aaf5ee4c0e6cd28284c74
89

910
# Try to naively apply patches
1011
# Fix patches until it succeeds
1112
make tmp-env
1213
make tmp-env-client
14+
make tmp-docker-shell
1315

1416
# Try to naively compile first
1517
cd tmp/v3.2.7/proxmox-backup
1618
cargo build
1719

1820
# Try to run dev build first
1921
make dev-run
22+
make dev-shell
2023

21-
# Try to compile first locally
24+
# Compile and push
2225
make amd64-docker-build
2326
make amd64-client
24-
25-
# Create release package
2627
make github-pre-release
27-
28-
# Mark the current version as latest
2928
make github-latest-release
3029
```
3130

32-
## Build on your own
33-
34-
Refer to [PROCESS.md](PROCESS.md).
35-
36-
```bash
37-
make dev-build
38-
```
39-
40-
It builds on any platform, which can be: `amd64`, `arm32v7`, `arm64v8`,
41-
etc. Wait a around 1-3h to compile.
42-
43-
Then you can push to your registry:
44-
45-
```bash
46-
make dev-push
47-
```
48-
49-
Or run locally:
50-
51-
```bash
52-
make dev-shell
53-
make dev-run
54-
```
55-
56-
You might as well pull the `*.deb` from within the image
57-
and install on Debian Bookworm.
31+
Replace `amd64` with `arm32v7` (unlikely to work) and `arm64v8`.

dockerfiles/Dockerfile

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
ARG ARCH=
2+
FROM ${ARCH}debian:bookworm AS toolchain
3+
4+
RUN apt-get -y update && \
5+
apt-get -y install \
6+
build-essential git-core \
7+
lintian pkg-config quilt patch cargo \
8+
nodejs node-colors node-commander \
9+
libudev-dev libapt-pkg-dev \
10+
libacl1-dev libpam0g-dev libfuse3-dev \
11+
libsystemd-dev uuid-dev libssl-dev \
12+
libclang-dev libjson-perl libcurl4-openssl-dev \
13+
dh-exec dh-nodejs wget
14+
15+
ENV RUSTUP_TOOLCHAIN=stable
16+
RUN wget https://static.rust-lang.org/rustup/rustup-init.sh && \
17+
chmod +x rustup-init.sh && \
18+
./rustup-init.sh -y --default-toolchain "$RUSTUP_TOOLCHAIN"
19+
20+
WORKDIR /src
21+
22+
RUN for tool in /root/.cargo/bin/*; do ln -vsf $tool /usr/bin/; done
23+
RUN /usr/bin/rustc --version
24+
RUN git config --global user.email "[email protected]" && \
25+
git config --global user.name "Docker Compile"
26+
27+
FROM toolchain as builder
28+
29+
# Clone all sources
30+
ADD /scripts/ /scripts/
31+
ADD /repos/versions /repos/
32+
RUN /scripts/git-clone.bash /repos/versions
33+
34+
# Apply all patches
35+
ADD /repos/patches/ /repos/patches/
36+
RUN /scripts/apply-patches.bash /repos/patches/
37+
RUN /scripts/strip-cargo.bash
38+
RUN /scripts/resolve-dependencies.bash
39+
40+
# A first required dep
41+
RUN apt-get -y build-dep $PWD/pve-eslint
42+
RUN make -C pve-eslint dinstall
43+
44+
# A proxmox-perl-rs required deps
45+
RUN apt-get -y build-dep $PWD/perlmod/perlmod $PWD/perlmod/perlmod-bin $PWD/perlmod/perlmod-macro
46+
RUN cd perlmod/perlmod-bin && dpkg-buildpackage -us -uc -b && dpkg -i ../perlmod-bin*.deb
47+
48+
# A pve-common required deps
49+
RUN apt-get -y build-dep $PWD/proxmox-perl-rs/pve-rs
50+
RUN make -C proxmox-perl-rs/common/pkg deb install
51+
RUN make -C proxmox-perl-rs/pve-rs deb
52+
RUN dpkg -i proxmox-perl-rs/common/pkg/*.deb proxmox-perl-rs/pve-rs/*.deb
53+
RUN apt-get -y build-dep $PWD/pve-common
54+
RUN make -C pve-common dinstall || apt-get -f -y install && make -C pve-common dinstall
55+
56+
# Install dev dependencies of widget toolkit
57+
RUN apt-get -y build-dep $PWD/proxmox-widget-toolkit
58+
RUN cd proxmox-widget-toolkit/ && make deb && dpkg -i proxmox-widget-toolkit-dev*.deb
59+
60+
# Deps for all rest
61+
RUN apt-get -y build-dep $PWD/proxmox-acme
62+
RUN apt-get -y build-dep $PWD/proxmox-backup
63+
RUN apt-get -y build-dep $PWD/proxmox-mini-journalreader
64+
RUN apt-get -y build-dep $PWD/extjs
65+
RUN apt-get -y build-dep $PWD/proxmox-i18n
66+
RUN apt-get -y build-dep $PWD/pve-xtermjs/termproxy
67+
RUN apt-get -y build-dep $PWD/pve-xtermjs/xterm.js
68+
RUN apt-get -y build-dep $PWD/libjs-qrcodejs
69+
70+
# Compile ALL
71+
RUN make -C proxmox-backup deb
72+
RUN make -C extjs deb
73+
RUN make -C proxmox-i18n deb
74+
RUN make -C pve-xtermjs/termproxy deb
75+
RUN make -C pve-xtermjs/xterm.js deb
76+
RUN make -C proxmox-mini-journalreader deb
77+
RUN make -C libjs-qrcodejs deb
78+
RUN make -C proxmox-acme deb
79+
80+
# Copy all debian packages
81+
RUN mkdir -p /deb && \
82+
find /src/ -name '*.deb' -exec cp -av {} /deb/ \;
83+
84+
#=================================
85+
86+
FROM ${ARCH}debian:bookworm
87+
COPY --from=builder /deb/ /deb/
88+
RUN mkdir -p /deb/static && \
89+
mv /deb/proxmox-backup-client-static*.deb /deb/static/
90+
91+
# Install all packages
92+
RUN export DEBIAN_FRONTEND=noninteractive && \
93+
apt-get -y update && \
94+
apt install -y runit ssmtp cron /deb/*.deb
95+
96+
# Add default configs
97+
ADD /dockerfiles/pbs/ /etc/proxmox-backup-default/
98+
99+
VOLUME /etc/proxmox-backup
100+
VOLUME /var/log/proxmox-backup
101+
VOLUME /var/lib/proxmox-backup
102+
103+
ADD /dockerfiles/runit/ /runit/
104+
CMD ["runsvdir", "/runit"]

dockerfiles/Dockerfile.client

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
ARG DOCKER_ARCH
2+
FROM ${DOCKER_ARCH}/debian:bookworm AS builder
3+
4+
RUN apt-get -y update && \
5+
apt-get -y install \
6+
build-essential git-core \
7+
lintian pkg-config quilt patch cargo \
8+
nodejs node-colors node-commander \
9+
libudev-dev libapt-pkg-dev \
10+
libacl1-dev libpam0g-dev libfuse3-dev \
11+
libsystemd-dev uuid-dev libssl-dev \
12+
libclang-dev libjson-perl libcurl4-openssl-dev \
13+
dh-exec wget
14+
15+
WORKDIR /src
16+
17+
RUN /usr/bin/rustc --version
18+
RUN git config --global user.email "[email protected]" && \
19+
git config --global user.name "Docker Compile"
20+
21+
# Clone all sources
22+
ADD /scripts/ /scripts/
23+
ADD /repos/versions /repos/
24+
RUN /scripts/git-clone.bash /repos/versions
25+
26+
# Install valid rust toolchain
27+
ARG DOCKER_ARCH
28+
RUN \
29+
if [ "${DOCKER_ARCH}" != "arm32v7" ]; then \
30+
wget https://static.rust-lang.org/rustup/rustup-init.sh && \
31+
chmod +x rustup-init.sh && \
32+
./rustup-init.sh -y --default-toolchain nightly && \
33+
for tool in /root/.cargo/bin/*; do ln -vsf $tool /usr/bin/; done; \
34+
fi
35+
36+
# Apply all patches
37+
ADD /repos/patches/ /repos/patches/
38+
RUN /scripts/apply-patches.bash /repos/patches/
39+
RUN /scripts/strip-cargo.bash
40+
RUN /scripts/resolve-dependencies.bash
41+
42+
# Build
43+
RUN make -C proxmox-backup proxmox-backup-client-static BUILD_MODE=release COMPILEDIR=target/static/release
44+
45+
# Bundle client
46+
RUN /scripts/bundle-client.bash
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)