Install standalone docker-compose binary in Jenkins pipeline
Static docker CLI does not include compose v2; download docker-compose alongside docker for compose config smoke tests.
This commit is contained in:
parent
368070e3ba
commit
2ed6c611cb
1 changed files with 14 additions and 4 deletions
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
|
|
@ -25,17 +25,27 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
mkdir -p .ci-bin
|
||||||
if ! command -v docker >/dev/null 2>&1; then
|
if ! command -v docker >/dev/null 2>&1; then
|
||||||
echo "Installing static docker CLI (Jenkins image has socket, not binary)..."
|
echo "Installing static docker CLI..."
|
||||||
mkdir -p .ci-bin
|
|
||||||
curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-27.4.1.tgz" \
|
curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-27.4.1.tgz" \
|
||||||
| tar xz --strip-components=1 -C .ci-bin docker/docker
|
| tar xz --strip-components=1 -C .ci-bin docker/docker
|
||||||
chmod +x .ci-bin/docker
|
chmod +x .ci-bin/docker
|
||||||
export PATH="$PWD/.ci-bin:$PATH"
|
fi
|
||||||
|
if ! command -v docker-compose >/dev/null 2>&1 && ! docker compose version >/dev/null 2>&1; then
|
||||||
|
echo "Installing docker-compose plugin binary..."
|
||||||
|
curl -fsSL "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64" \
|
||||||
|
-o .ci-bin/docker-compose
|
||||||
|
chmod +x .ci-bin/docker-compose
|
||||||
|
fi
|
||||||
|
export PATH="$PWD/.ci-bin:$PATH"
|
||||||
|
COMPOSE="docker compose"
|
||||||
|
if ! docker compose version >/dev/null 2>&1; then
|
||||||
|
COMPOSE="docker-compose"
|
||||||
fi
|
fi
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
||||||
docker compose -f dist/docker-compose.coolify.yml config -q
|
$COMPOSE -f dist/docker-compose.coolify.yml config -q
|
||||||
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
||||||
docker pull "frappe/erpnext:${VERSION}"
|
docker pull "frappe/erpnext:${VERSION}"
|
||||||
echo "frappe/erpnext:${VERSION} OK"
|
echo "frappe/erpnext:${VERSION} OK"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue