mirror of
https://github.com/fbartels/cloudron-drone-app.git
synced 2025-01-09 10:45:28 +00:00
Add helper for cli and use it to update the drone server itself (#1)
This commit is contained in:
parent
45a8c36530
commit
66ba25d5fe
4 changed files with 79 additions and 0 deletions
43
.drone.yml
Normal file
43
.drone.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: cloudron build & update
|
||||
image: fbartels/cloudron-cli
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
environment:
|
||||
DOCKER_USERNAME: {from_secret: DOCKER_USERNAME}
|
||||
DOCKER_PASSWORD: {from_secret: DOCKER_PASSWORD}
|
||||
CLOUDRON_SERVER: {from_secret: CLOUDRON_SERVER}
|
||||
CLOUDRON_TOKEN: {from_secret: CLOUDRON_TOKEN}
|
||||
commands:
|
||||
- dockerize -wait file:///var/run/docker.sock -timeout 60s
|
||||
- docker ps -a
|
||||
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
||||
- make build
|
||||
- make update-ci
|
||||
when:
|
||||
branch:
|
||||
include:
|
||||
- master
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
command: [ --storage-driver=aufs]
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
when:
|
||||
branch:
|
||||
include:
|
||||
- master
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
6
Makefile
6
Makefile
|
@ -1,5 +1,7 @@
|
|||
CLOUDRON_APP ?= drone
|
||||
CLOUDRON_ID := $(shell jq -r .id CloudronManifest.json)
|
||||
CLOUDRON_SERVER ?= my.9wd.eu
|
||||
CLOUDRON_TOKEN ?=123
|
||||
DOCKER_REPO ?= fbartels
|
||||
|
||||
.PHONY: default
|
||||
|
@ -17,6 +19,10 @@ build:
|
|||
update: build
|
||||
cloudron update --app ${CLOUDRON_APP}
|
||||
|
||||
.PHONY: update-ci
|
||||
update-ci:
|
||||
cloudron update --server ${CLOUDRON_SERVER} --token ${CLOUDRON_TOKEN} --app ${CLOUDRON_APP}
|
||||
|
||||
.PHONY: install
|
||||
install: build
|
||||
cloudron install --location ${CLOUDRON_APP}
|
||||
|
|
10
helpers/cloudron-cli/Dockerfile
Normal file
10
helpers/cloudron-cli/Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM plugins/docker:latest
|
||||
RUN apk add --no-cache jq make npm perl python
|
||||
ENV DOCKERIZE_VERSION v0.6.1
|
||||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
||||
tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
||||
rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
|
||||
|
||||
# use --unsafe to not execute post actions as user nobody
|
||||
RUN npm -g install cloudron@4.5.3 --unsafe && npm cache clean --force && \
|
||||
cloudron --version
|
20
helpers/cloudron-cli/Makefile
Normal file
20
helpers/cloudron-cli/Makefile
Normal file
|
@ -0,0 +1,20 @@
|
|||
DOCKER_REPO ?= fbartels
|
||||
DOCKER_IMAGE := cloudron-cli
|
||||
VERSION := $(shell grep cloudron@ Dockerfile | cut -d' ' -f 5 | cut -d@ -f 2)
|
||||
|
||||
.PHONY: default
|
||||
default: push
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
docker build . -t $(DOCKER_IMAGE)
|
||||
|
||||
.PHONY: tag
|
||||
tag: build
|
||||
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
|
||||
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
|
||||
|
||||
.PHONY: push
|
||||
push: tag
|
||||
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
|
||||
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
|
Loading…
Reference in a new issue