Skip to content

Commit

Permalink
Added drone
Browse files Browse the repository at this point in the history
  • Loading branch information
carldanley committed Aug 2, 2022
1 parent 86c0cf6 commit b79fc67
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
kind: pipeline
type: docker
name: default

steps:
- name: lint-code
image: golang:alpine
commands:
- go install golang.org/x/lint/golint
- golint -set_exit_status ./

- name: build-code
image: golang:alpine
environment:
CGO_ENABLED: 0
GOOS: linux
commands:
- go build -a -installsuffix cgo -o ha-fpp-mqtt
when:
ref:
- refs/tags/*
depends_on:
- lint-code

- name: publish-container
image: banzaicloud/drone-kaniko
settings:
repo: alfred/ha-fpp-mqtt
registry: reg.r1p.io
auto_tag: true
username:
from_secret: docker-username
password:
from_secret: docker-password
build_args:
- COMMIT_SHA=${DRONE_COMMIT_SHA}
- COMMIT_AUTHOR_EMAIL=${DRONE_COMMIT_AUTHOR_EMAIL}
when:
ref:
- refs/tags/*
depends_on:
- build-code

- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh-host
port:
from_secret: ssh-port
key:
from_secret: ssh-key
username:
from_secret: ssh-username
script_stop: true
script:
- docker-compose -f /home/$(whoami)/services.yaml pull alfred
- docker-compose -f /home/$(whoami)/services.yaml up -d alfred
- docker image prune --all --force
when:
ref:
- refs/tags/*
depends_on:
- publish-container
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine

RUN apk upgrade --no-cache \
&& apk --no-cache add \
tzdata zip ca-certificates

WORKDIR /usr/share/zoneinfo
RUN zip -r -0 /zoneinfo.zip .
ENV ZONEINFO /zoneinfo.zip

WORKDIR /
ADD ha-fpp-mqtt /bin/

ENTRYPOINT [ "/bin/ha-fpp-mqtt" ]

0 comments on commit b79fc67

Please sign in to comment.