initial commit

This commit is contained in:
Dmitriy Pleshevskiy 2022-06-06 16:46:25 +03:00
commit bb44e6e957
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 42 additions and 0 deletions

21
.drone.yml Normal file
View file

@ -0,0 +1,21 @@
kind: pipeline
type: docker
name: default
trigger:
branch:
- main
event:
- push
steps:
- name: build-docker-image
image: plugins/docker
settings:
username:
from_secret: org_registry_username
password:
from_secret: org_registry_password
registry: registry.pleshevski.ru
repo: registry.pleshevski.ru/${DRONE_REPO}

7
Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM docker:20.10.14-dind
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT /entrypoint.sh

14
entrypoint.sh Normal file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -ex
if [ -n "$PLUGIN_PASSWORD" ]; then
echo -n "$PLUGIN_PASSWORD" | docker login -u "$PLUGIN_USERNAME" --password-stdin $PLUGIN_REGISTRY
AUTH_FLAGS=--with-registry-auth
fi
docker stack deploy \
$AUTH_FLAGS \
-c "${PLUGIN_COMPOSE_FILE_PATH:-docker-compose.yml}" \
${PLUGIN_NAME:-$DRONE_REPO_NAME}