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:
parent
cbeceec690
commit
88fb036f1c
69
.drone.yml
69
.drone.yml
@ -12,67 +12,20 @@ steps:
|
||||
- go vet
|
||||
- go build
|
||||
|
||||
- name: static build
|
||||
image: alpine
|
||||
commands:
|
||||
- tar cvzf staticroot.tar.gz -C StaticRoot .
|
||||
|
||||
- name: upload bin
|
||||
image: plugins/s3
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
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: 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}
|
||||
registry: git.burble.dn42
|
||||
repo: git.burble.dn42/burble.dn42/dn42regsrv
|
||||
tags: latest
|
||||
username: burble
|
||||
password:
|
||||
from_secret: TOKEN
|
||||
|
||||
---
|
||||
kind: secret
|
||||
name: MINIO_ACCESS_KEY
|
||||
name: TOKEN
|
||||
get:
|
||||
path: burble.dn42/kv/data/drone/minio
|
||||
name: ACCESS_KEY
|
||||
path: burble.dn42/kv/data/drone/git.burble.dn42
|
||||
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
27
Dockerfile
Normal 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
|
Loading…
Reference in New Issue
Block a user