Skip to content

Commit

Permalink
Merge pull request #4 from Diesel-Net/development
Browse files Browse the repository at this point in the history
Build custom Docker image
  • Loading branch information
tomdaley92 authored Jan 21, 2024
2 parents ef01750 + 98d326b commit 420adbf
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .drone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
kind: pipeline
type: docker
name: Build swarm-cronjob image

concurrency:
limit: 1

clone:
depth: 1

steps:

- name: git clone upstream repo
image: docker:git
commands:
- git clone --recursive https://github.com/crazy-max/swarm-cronjob.git swarm-cronjob
- (cd swarm-cronjob && git checkout $(cat ../VERSION))

- name: modify docker api version string in source
image: bash
commands:
# replace docker API version in source code
- cd swarm-cronjob/internal/docker
- sed -i 's/WithVersion("1.12")/WithVersion("1.24")/g' client.go
- grep -h 'WithVersion' client.go

- name: docker build (${DRONE_BRANCH}-latest)
image: plugins/docker
settings:
context: swarm-cronjob
dockerfile: swarm-cronjob/Dockerfile
mirror: dockerhub.nexus.diesel.net
registry: docker.nexus.diesel.net
username:
from_secret: nexus_user
password:
from_secret: nexus_pass
repo: docker.nexus.diesel.net/swarm-cronjob
tags:
- ${DRONE_BRANCH}-latest
when:
event:
- push

- name: docker build (${DRONE_TAG})
image: plugins/docker
settings:
context: swarm-cronjob
dockerfile: swarm-cronjob/Dockerfile
mirror: dockerhub.nexus.diesel.net
registry: docker.nexus.diesel.net
username:
from_secret: nexus_user
password:
from_secret: nexus_pass
repo: docker.nexus.diesel.net/swarm-cronjob
tags:
- latest
- ${DRONE_TAG}
when:
event:
- tag

trigger:
branch:
- development
- stable
event:
- push
- tag
...
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.12.0
2 changes: 1 addition & 1 deletion templates/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
daemon:
image: crazymax/swarm-cronjob
image: docker.nexus.diesel.net/swarm-cronjob
volumes:
- "{{ docker_socket }}:/var/run/docker.sock"
environment:
Expand Down

0 comments on commit 420adbf

Please sign in to comment.