This commit is contained in:
57
.drone.yml
Normal file
57
.drone.yml
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: build
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: tomkukral/buildah:0.27
|
||||
privileged: true
|
||||
environment:
|
||||
REGISTRY_USERNAME:
|
||||
from_secret: registry_username
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: registry_password
|
||||
REGISTRY_SERVER: "docker.io"
|
||||
RELEASE_IMAGE_NAME: "docker.io/genunix/homeassistant"
|
||||
commands:
|
||||
- |
|
||||
HASS_VERSION=$$(grep FROM Dockerfile|cut -d : -f 2)
|
||||
podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
|
||||
echo "== Building $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
|
||||
podman build --pull-always --format docker -t $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} .
|
||||
echo "== Publishing $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
|
||||
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
||||
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${HASS_VERSION}
|
||||
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:latest
|
||||
podman logout "$${REGISTRY_SERVER}"
|
||||
volumes:
|
||||
- name: containers
|
||||
path: /var/lib/containers
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
|
||||
- name: cleanup
|
||||
image: tomkukral/buildah:0.27
|
||||
privileged: true
|
||||
environment:
|
||||
RELEASE_IMAGE_NAME: "docker.io/genunix/homeassistant"
|
||||
commands:
|
||||
- podman rmi -f $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
||||
- podman image prune -f
|
||||
volumes:
|
||||
- name: containers
|
||||
path: /var/lib/containers
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
volumes:
|
||||
- name: containers
|
||||
host:
|
||||
path: /var/lib/containers
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM homeassistant/home-assistant:2021.10.4
|
||||
FROM homeassistant/home-assistant:2022.2.0
|
||||
|
||||
COPY src/ /usr/src/homeassistant/homeassistant/
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
FROM homeassistant/home-assistant:2021.4.3
|
||||
|
||||
COPY src/ /usr/src/homeassistant/homeassistant/
|
||||
|
||||
RUN mkdir -p /usr/local/config/custom_components && \
|
||||
touch /usr/local/config/home-assistant.log && \
|
||||
cd /usr/local/config && \
|
||||
wget -q -O - https://install.hacs.xyz | bash - && \
|
||||
cat /usr/local/config/custom_components/hacs/manifest.json | jq -r .requirements[] | xargs /usr/local/bin/python3 -m pip install --quiet --no-cache-dir --upgrade --constraint /usr/src/homeassistant/homeassistant/package_constraints.txt --find-links https://wheels.home-assistant.io/alpine-3.10/amd64/ --prefer-binary
|
||||
|
||||
RUN cd /tmp && \
|
||||
wget https://github.com/zacs/ha-dualmodegeneric/archive/refs/heads/master.zip && \
|
||||
unzip master.zip && \
|
||||
mv ha-dualmodegeneric-master/custom_components/* /usr/local/config/custom_components/ && \
|
||||
rm -rf /tmp/*
|
||||
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENV PYTHONUSERBASE /config/deps
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user