Skip to content

Commit

Permalink
add Coverage41C
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed Sep 29, 2024
1 parent b1e71b6 commit 0137c73
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 3 deletions.
1 change: 1 addition & 0 deletions .onec.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export ONEC_USERNAME=onec
export ONEC_PASSWORD=onec
export ONEC_VERSION=8.3.18.1520
export EDT_VERSION=2021.2.7
export COVERAGE41C_VERSION=''

export DOCKER_REGISTRY_URL=docker-registry:5000
export DOCKER_LOGIN=login
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- [oscript](#oscript)
- [vanessa-runner](#vanessa-runner)
- [EDT](#edt)

# Использование

В терминале введите:
Expand All @@ -47,6 +47,8 @@ copy .onec.env.bat.example env.bat
* ONEC_PASSWORD - пароль для учётной записи на http://releases.1c.ru
* ONEC_VERSION - версия платформы 1С:Преприятия 8.3, которая будет в образе
* DOCKER_REGISTRY_URL - Адрес Docker-registry в котором будут храниться образы
* COVERAGE41C_VERSION - версия Coverage41C
Если заполнено, то при выполнении скриптов `build-base-*-agent.*` будут также собраны образы `base-*-coverage-agent`. В них будет установлена Coverage41C указанной версии, а также добавлены *.jar-файлы EDT для сбора замеров покрытия.

Затем экспортируйте все необходимые переменные:

Expand All @@ -68,7 +70,9 @@ env.bat
* build-base-swarm-jenkins-agent.sh
* build-edt-swarm-agent.sh
* build-oscript-swarm-agent.sh

2. Если же вы планируете использовать k8s

* build-base-k8s-jenkins-agent.sh
* build-edt-k8s-agent.sh
* build-oscript-k8s-agent.sh
Expand All @@ -81,7 +85,7 @@ env.bat

- взять ваш файл nethasp.ini
- создать из него docker config командой `docker config create nethasp.ini ./nethasp.ini`
- в Jenkins, в настройках Docker Agent templates у соответствующих агентов в параметре Configs указать `nethasp.ini:/opt/1cv8/current/conf/nethasp.ini`
- в Jenkins, в настройках Docker Agent templates у соответствующих агентов в параметре Configs указать `nethasp.ini:/opt/1cv8/current/conf/nethasp.ini`

## Сервер
[(Наверх)](#Оглавление)
Expand Down
19 changes: 19 additions & 0 deletions build-base-k8s-jenkins-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ if [ $NO_CACHE = 'true' ] ; then
last_arg='--no-cache .'
fi

# если устанавливаем Coverage41C, то предварительно нужно собрать образы EDT
if [[ $COVERAGE41C_VERSION != "" ]] ; then
./build-edt-swarm-agent.sh
fi

docker build \
--pull \
$no_cache_arg \
Expand Down Expand Up @@ -81,3 +86,17 @@ docker build \
$last_arg

docker push $DOCKER_REGISTRY_URL/base-jenkins-agent:$ONEC_VERSION

if [[ $COVERAGE41C_VERSION != "" ]] ; then
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
fi
21 changes: 20 additions & 1 deletion build-base-swarm-jenkins-agent.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ if %ERRORLEVEL% neq 0 goto end

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

# если устанавливаем Coverage41C, то предварительно нужно собрать образы EDT
if %COVERAGE41C_VERSION% neq "" (.\build-edt-swarm-agent.bat)

docker build ^
--pull ^
Expand Down Expand Up @@ -99,5 +101,22 @@ docker push %DOCKER_REGISTRY_URL%/base-jenkins-agent:%ONEC_VERSION%

if %ERRORLEVEL% neq 0 goto end

if %COVERAGE41C_VERSION% neq "" (

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%

)

:end
echo End of program.
echo End of program.
19 changes: 19 additions & 0 deletions build-base-swarm-jenkins-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ if [ $NO_CACHE = 'true' ] ; then
last_arg='--no-cache .'
fi

# если устанавливаем Coverage41C, то предварительно нужно собрать образы EDT
if [[ $COVERAGE41C_VERSION != "" ]] ; then
./build-edt-swarm-agent.sh
fi

docker build \
--pull \
$no_cache_arg \
Expand Down Expand Up @@ -81,3 +86,17 @@ docker build \
$last_arg

docker push $DOCKER_REGISTRY_URL/base-jenkins-agent:$ONEC_VERSION

if [[ $COVERAGE41C_VERSION != "" ]] ; then
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
fi
25 changes: 25 additions & 0 deletions coverage41C/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG DOCKER_REGISTRY_URL=library
ARG BASE_IMAGE=edt
ARG BASE_TAG
ARG EDT_VERSION=2021.3
ARG COVERAGE41C_VERSION=2.7.2
ARG EDT_PLUGINS=/opt/1C/1CE/components/1c-edt-${EDT_VERSION}*-x86_64/plugins

FROM ${DOCKER_REGISTRY_URL}/edt:${EDT_VERSION} as base

FROM ${DOCKER_REGISTRY_URL}/${BASE_IMAGE}:${BASE_TAG}
LABEL maintainer="Dima Ovcharenko <[email protected]>, Korus Consulting LLC"

ARG COVERAGE41C_VERSION
ARG EDT_PLUGINS

COPY --from=base ${EDT_PLUGINS}/com._1c.g5.v8.dt.debug.core_*.jar ${EDT_PLUGINS}/com._1c.g5.v8.dt.debug.model_*.jar /opt/1C/1CE/

ADD https://github.com/1c-syntax/Coverage41C/releases/download/v${COVERAGE41C_VERSION}/Coverage41C-${COVERAGE41C_VERSION}.tar \
/opt/

RUN tar xf /opt/Coverage41C-${COVERAGE41C_VERSION}.tar -C /opt/ \
&& rm -rf /opt/Coverage41C-${COVERAGE41C_VERSION}.tar

ENV EDT_LOCATION="/opt/1C/1CE/"
ENV PATH="/opt/Coverage41C-${COVERAGE41C_VERSION}/bin:$PATH"

0 comments on commit 0137c73

Please sign in to comment.