forked from jugatsu/onec-docker
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77f110c
commit d016935
Showing
12 changed files
with
219 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/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 | ||
|
||
./build-edt.sh | ||
./build-base-k8s-jenkins-agent.sh "do_not_push_agent" | ||
|
||
docker build \ | ||
--build-arg DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \ | ||
--build-arg BASE_IMAGE=base-jenkins-agent \ | ||
--build-arg BASE_TAG=$ONEC_VERSION \ | ||
--build-arg EDT_VERSION=$EDT_VERSION \ | ||
--build-arg COVERAGE41C_VERSION=$COVERAGE41C_VERSION \ | ||
-t $DOCKER_REGISTRY_URL/base-jenkins-coverage-agent:$ONEC_VERSION \ | ||
-f coverage41C/Dockerfile \ | ||
$last_arg | ||
|
||
docker push $DOCKER_REGISTRY_URL/base-jenkins-coverage-agent:$ONEC_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@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=".") | ||
|
||
.\build-edt-swarm-agent.bat | ||
.\build-base-swarm-jenkins-agent.bat "do_not_push_agent" | ||
|
||
docker build ^ | ||
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^ | ||
--build-arg BASE_IMAGE=base-jenkins-agent ^ | ||
--build-arg BASE_TAG=%ONEC_VERSION% ^ | ||
--build-arg EDT_VERSION=%EDT_VERSION% ^ | ||
--build-arg COVERAGE41C_VERSION=%COVERAGE41C_VERSION% ^ | ||
-t %DOCKER_REGISTRY_URL%/base-jenkins-coverage-agent:%ONEC_VERSION% ^ | ||
-f coverage41C/Dockerfile ^ | ||
%last_arg% | ||
|
||
docker push %DOCKER_REGISTRY_URL%/base-jenkins-coverage-agent:%ONEC_VERSION% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/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 | ||
|
||
./build-edt.sh | ||
./build-base-swarm-jenkins-agent.sh "do_not_push_agent" | ||
|
||
docker build \ | ||
--build-arg DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \ | ||
--build-arg BASE_IMAGE=base-jenkins-agent \ | ||
--build-arg BASE_TAG=$ONEC_VERSION \ | ||
--build-arg EDT_VERSION=$EDT_VERSION \ | ||
--build-arg COVERAGE41C_VERSION=$COVERAGE41C_VERSION \ | ||
-t $DOCKER_REGISTRY_URL/base-jenkins-coverage-agent:$ONEC_VERSION \ | ||
-f coverage41C/Dockerfile \ | ||
$last_arg | ||
|
||
docker push $DOCKER_REGISTRY_URL/base-jenkins-coverage-agent:$ONEC_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.