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
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tmp/
build/
release/
**/Dockerfile
**/Dockerfile.client
dockerfiles/Dockerfile*
.env.mk
8 changes: 4 additions & 4 deletions .github/workflows/build_pre_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
strategy:
matrix:
include:
- runs_on: [self-hosted, Linux, ARM64]
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
- runs_on: ubuntu-latest
- runs_on: ubuntu-24.04
docker_arch: amd64
steps:
- name: Checkout
Expand All @@ -60,9 +60,9 @@ jobs:
strategy:
matrix:
include:
- runs_on: [self-hosted, Linux, ARM64]
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
- runs_on: ubuntu-latest
- runs_on: ubuntu-24.04
docker_arch: amd64
steps:
- name: Checkout
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:
docker-build:
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- runs_on: [self-hosted, Linux, ARM64]
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
- runs_on: ubuntu-latest
- runs_on: ubuntu-24.04
docker_arch: amd64
steps:
- name: Checkout
Expand Down Expand Up @@ -57,11 +58,12 @@ jobs:
client-build:
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- runs_on: [self-hosted, Linux, ARM64]
- runs_on: ubuntu-24.04-arm
docker_arch: arm64v8
- runs_on: ubuntu-latest
- runs_on: ubuntu-24.04
docker_arch: amd64
steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
docker-compose.override.yml
tmp/
proxmox-backup-client*.tgz
/.env.mk
/tmp/
/build/
/release/
43 changes: 0 additions & 43 deletions .gitlab-ci.yml

This file was deleted.

47 changes: 14 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ BUILD_ARCHS = amd64 arm64v8
CLIENT_BUILD_ARCHS = amd64 arm64v8
REGISTRY ?= ayufan/proxmox-backup-server
SHELL = /usr/bin/env bash

ifeq (,$(VERSION))
VERSION := $(shell ls versions | grep -E -v '.(tmp|debug)' | sort -V | tail -n 1)
endif
include repos/version.mk

ifeq (,$(TAG))
TAG := $(VERSION)
Expand Down Expand Up @@ -40,7 +37,7 @@ dev-%:
--build-arg ARCH=$(addsuffix /,$(DOCKER_ARCH)) \
--build-arg TAG=$(TAG) \
--build-arg VERSION=$(VERSION) \
-f versions/$(VERSION)/Dockerfile \
-f dockerfiles/Dockerfile \
.

docker-build: $(addsuffix -docker-build, $(BUILD_ARCHS))
Expand Down Expand Up @@ -86,7 +83,7 @@ dockerhub-latest-release: $(addsuffix -dockerhub-latest-release, $(BUILD_ARCHS))
--build-arg DOCKER_ARCH=$(DOCKER_ARCH) \
--build-arg TAG=$(TAG) \
--build-arg VERSION=$(VERSION) \
-f versions/$(VERSION)/Dockerfile.client \
-f dockerfiles/Dockerfile.client \
.

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

tmp-env:
mkdir -p "tmp/$(VERSION)"
cd "tmp/$(VERSION)" && ../../versions/$(VERSION)/clone.bash
cd "tmp/$(VERSION)" && ../../scripts/apply-patches.bash ../../versions/$(VERSION)/server/*.patch
cd "tmp/$(VERSION)" && ../../scripts/strip-cargo.bash
cd "tmp/$(VERSION)" && ../../scripts/resolve-dependencies.bash

tmp-env-client:
mkdir -p "tmp/$(VERSION)-client"
cd "tmp/$(VERSION)-client" && ../../versions/$(VERSION)/clone.bash
cd "tmp/$(VERSION)-client" && ../../scripts/apply-patches.bash ../../versions/$(VERSION)/server/*.patch ./../versions/$(VERSION)/client*/*.patch
cd "tmp/$(VERSION)-client" && ../../scripts/strip-cargo.bash
cd "tmp/$(VERSION)-client" && ../../scripts/resolve-dependencies.bash
mkdir -p build
cd build && ../../scripts/git-clone.bash ../../repos/versions
cd build && ../../scripts/apply-patches.bash ../../repos/patches/
cd build && ../../scripts/strip-cargo.bash
cd build && ../../scripts/resolve-dependencies.bash

tmp-env-client: tmp-env
cd build && ../../scripts/apply-patches.bash ../../repos/patches-client*/

tmp-docker-shell:
docker build \
Expand All @@ -128,11 +121,11 @@ tmp-docker-shell:
--build-arg TAG=$(TAG) \
--build-arg VERSION=$(VERSION) \
--target toolchain \
-f versions/$(VERSION)/Dockerfile \
-f dockerfiles/Dockerfile \
.
docker run --name=tmp-docker-shell --net=host --rm -it \
-v "$(CURDIR):$(CURDIR)" \
-w "$(CURDIR)/tmp/$(VERSION)" \
-w "$(CURDIR)/build" \
tmp-docker-shell

dev-run: dev-docker-build
Expand All @@ -142,19 +135,7 @@ dev-run: dev-docker-build
dev-shell: dev-docker-build
TAG=$(TAG)-dev docker-compose run --rm pbs bash

# Version management

fork-version:
ifndef NEW_VERSION
@echo "Missing 'make fork-version NEW_VERSION=...'"
@exit 1
endif

rm -rf "versions/v$(NEW_VERSION).tmp"
cp -rv "versions/$(VERSION)" "versions/v$(NEW_VERSION).tmp"
"versions/v$(NEW_VERSION).tmp/clone.bash" show-sha $(firstword $(NEW_SHA) $(NEW_VERSION)) > "versions/v$(NEW_VERSION).tmp/versions.tmp"
mv "versions/v$(NEW_VERSION).tmp/versions.tmp" "versions/v$(NEW_VERSION).tmp/versions"
mv "versions/v$(NEW_VERSION).tmp" "versions/v$(NEW_VERSION)"
# Release Helpers

release: dockerhub client deb

Expand Down
40 changes: 7 additions & 33 deletions PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,29 @@
## My own release procedure

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

# Try to naively apply patches
# Fix patches until it succeeds
make tmp-env
make tmp-env-client
make tmp-docker-shell

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

# Try to run dev build first
make dev-run
make dev-shell

# Try to compile first locally
# Compile and push
make amd64-docker-build
make amd64-client

# Create release package
make github-pre-release

# Mark the current version as latest
make github-latest-release
```

## Build on your own

Refer to [PROCESS.md](PROCESS.md).

```bash
make dev-build
```

It builds on any platform, which can be: `amd64`, `arm32v7`, `arm64v8`,
etc. Wait a around 1-3h to compile.

Then you can push to your registry:

```bash
make dev-push
```

Or run locally:

```bash
make dev-shell
make dev-run
```

You might as well pull the `*.deb` from within the image
and install on Debian Bookworm.
Replace `amd64` with `arm32v7` (unlikely to work) and `arm64v8`.
4 changes: 0 additions & 4 deletions dev-scripts/clean-storage

This file was deleted.

15 changes: 0 additions & 15 deletions dev-scripts/clone-version

This file was deleted.

22 changes: 0 additions & 22 deletions dev-scripts/deploy-test

This file was deleted.

9 changes: 0 additions & 9 deletions dev-scripts/netem

This file was deleted.

46 changes: 0 additions & 46 deletions dev-scripts/run-test

This file was deleted.

Loading