Compare commits
1 commit
962f17e89e
...
82ee73b164
| Author | SHA1 | Date | |
|---|---|---|---|
| 82ee73b164 |
1 changed files with 6 additions and 2 deletions
|
|
@ -20,19 +20,23 @@ trigger:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-and-publish-container
|
- name: build-and-publish-container
|
||||||
image: docker:dind
|
image: docker:cli
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run
|
path: /var/run
|
||||||
environment:
|
environment:
|
||||||
REGISTRY: git.local-it.org/ci-builder
|
REGISTRY: git.local-it.org/ci-builder
|
||||||
IMAGE_NAME: mitgliederverwaltung
|
IMAGE_NAME: mitgliederverwaltung
|
||||||
|
REGISTRY_USERNAME:
|
||||||
|
from_secret: DRONE_REGISTRY_USERNAME
|
||||||
|
REGISTRY_TOKEN:
|
||||||
|
from_secret: DRONE_REGISTRY_TOKEN
|
||||||
commands:
|
commands:
|
||||||
- sleep 6 # give docker time to start
|
- sleep 6 # give docker time to start
|
||||||
# Build image once
|
# Build image once
|
||||||
- docker build --tag $REGISTRY/$IMAGE_NAME:build-$DRONE_BUILD_NUMBER .
|
- docker build --tag $REGISTRY/$IMAGE_NAME:build-$DRONE_BUILD_NUMBER .
|
||||||
# Login to registry
|
# Login to registry
|
||||||
- docker login --username $DRONE_FORGEJO_ACCOUNT_USERNAME --password $DRONE_FORGEJO_ACCOUNT_PASSWORD git.local-it.org
|
- echo "$REGISTRY_TOKEN" | docker login --username "$REGISTRY_USERNAME" --password-stdin git.local-it.org
|
||||||
# Tag and push based on event type
|
# Tag and push based on event type
|
||||||
- |
|
- |
|
||||||
if [ "$DRONE_BUILD_EVENT" = "tag" ]; then
|
if [ "$DRONE_BUILD_EVENT" = "tag" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue