-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86c0cf6
commit b79fc67
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |