Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 657cad2b17 | |||
| c706f2422c | |||
| d1705240c0 | |||
| 44be22e0e5 | |||
| 754bcecde6 | |||
| e9cd74051d | |||
| 389cfec1ec | |||
| 00c1e40e13 | |||
| 11909a4d12 |
@@ -0,0 +1,41 @@
|
||||
image: "docker:latest"
|
||||
|
||||
services:
|
||||
- "docker:dind"
|
||||
|
||||
before_script:
|
||||
- "docker login -u \"$CI_REGISTRY_USER\" -p \"$CI_REGISTRY_PASSWORD\" $CI_REGISTRY"
|
||||
|
||||
build-master:
|
||||
stage: "build"
|
||||
script:
|
||||
- "docker build --pull -t \"$CI_REGISTRY_IMAGE\" ."
|
||||
- "docker push \"$CI_REGISTRY_IMAGE\""
|
||||
only:
|
||||
- "master"
|
||||
tags:
|
||||
- "arm64"
|
||||
|
||||
build:
|
||||
stage: "build"
|
||||
script:
|
||||
- "docker build --pull -t \"$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG\" ."
|
||||
- "docker push \"$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG\""
|
||||
except:
|
||||
- "master"
|
||||
tags:
|
||||
- "arm64"
|
||||
|
||||
deploy-dockerhub:
|
||||
stage: "deploy"
|
||||
before_script:
|
||||
- "docker login -u \"$DOCKERHUB_USER\" -p \"$DOCKERHUB_PASSWORD\""
|
||||
- "docker login -u \"$CI_REGISTRY_USER\" -p \"$CI_REGISTRY_PASSWORD\" $CI_REGISTRY"
|
||||
script:
|
||||
- "docker pull \"$CI_REGISTRY_IMAGE\""
|
||||
- "docker tag \"$CI_REGISTRY_IMAGE\" \"$DOCKERHUB_USER/$DOCKERHUB_PROJECT\""
|
||||
- "docker push \"$DOCKERHUB_USER/$DOCKERHUB_PROJECT\""
|
||||
only:
|
||||
- "master"
|
||||
tags:
|
||||
- "arm64"
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
pipeline {
|
||||
environment {
|
||||
registry = 'https://registry.hub.docker.com'
|
||||
registryCredential = 'dockerhub_jcabillot'
|
||||
dockerImage = 'jcabillot/syncthing-arm64'
|
||||
}
|
||||
|
||||
//agent { label 'arm64' }
|
||||
agent {
|
||||
kubernetes {
|
||||
defaultContainer 'docker' // All `steps` instructions will be executed by this container
|
||||
yamlFile 'Jenkinsfile-pod-template.yml'
|
||||
}
|
||||
}
|
||||
|
||||
// Archive
|
||||
//triggers {
|
||||
// cron('@midnight')
|
||||
//}
|
||||
|
||||
stages {
|
||||
stage('Clone repository') {
|
||||
steps{
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build image') {
|
||||
steps{
|
||||
sh 'docker build --force-rm=true --no-cache=true --pull -t ${dockerImage} .'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Image') {
|
||||
steps{
|
||||
script {
|
||||
withCredentials([usernamePassword(credentialsId: 'dockerhub_jcabillot', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
|
||||
sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}'
|
||||
sh 'docker push ${dockerImage}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
jenkins: 'true'
|
||||
spec:
|
||||
containers:
|
||||
- name: jnlp
|
||||
image: 'jcabillot/docker-inbound-agent-arm64'
|
||||
- name: docker
|
||||
image: docker:20.10-dind
|
||||
securityContext:
|
||||
privileged: true
|
||||
#volumeMounts:
|
||||
#- mountPath: '/var/run/docker.sock'
|
||||
# name: docker-socket
|
||||
#volumes:
|
||||
#- name: docker-socket
|
||||
# hostPath:
|
||||
# path: '/var/run/docker.sock'
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
@@ -33,7 +33,7 @@ require (
|
||||
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
|
||||
github.com/pkg/errors v0.8.1
|
||||
github.com/prometheus/client_golang v1.2.1
|
||||
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563
|
||||
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9
|
||||
github.com/sasha-s/go-deadlock v0.2.0
|
||||
github.com/shirou/gopsutil v0.0.0-20190714054239-47ef3260b6bf
|
||||
github.com/syncthing/notify v0.0.0-20190709140112-69c7a957d3e2
|
||||
|
||||
@@ -164,6 +164,8 @@ github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQl
|
||||
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 h1:bsUq1dX0N8AOIL7EB/X911+m4EHsnWEHeJ0c+3TTBrg=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y=
|
||||
|
||||
Reference in New Issue
Block a user