Skip to content

Commit

Permalink
fix edt scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed Nov 14, 2024
1 parent d016935 commit 27011bd
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
24 changes: 24 additions & 0 deletions build-edt-k8s-agent.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
#!/usr/bin/env bash
set -eo pipefail

if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

edt_version=$EDT_VERSION
edt_escaped="${edt_version// /_}"

./build-edt.sh

docker build \
Expand Down
13 changes: 13 additions & 0 deletions build-edt-swarm-agent.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
@echo off

docker login -u %DOCKER_LOGIN% -p %DOCKER_PASSWORD% %DOCKER_REGISTRY_URL%

if %ERRORLEVEL% neq 0 goto end

if %DOCKER_SYSTEM_PRUNE%=="true" docker system prune -af

if %ERRORLEVEL% neq 0 goto end

if %NO_CACHE%=="true" (SET last_arg="--no-cache .") else (SET last_arg=".")

set edt_version=%EDT_VERSION%
set edt_escaped=%edt_version: =_%

.\build-edt.bat

docker build ^
Expand Down
23 changes: 23 additions & 0 deletions build-edt-swarm-agent.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
#!/usr/bin/env bash
set -eo pipefail

if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

edt_version=$EDT_VERSION
edt_escaped="${edt_version// /_}"

./build-edt.sh

Expand Down

0 comments on commit 27011bd

Please sign in to comment.