Skip to content
Open
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
44 changes: 44 additions & 0 deletions build/scripts/build-pmm-local
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

set -euo pipefail

GIT_BRANCH="${GIT_BRANCH:-v3}"
WORKSPACE="${WORKSPACE:-$(pwd)/pmm-build-workspace}"
SCRIPTS="${WORKSPACE}/sources/pmm/src/github.com/percona/pmm/build/scripts"
export DOCKER_TAG="${DOCKER_TAG:-pmm-server:local}"
export DOCKERFILE="Dockerfile.el9"
export ROOT_DIR="${WORKSPACE}" # override the build scripts relative-path-walking
export FORCE_REBUILD=1 # skip the public S3 build cache lookup

if [ ! -d "${WORKSPACE}/.git" ]; then
echo "Cloning pmm-submodules (${GIT_BRANCH}) into ${WORKSPACE}"
git clone --branch "${GIT_BRANCH}" https://github.com/Percona-Lab/pmm-submodules "${WORKSPACE}"
fi

cd "${WORKSPACE}"

echo "Initializing submodules"
git submodule update --init --jobs 10

echo "[1/6] Building pmm-client source tarball"
"${SCRIPTS}/build-client-source"

echo "[2/6] Building pmm-client binary tarball"
"${SCRIPTS}/build-client-binary"

echo "[3/6] Building pmm-client source RPM"
"${SCRIPTS}/build-client-srpm"

echo "[4/6] Building pmm-client binary RPM"
"${SCRIPTS}/build-client-rpm"
mkdir -p "${WORKSPACE}/tmp/pmm-server/RPMS"
cp "${WORKSPACE}/results/rpm/"pmm*-client-*.rpm "${WORKSPACE}/tmp/pmm-server/RPMS/"

echo "[5/6] Building server component RPMs"
"${SCRIPTS}/build-server-rpm-all"

echo "[6/6] Building pmm-server Docker image: ${DOCKER_TAG}"
"${SCRIPTS}/build-server-docker"

echo
echo "Image: ${DOCKER_TAG}"
Loading