Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5818e21635 | |||
| c706f2422c | |||
| 4fc4a3e48f | |||
| 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
|
||||
@@ -38,7 +38,7 @@ require (
|
||||
github.com/shirou/gopsutil v0.0.0-20190714054239-47ef3260b6bf
|
||||
github.com/syncthing/notify v0.0.0-20190709140112-69c7a957d3e2
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d
|
||||
github.com/thejerf/suture v3.0.2+incompatible
|
||||
github.com/thejerf/suture v3.0.3+incompatible
|
||||
github.com/urfave/cli v1.22.2
|
||||
github.com/vitrun/qart v0.0.0-20160531060029-bf64b92db6b0
|
||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472
|
||||
|
||||
@@ -187,6 +187,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA=
|
||||
github.com/thejerf/suture v3.0.2+incompatible h1:GtMydYcnK4zBJ0KL6Lx9vLzl6Oozb65wh252FTBxrvM=
|
||||
github.com/thejerf/suture v3.0.2+incompatible/go.mod h1:ibKwrVj+Uzf3XZdAiNWUouPaAbSoemxOHLmJmwheEMc=
|
||||
github.com/thejerf/suture v3.0.3+incompatible h1:rliKxLrY4prqHrZl79a8IJgYD0K+0GnpgwwudE12QGM=
|
||||
github.com/thejerf/suture v3.0.3+incompatible/go.mod h1:ibKwrVj+Uzf3XZdAiNWUouPaAbSoemxOHLmJmwheEMc=
|
||||
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
|
||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo=
|
||||
|
||||
Reference in New Issue
Block a user