diff --git a/.drone.yml b/.drone.yml index fa35a39..a6ed416 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,6 +11,26 @@ steps: trigger: branch: - master - event: - exclude: - - pull_request + +--- +kind: pipeline +name: deploy to swarm.autonomic.zone +steps: + - name: deployment + image: decentral1se/drone-stack:19.03.8-override-compose + settings: + compose: docker-compose.yml + host: tcp://swarm.autonomic.zone:2376 + override_compose: docker-compose.production.yml + stack_name: traefik + tlsverify: true + environment: + PLUGIN_CACERT: + from_secret: docker_cacert + PLUGIN_CERT: + from_secret: docker_cert + PLUGIN_KEY: + from_secret: docker_key +trigger: + branch: + - master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5fb40fd..b39b4f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,23 +15,33 @@ with. ## Deploy It -1. Push your changes to master and Dokku will try to automatically release -1. See the [Drone dashboard to see the build](https://drone.autonomic.zone/autonomic-cooperative/autonomic.zone/) +Just push your changes to master and it will be deploy. See [Drone](https://drone.autonomic.zone/autonomic-cooperative/autonomic.zone/) for more. ## Hack On It -The only prerequisite is [Docker](https://www.docker.com/). If you're on Debian, installing is easy. +The prerequisites are [Docker](https://www.docker.com/) and [Docker-compose](https://docs.docker.com/compose/). + +If you're on Debian, installing is easy. + +Install Docker. ```bash $ curl -fsSL https://get.docker.com -o get-docker.sh # have a look if you want $ CHANNEL=stable sh get-docker.sh ``` -Fire up the container with the following. +Install Docker-compose. ```bash -$ make build # only the first time or when changing container -$ make serve +$ cd autonomic.zone +$ python3 -m venv .venv +$ pip install -r requirements.txt +``` + +Then fire up the container with the following. + +```bash +$ docker-compose up ``` Then visit the locally running website. @@ -43,7 +53,7 @@ Then you can edit the files as normal and reload the page. To stop the container when you're done, you can run: ```bash -$ make stop +$ docker-compose stop ``` ## Notes diff --git a/Gemfile b/Gemfile index 84a4578..1623dae 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source "https://rubygems.org" -ruby '2.6.5' +ruby "2.7.1" gemspec -gem 'jekyll-feed' \ No newline at end of file +gem "jekyll-feed" diff --git a/Gemfile.lock b/Gemfile.lock index 1d1bfa1..a6ca6df 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,7 +40,8 @@ GEM sassc (> 2.0.1, < 3.0) jekyll-watch (2.2.1) listen (~> 3.0) - kramdown (2.1.0) + kramdown (2.2.1) + rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.3) @@ -50,13 +51,14 @@ GEM mercenary (0.3.6) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.3) - rb-fsevent (0.10.3) + public_suffix (4.0.4) + rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - rouge (3.17.0) + rexml (3.2.3) + rouge (3.18.0) safe_yaml (1.0.5) - sassc (2.2.1) + sassc (2.3.0) ffi (~> 1.9) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -72,7 +74,7 @@ DEPENDENCIES jekyll-feed RUBY VERSION - ruby 2.6.5p114 + ruby 2.7.1p83 BUNDLED WITH 2.1.4 diff --git a/README.md b/README.md index 1713f01..a53c7bb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ [![Build Status](https://drone.autonomic.zone/api/badges/autonomic-cooperative/autonomic.zone/status.svg)](https://drone.autonomic.zone/autonomic-cooperative/autonomic.zone) -> https://autonomic.zone +> https://autonomic.zone (dokku version) + +> https://site.swarm.autonomic.zone (swarm version) A [Jekyll] based site for the Autonomic Cooperative. The site is based on the [spectral-jekyll-theme] template. diff --git a/autonomic.gemspec b/autonomic.gemspec index aaf6444..ac211d8 100644 --- a/autonomic.gemspec +++ b/autonomic.gemspec @@ -2,13 +2,13 @@ Gem::Specification.new do |spec| spec.name = "autonomic" - spec.version = '0.0.0' - spec.date = '2017-09-24' + spec.version = "0.0.0" + spec.date = "2017-09-24" spec.summary = "" spec.description = "" - spec.authors = ['autonomic co-operative'] - spec.email = 'autonomic.posteo.net' - spec.files = 'README.md' + spec.authors = ["autonomic co-operative"] + spec.email = "autonomic.posteo.net" + spec.files = "README.md" spec.add_development_dependency "jekyll", ">= 4" spec.add_development_dependency "bundler", ">= 2.1.4" diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..847d112 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,9 @@ +--- +version: "3.7" + +services: + jekyll: + command: | + jekyll serve --watch --force_polling --verbose --config _config_dev.yml + volumes: + - .:/srv/jekyll diff --git a/docker-compose.production.yml b/docker-compose.production.yml new file mode 100644 index 0000000..df911a5 --- /dev/null +++ b/docker-compose.production.yml @@ -0,0 +1,34 @@ +--- +version: "3.7" + +services: + jekyll: + command: | + jekyll serve --verbose --config /srv/jekyll/_config_prod.yml + configs: + - source: config-yml-prod-v1 + target: /srv/jekyll/_config_prod.yml + networks: + - proxy + deploy: + mode: replicated + replicas: 1 + update_config: + failure_action: rollback + placement: + constraints: + - node.role == manager + labels: + - "traefik.enable=true" + - "traefik.http.services.traefik.loadbalancer.server.port=web" + - "traefik.http.routers.traefik.rule=Host(`site.swarm.autonomic.zone`)" + - "traefik.http.routers.traefik.entrypoints=web-secure" + - "traefik.http.routers.traefik.tls.certresolver=staging" + +networks: + proxy: + external: true + +configs: + config-yml-prod-v1: + file: _config_prod.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1ff03ff --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +--- +version: "3.7" + +services: + jekyll: + image: jekyll/jekyll:4 + ports: + - "4000:4000" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3019cfd --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +docker-compose==1.7.2