Use gitea package registry.
This commit is contained in:
22
.drone.yml
22
.drone.yml
@@ -1,22 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build container
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
username:
|
|
||||||
from_secret: registry-username
|
|
||||||
password:
|
|
||||||
from_secret: registry-password
|
|
||||||
registry: https://cs-registry.ddnss.de
|
|
||||||
repo: cs-registry.ddnss.de/${DRONE_REPO_OWNER}/apc
|
|
||||||
cache_from: cs-registry.ddnss.de/${DRONE_REPO_OWNER}/apc:latest
|
|
||||||
dry_run: false
|
|
||||||
purge: true
|
|
||||||
squash: true
|
|
||||||
compress: true
|
|
||||||
insecure: false
|
|
||||||
tags:
|
|
||||||
- ${DRONE_TAG}
|
|
||||||
45
.gitea/workflows/release.yml
Normal file
45
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: Build apc image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Use docker.io for Docker Hub if empty
|
||||||
|
REGISTRY: cs-registry.ddnss.de
|
||||||
|
USER: chris
|
||||||
|
PASS: q',\H(Od:G3).Xv<#!5P
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build-and-release-image:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Log into registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: https://cs-git.ddnss.de
|
||||||
|
username: ${{ env.USER }}
|
||||||
|
password: ${{ env.PASS }}
|
||||||
|
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: cs-git.ddnss.de/home/apc
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
env:
|
||||||
|
ACTIONS_RUNTIME_TOKEN: ''
|
||||||
|
with:
|
||||||
|
tags: cs-git.ddnss.de/home/apc:latest
|
||||||
|
push: true
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
FROM golang:alpine AS build
|
FROM golang:alpine AS build
|
||||||
|
|
||||||
MAINTAINER chris
|
MAINTAINER chris
|
||||||
RUN apk add git --no-cache && \
|
RUN apk add git --no-cache && \
|
||||||
git clone https://github.com/mdlayher/apcupsd_exporter /tmp/build && \
|
git clone https://github.com/mdlayher/apcupsd_exporter /tmp/build && \
|
||||||
@@ -6,10 +7,13 @@ RUN apk add git --no-cache && \
|
|||||||
go build -o /go/bin/apcupsd_exporter /tmp/build/cmd/apcupsd_exporter/main.go
|
go build -o /go/bin/apcupsd_exporter /tmp/build/cmd/apcupsd_exporter/main.go
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
RUN apk update && apk upgrade && apk add --no-cache libusb apcupsd
|
RUN apk update && apk upgrade && apk add --no-cache libusb apcupsd
|
||||||
|
|
||||||
COPY apc-deamon.conf /etc/apcupsd/apcupsd.conf
|
COPY apc-deamon.conf /etc/apcupsd/apcupsd.conf
|
||||||
COPY entrypoint.sh /sbin/entrypoint.sh
|
COPY entrypoint.sh /sbin/entrypoint.sh
|
||||||
COPY --from=build /go/bin/apcupsd_exporter /sbin/apcupsd_exporter
|
COPY --from=build /go/bin/apcupsd_exporter /sbin/apcupsd_exporter
|
||||||
EXPOSE 9162 3551/tcp 3551/udp
|
|
||||||
ENTRYPOINT ["sh", "/sbin/entrypoint.sh"]
|
|
||||||
|
|
||||||
|
EXPOSE 9162 3551/tcp 3551/udp
|
||||||
|
|
||||||
|
ENTRYPOINT ["sh", "/sbin/entrypoint.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user