Skip to content

Commit ea2a314

Browse files
committed
Сборка докер-образа v1 на Jenkins
1 parent bd9b7e4 commit ea2a314

3 files changed

Lines changed: 62 additions & 2 deletions

File tree

docker-build.Jenkinsfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
pipeline {
2+
agent {
3+
label 'linux'
4+
}
5+
6+
environment {
7+
DOCKER_USERNAME = "nixel2007"
8+
}
9+
10+
stages {
11+
stage('Build v1') {
12+
when {
13+
anyOf {
14+
branch 'release/latest'
15+
branch 'feature/docker-build' // !DEBUG
16+
expression {
17+
return env.TAG_NAME && env.TAG_NAME.startsWith('v1.')
18+
}
19+
}
20+
}
21+
steps {
22+
script {
23+
def dockerTag = env.TAG_NAME ? env.TAG_NAME : 'latest'
24+
def imageName = "${env.DOCKER_USERNAME}/onescript:${dockerTag}"
25+
26+
docker.build(
27+
imageName,
28+
'--load -f install/builders/base-image/Dockerfile_v1 .'
29+
).push()
30+
}
31+
}
32+
}
33+
34+
stage('Build v2') {
35+
when {
36+
anyOf {
37+
branch 'develop'
38+
branch 'feature/docker-build' // !DEBUG
39+
expression {
40+
return env.TAG_NAME && env.TAG_NAME.startsWith('v2.')
41+
}
42+
}
43+
}
44+
steps {
45+
script {
46+
def dockerTag = env.TAG_NAME ? env.TAG_NAME : 'dev'
47+
def imageName = "${env.DOCKER_USERNAME}/onescript:${dockerTag}"
48+
49+
docker.build(
50+
imageName,
51+
'--load -f install/builders/base-image/Dockerfile_v2 .'
52+
).push()
53+
}
54+
}
55+
}
56+
}
57+
}

install/builders/base-image/Dockerfile_v1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ LABEL MAINTAINER="EvilBeaver <ovsiankin.aa@gmail.com>"
88
ARG VERSION=stable
99

1010
RUN curl -L https://github.com/oscript-library/ovm/releases/latest/download/ovm.exe > ovm.exe \
11-
&& mono ovm.exe use --install $VERSION
11+
&& mono ovm.exe use --install $VERSION
12+
13+
ENV OSCRIPTBIN=/root/.local/share/ovm/current/bin
14+
ENV PATH="$OSCRIPTBIN:$PATH"

install/builders/base-image/Dockerfile_v2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARG VERSION="dev"
1111
RUN mono /var/ovm/ovm.exe install --fdd ${VERSION}
1212

1313
# Основной образ
14-
FROM mcr.microsoft.com/dotnet/aspnet:6.0-jammy
14+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy
1515

1616
RUN apt-get update \
1717
&& apt-get install -y locales \

0 commit comments

Comments
 (0)