diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e236f9a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,48 @@ +--- +kind: pipeline +type: docker +name: pull_request +image_pull_secrets: + - dockerconfigjson + +steps: + - name: lint yaml + image: registry.fedy95.com/baseimage-yamllint:latest + commands: + - yamllint -c /yamllint/relaxed.yaml docker-compose.yml + when: + event: pull_request + +--- +kind: pipeline +type: ssh +name: master_push + +clone: + disable: true + +server: + host: + from_secret: host + user: + from_secret: user + password: + from_secret: password + +steps: + - name: release + commands: + - cd /home/fedy95/infra/nextcloud + - git pull + - make restart + - name: cleanup + commands: + - cd /home/fedy95/infra/nextcloud + - make cleanup + +trigger: + branch: + - master + event: + - push +... diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b981f1c --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +MAKEFLAGS += --silent +.PHONY: * + +REGISTRY=registry.fedy95.com +YAMLLINT_TAG=baseimage-yamllint:latest + +lint: lint-yaml + +LINT-YAML-CMD=docker run --rm -it -v $(PWD):/data ${REGISTRY}/${YAMLLINT_TAG} +lint-yaml: + docker pull ${REGISTRY}/${YAMLLINT_TAG} + $(LINT-YAML-CMD) docker-compose.yml + +restart: + docker-compose -f docker-compose.yml pull + docker-compose -f docker-compose.yml down + docker-compose -f docker-compose.yml up -d + +cleanup: + docker system prune --all --force + docker system prune --volumes --force + +.DEFAULT_GOAL := lint diff --git a/README.md b/README.md index 781ca69..5bcd400 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ -### template [![Build Status](https://drone.fedy95.com/api/badges/infra/template/status.svg)](https://drone.fedy95.com/infra/template) +### nextcloud [![Build Status](https://drone.fedy95.com/api/badges/infra/nextcloud/status.svg)](https://drone.fedy95.com/infra/nextcloud) -Base repository for new infra-repos +--- + +### services + +- [docker hub](https://hub.docker.com/r/linuxserver/nextcloud) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c80e5a5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +--- +version: "3" + +services: + nextcloud: + image: linuxserver/nextcloud:version-21.0.2 + container_name: nextcloud + hostname: nextcloud + restart: always + + ports: + - "3052:443" + environment: + - PUID=1000 + - PGID=1000 + - TZ=Etc/UTC + volumes: + - ./etc/nextcloud/config:/config + - ./etc/nextcloud/data:/data +... diff --git a/etc/.gitignore b/etc/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/etc/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore