[DEV] add basic version
All checks were successful
WEB karideo and rabbit/docker-builder/pipeline/head This commit looks good

This commit is contained in:
Edouard DUPIN 2023-01-10 22:08:15 +01:00
parent 03ef2f2bbc
commit f097b58480
2 changed files with 104 additions and 0 deletions

57
.jenkinsfile Normal file
View File

@ -0,0 +1,57 @@
pipeline {
agent any
options {
timeout(time: 30, unit: 'MINUTES')
disableConcurrentBuilds abortPrevious: true
}
triggers {
cron(env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'develop' ? '0 9 * * *' : '')
}
environment {
REGISTRY_ADDRESS = "gitea.atria-soft.org"
REGISTRY_ADDRESS_FULL = "https://${REGISTRY_ADDRESS}"
REPOSITORY_BASE_NAME = 'kangaroo-and-rabbit/docker-builder'
TAG_DOCKER = getEnvName(env.BRANCH_NAME)
DOCKER_IMAGE_NAME_AND_TAG = "kangaroo-and-rabbit/archlinux-builder:${TAG_DOCKER}"
}
stages {
stage('save-evironment') {
steps {
sh 'ls -la'
sh 'pwd'
sh 'uname -a'
sh 'printenv | sort'
sh 'git log -n 20'
sh 'javac --version'
}
}
stage('(prod) Build') {
steps {
sh 'docker build -t ${DOCKER_IMAGE_NAME_AND_TAG} .'
}
}
stage('(prod) Push on registry') {
when {
expression {
return env.TAG_DOCKER != 'other';
}
}
steps {
script {
docker.withRegistry(env.REGISTRY_ADDRESS_FULL, 'jenkins_auth_registry') {
docker.image(env.DOCKER_IMAGE_NAME_AND_TAG).push();
}
}
}
}
}
}
def getEnvName(branchName) {
if("master".equals(branchName)) {
return "latest";
} else if("dev".equals(branchName)) {
return "dev";
}
return "other";
}

47
Dockerfile Normal file
View File

@ -0,0 +1,47 @@
FROM archlinux:latest
USER root
# update system
RUN pacman -Syu --noconfirm \
&& \
pacman-db-upgrade \
&& \
pacman -S --noconfirm \
jdk-openjdk \
maven \
npm \
gcc \
clang \
make \
python \
python-pip \
php \
git \
&& \
pacman -Scc --noconfirm
RUN pip install \
island \
lutin \
flake8 \
flake8-annotations \
flake8-blind-except \
flake8-bugbear \
flake8-builtins \
flake8-comprehensions \
flake8-deprecated==1.3 \
flake8-executable \
flake8-isort \
flake8-use-fstring \
black \
isort \
mypy \
docker-compose \
docker
ENV PATH /tmp/node_modules/.bin:$PATH
WORKDIR /workspace/
CMD ["/usr/bin/sleep", "5121512"]