1
mirror of https://git.burble.com/burble.dn42/dn42regsrv.git synced 2024-02-26 20:28:04 +01:00

build directly to docker image

This commit is contained in:
Simon Marsh 2023-09-24 13:11:56 +01:00
parent cbeceec690
commit 88fb036f1c
No known key found for this signature in database
GPG Key ID: E9B4156C1659C079
2 changed files with 39 additions and 59 deletions

View File

@ -12,67 +12,20 @@ steps:
- go vet - go vet
- go build - go build
- name: static build - name: docker
image: alpine image: plugins/docker
commands:
- tar cvzf staticroot.tar.gz -C StaticRoot .
- name: upload bin
image: plugins/s3
settings: settings:
bucket: artifacts registry: git.burble.dn42
access_key: repo: git.burble.dn42/burble.dn42/dn42regsrv
from_secret: MINIO_ACCESS_KEY tags: latest
secret_key: username: burble
from_secret: MINIO_SECRET_KEY password:
endpoint: https://minio.burble.dn42 from_secret: TOKEN
region: fr-par1
path_style: true
source: dn42regsrv
target: /dn42regsrv/${DRONE_BRANCH}
- name: upload site
image: plugins/s3
settings:
bucket: artifacts
access_key:
from_secret: MINIO_ACCESS_KEY
secret_key:
from_secret: MINIO_SECRET_KEY
endpoint: https://minio.burble.dn42
region: fr-par1
path_style: true
source: staticroot.tar.gz
target: /dn42regsrv/${DRONE_BRANCH}
--- ---
kind: secret kind: secret
name: MINIO_ACCESS_KEY name: TOKEN
get: get:
path: burble.dn42/kv/data/drone/minio path: burble.dn42/kv/data/drone/git.burble.dn42
name: ACCESS_KEY name: artifact-token
---
kind: secret
name: MINIO_SECRET_KEY
get:
path: burble.dn42/kv/data/drone/minio
name: SECRET_KEY
steps:
- name: build
environment:
CGO_ENABLED: 0
commands:
- go build
- name: stage
commands:
- stage_artifact.sh dn42regsrv dn42regsrv StaticRoot
- name: promote
commands:
- promote_artifact.sh dn42regsrv
when:
branch: master

27
Dockerfile Normal file
View File

@ -0,0 +1,27 @@
###########################################################################
FROM alpine
MAINTAINER burble <simon@burble.com>
VOLUME /registry
###########################################################################
RUN apk add --update git && rm -rf /var/cache/apk/*
ADD dn42regsrv /usr/local/bin/dn42regsrv
ADD StaticRoot /StaticRoot
RUN mkdir -p /registry && \
chown -R 1000:1000 /registry /usr/local/bin/dn42regsrv /StaticRoot && \
chmod u+rx /usr/local/bin/dn42regsrv && \
chmod -R u+rX /StaticRoot /registry
###########################################################################
USER 1000
WORKDIR /registry
EXPOSE 8042
ENTRYPOINT [ "/usr/local/bin/dn42regsrv", "-d", "/registry", "-s", "/StaticRoot" ]
###########################################################################
# end of file