Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 54 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ pipeline {
}

stage ('Publishing night-build') {
when { anyOf {
branch 'develop';
when {
anyOf {
branch 'develop';
}
}
agent { label 'master' }
Expand All @@ -217,8 +218,9 @@ pipeline {
}

stage ('Publishing preview') {
when { anyOf {
branch 'release/preview';
when {
anyOf {
branch 'release/preview';
}
}
agent { label 'master' }
Expand Down Expand Up @@ -257,6 +259,45 @@ pipeline {
}
}
}

stage ('Publishing docker-images') {
parallel {
stage('Build v1') {
agent { label 'linux' }
when {
anyOf {
branch 'latest'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release/latest. Просто latest это аналог develop для v1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Его тогда надо в latest-dev пушить может быть? Для синхронизации с овм

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сейчас jenkinsfile просто неверный, т.к. образ latest будет собираться не при релизе, а при просто коммите в дев-ветку. Отдельно можно наверное завести тэг докера под dev-latest, но это отдельное, в данном случае, просто надо фиксануть ошибку в фильтре ветки.

expression {
return env.TAG_NAME && env.TAG_NAME.startsWith('v1.')
}
}
}
steps {
script {
def codename = env.TAG_NAME ? env.TAG_NAME : 'latest'
publishDockerImage('v1', codename)
}
}
}

stage('Build v2') {
agent { label 'linux' }
when {
anyOf {
branch 'develop'
expression {
return env.TAG_NAME && env.TAG_NAME.startsWith('v2.')
}
}
}
steps {
script {
def codename = env.TAG_NAME ? env.TAG_NAME : 'dev'
publishDockerImage('v2', codename)
}
}
}
}
}
}

Expand Down Expand Up @@ -300,3 +341,12 @@ def publishReleaseNotes(codename) {
}
}

def publishDockerImage(flavour, codename) {
def imageName = "evilbeaver/onescript:${codename}"

docker.build(
imageName,
"--load -f install/builders/base-image/Dockerfile_${flavour} ."
).push()
}

5 changes: 4 additions & 1 deletion install/builders/base-image/Dockerfile_v1
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ LABEL MAINTAINER="EvilBeaver <[email protected]>"
ARG VERSION=stable

RUN curl -L https://github.com/oscript-library/ovm/releases/latest/download/ovm.exe > ovm.exe \
&& mono ovm.exe use --install $VERSION
&& mono ovm.exe use --install $VERSION

ENV OSCRIPTBIN=/root/.local/share/ovm/current/bin
ENV PATH="$OSCRIPTBIN:$PATH"
2 changes: 1 addition & 1 deletion install/builders/base-image/Dockerfile_v2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG VERSION="dev"
RUN mono /var/ovm/ovm.exe install --fdd ${VERSION}

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

RUN apt-get update \
&& apt-get install -y locales \
Expand Down
Loading