File tree Expand file tree Collapse file tree 1 file changed +86
-0
lines changed Expand file tree Collapse file tree 1 file changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # Drone pipeline to build Docker image.
3+ #
4+
5+ kind : pipeline
6+ type : docker
7+ name : default
8+
9+ steps :
10+
11+ - name : build-only
12+ image : plugins/docker
13+ settings :
14+ repo : ${DRONE_REPO_NAMESPACE}/${DRONE_REPO_NAME##docker-}
15+ build_args :
16+ - DOCKER_IMAGE_VERSION=drone-ci
17+ dry_run : true
18+ when :
19+ ref :
20+ exclude :
21+ - refs/tags/v*
22+
23+ - name : set-docker-tags
24+ image : alpine
25+ commands :
26+ # Always tag the Docker image with the Git tag (i.e. vX.Y.Z).
27+ - printf "${DRONE_TAG}" >> .tags
28+ # Tag the Docker image with with 'latest' only if not a prerelease.
29+ - printf "${DRONE_TAG}" | grep -q '-' || printf ",latest" >> .tags
30+ when :
31+ ref :
32+ - refs/tags/v*
33+
34+ - name : build-and-push
35+ image : plugins/docker
36+ settings :
37+ repo : ${DRONE_REPO_NAMESPACE}/${DRONE_REPO_NAME##docker-}
38+ username :
39+ from_secret : dockerhub_username
40+ password :
41+ from_secret : dockerhub_password
42+ build_args :
43+ - DOCKER_IMAGE_VERSION=${DRONE_TAG:1}
44+ when :
45+ ref :
46+ - refs/tags/v*
47+
48+ - name : push-dockerhub-readme
49+ image : jlesage/drone-push-readme
50+ settings :
51+ repo : ${DRONE_REPO_NAMESPACE}/${DRONE_REPO_NAME##docker-}
52+ username :
53+ from_secret : dockerhub_username
54+ password :
55+ from_secret : dockerhub_password
56+ readme : DOCKERHUB.md
57+ when :
58+ ref :
59+ - refs/tags/v*
60+
61+ - name : microbadger
62+ image : plugins/webhook
63+ settings :
64+ urls :
65+ from_secret : microbadger_webhook
66+ failure : ignore
67+ when :
68+ ref :
69+ - refs/tags/v*
70+
71+ - name : notification
72+ image : plugins/pushover
73+ settings :
74+ message : " {{ repo.owner }}/{{ repo.name }}#{{ truncate build.commit 8 }} ({{ build.branch }}) by {{ build.author }} - {{ build.message }}"
75+ token :
76+ from_secret : pushover_token
77+ user :
78+ from_secret : pushover_user
79+ failure : ignore
80+ when :
81+ event :
82+ exclude :
83+ - pull_request
84+ status :
85+ - success
86+ - failure
You can’t perform that action at this time.
0 commit comments