Add tea and make docker build parallel
Some checks reported errors
andreas-personal/jenkins-ssh-docker-agent/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
Andreas Fahrecker 2024-04-16 00:42:29 +02:00
parent c8060531d6
commit 79f46c59a2
3 changed files with 47 additions and 30 deletions

View File

@ -20,6 +20,11 @@ RUN echo \
RUN apt-get update RUN apt-get update
RUN apt-get install -y docker-ce-cli RUN apt-get install -y docker-ce-cli
# Install tea
RUN apt-get install -y git make golang
RUN git clone https://gitea.com/gitea/tea.git
RUN cd tea && make && make install
# Install flutter # Install flutter
RUN apt-get update RUN apt-get update
RUN apt-get install -y\ RUN apt-get install -y\

61
Jenkinsfile vendored
View File

@ -1,7 +1,9 @@
#!groovy #!groovy
pipeline { pipeline {
agent none agent {
label 'linux'
}
stages { stages {
stage('Build/Push Docker Image') { stage('Build/Push Docker Image') {
@ -9,42 +11,43 @@ pipeline {
beforeAgent true; beforeAgent true;
branch 'main' branch 'main'
} }
agent {
label 'linux'
}
environment {
DOCKER_HUB_CREDENTIALS = credentials('docker-hub-fah16145')
}
stages { stages {
stage('Login') { stage('Login') {
environment {
DOCKER_HUB_CREDENTIALS = credentials('docker-hub-fah16145')
}
steps { steps {
sh 'docker login -u ${DOCKER_HUB_CREDENTIALS_USR} -p ${DOCKER_HUB_CREDENTIALS_PSW}' sh 'docker login -u ${DOCKER_HUB_CREDENTIALS_USR} -p ${DOCKER_HUB_CREDENTIALS_PSW}'
} }
} }
stage('Default Image') { stage('Build & Push') {
stages { parallel {
stage('Build') { stage('Default Image') {
steps { stages {
sh 'docker build -t fah16145/jenkins-ssh-docker-agent:latest .' stage('Build Default Image') {
steps {
sh 'docker build -t fah16145/jenkins-ssh-docker-agent:latest .'
}
}
stage('Push Default Image') {
steps {
sh 'docker push fah16145/jenkins-ssh-docker-agent:latest'
}
}
} }
} }
stage('Push') { stage('Alpine Image') {
steps { stages {
sh 'docker push fah16145/jenkins-ssh-docker-agent:latest' stage('Build Alpine Image') {
} steps {
} sh 'docker build -t fah16145/jenkins-ssh-docker-agent:alpine alpine/'
} }
} }
stage('Alpine Image') { stage('Push Alpine Image') {
stages { steps {
stage('Build') { sh 'docker push fah16145/jenkins-ssh-docker-agent:alpine'
steps { }
sh 'docker build -t fah16145/jenkins-ssh-docker-agent:alpine alpine/' }
}
}
stage('Push') {
steps {
sh 'docker push fah16145/jenkins-ssh-docker-agent:alpine'
} }
} }
} }

View File

@ -5,10 +5,19 @@ RUN addgroup jenkins docker
RUN apk add --no-cache docker docker-compose RUN apk add --no-cache docker docker-compose
# Install tea
RUN apk add --no-cache tea
# Install flutter # Install flutter
RUN apk add --no-cache flutter RUN apk add --no-cache ----repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing flutter
RUN flutter config --no-cli-animations RUN flutter config --no-cli-animations
RUN flutter doctor -v RUN flutter doctor -v
RUN flutter channel master RUN flutter channel master
RUN flutter upgrade RUN flutter upgrade
#Install OpenSSL
RUN apk add --no-cache openssl
#Install Node.js
RUN apk add --no-cache nodejs npm