Compare commits

..

No commits in common. "f58dc78f4e1232d7d203573b0122728a24864557" and "c7bd2d6cc6ec6907c8dadc076c9dc37ea048fbbd" have entirely different histories.

3 changed files with 30 additions and 33 deletions

View File

@ -5,8 +5,7 @@ RUN groupadd -g 281 docker
RUN usermod -aG docker jenkins RUN usermod -aG docker jenkins
# Install tea # Install tea
RUN git clone https://gitea.com/gitea/tea.git RUN apk add --no-cache tea
RUN cd tea && make && make install
COPY --chown=jenkins:jenkins executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy COPY --chown=jenkins:jenkins executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy

19
Jenkinsfile vendored
View File

@ -1,9 +1,7 @@
#!groovy #!groovy
pipeline { pipeline {
agent { agent none
label 'linux'
}
stages { stages {
stage('Build/Push Docker Image') { stage('Build/Push Docker Image') {
@ -11,6 +9,9 @@ pipeline {
beforeAgent true; beforeAgent true;
branch 'main' branch 'main'
} }
agent {
label 'linux'
}
environment { environment {
DOCKER_HUB_CREDENTIALS = credentials('docker-hub-fah16145') DOCKER_HUB_CREDENTIALS = credentials('docker-hub-fah16145')
} }
@ -20,16 +21,14 @@ pipeline {
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('Build & Push') {
parallel {
stage('Default Image') { stage('Default Image') {
stages { stages {
stage('Build Default Image') { stage('Build') {
steps { steps {
sh 'docker build -t fah16145/good-old-jenkins:latest .' sh 'docker build -t fah16145/good-old-jenkins:latest .'
} }
} }
stage('Push Default Image') { stage('Push') {
steps { steps {
sh 'docker push fah16145/good-old-jenkins:latest' sh 'docker push fah16145/good-old-jenkins:latest'
} }
@ -38,12 +37,12 @@ pipeline {
} }
stage('Alpine Image') { stage('Alpine Image') {
stages { stages {
stage('Build Alpine Image') { stage('Build') {
steps { steps {
sh 'docker build -t fah16145/good-old-jenkins:alpine alpine/' sh 'docker build -t fah16145/good-old-jenkins:alpine alpine/'
} }
} }
stage('Push Alpine Image') { stage('Push') {
steps { steps {
sh 'docker push fah16145/good-old-jenkins:alpine' sh 'docker push fah16145/good-old-jenkins:alpine'
} }
@ -51,8 +50,6 @@ pipeline {
} }
} }
} }
}
}
post { post {
always { always {
sh 'docker logout' sh 'docker logout'

View File

@ -5,7 +5,8 @@ RUN addgroup --gid 281 docker
RUN addgroup jenkins docker RUN addgroup jenkins docker
# Install tea # Install tea
RUN apk add --no-cache tea RUN git clone https://gitea.com/gitea/tea.git
RUN cd tea && make && make install
COPY --chown=jenkins:jenkins executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy COPY --chown=jenkins:jenkins executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy