Compare commits

...

5 Commits

Author SHA1 Message Date
5944805d27 refactor: 💡 Added TODO comment to fix alpine image, still not working doing that later
All checks were successful
andreas-personal/jenkins-ssh-docker-agent/pipeline/head This commit looks good
2025-06-06 05:40:52 +02:00
355dcb3816 fix: 💚 Maybe Fix Alpine now ???
All checks were successful
andreas-personal/jenkins-ssh-docker-agent/pipeline/head This commit looks good
2025-06-06 05:33:36 +02:00
16f4ca20a1 fix: 💚 Maybe Fix alpine image
All checks were successful
andreas-personal/jenkins-ssh-docker-agent/pipeline/head This commit looks good
2025-06-06 05:27:43 +02:00
5c7e43445a fix: 💚 Add Java to path for SSH Sessions ? maybe fix agent
Some checks failed
andreas-personal/jenkins-ssh-docker-agent/pipeline/head There was a failure building this commit
2025-06-06 05:12:04 +02:00
5f367cc3aa feat: 👷 Use local gitea package registry
Some checks failed
andreas-personal/jenkins-ssh-docker-agent/pipeline/head There was a failure building this commit
2025-06-06 04:09:23 +02:00
2 changed files with 26 additions and 2 deletions

19
Jenkinsfile vendored
View File

@ -11,13 +11,18 @@ pipeline {
beforeAgent true;
branch 'main'
}
environment {
def tag = sh(returnStdout: true, script: 'git rev-parse --short=10 HEAD').trim()
}
stages {
stage('Login') {
environment {
DOCKER_HUB_CREDENTIALS = credentials('docker-hub-fah16145')
PACKAGE_REGISTRY_CREDENTIALS = credentials('gitea-package-registry-jenkins-user')
}
steps {
sh 'docker login -u ${DOCKER_HUB_CREDENTIALS_USR} -p ${DOCKER_HUB_CREDENTIALS_PSW}'
sh 'docker login -u ${PACKAGE_REGISTRY_CREDENTIALS_USR} -p ${PACKAGE_REGISTRY_CREDENTIALS_PSW} gitea.fahrecker.com'
}
}
stage('Build & Push') {
@ -26,12 +31,17 @@ pipeline {
stages {
stage('Build Default Image') {
steps {
sh 'docker build -t fah16145/jenkins-ssh-docker-agent:latest .'
sh '''docker build \
-t fah16145/jenkins-ssh-docker-agent:latest \
-t gitea.fahrecker.com/andreas-personal/jenkins-ssh-docker-agent:latest \
.
'''
}
}
stage('Push Default Image') {
steps {
sh 'docker push fah16145/jenkins-ssh-docker-agent:latest'
sh 'docker push gitea.fahrecker.com/andreas-personal/jenkins-ssh-docker-agent:latest'
}
}
}
@ -40,12 +50,17 @@ pipeline {
stages {
stage('Build Alpine Image') {
steps {
sh 'docker build -t fah16145/jenkins-ssh-docker-agent:alpine alpine/'
sh '''docker build \
-t fah16145/jenkins-ssh-docker-agent:alpine \
-t gitea.fahrecker.com/andreas-personal/jenkins-ssh-docker-agent:alpine \
alpine/
'''
}
}
stage('Push Alpine Image') {
steps {
sh 'docker push fah16145/jenkins-ssh-docker-agent:alpine'
sh 'docker push gitea.fahrecker.com/andreas-personal/jenkins-ssh-docker-agent:alpine'
}
}
}

View File

@ -14,3 +14,12 @@ RUN apk add --no-cache openssl
#Install git lfs
RUN apk add --no-cache git-lfs
RUN git lfs install --system
# TODO: doesnt work still, something about not finding the java binary over ssh
# Configure SSH to behave more like Debian - load environment properly
#RUN echo 'PermitUserEnvironment yes' >> /etc/ssh/sshd_config
#RUN echo 'UsePAM yes' >> /etc/ssh/sshd_config
# Add Java to environment file that SSH will read
#RUN echo 'PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' >> /etc/environment