From fa6a2e120ee301e703e3d623f2d78cfd75537401 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Fri, 1 May 2020 12:47:10 +0200 Subject: [PATCH] Absolutely blowing things up on the way to docker-compose setup --- .drone.yml | 14 -------------- CHECKS | 5 ----- CONTRIBUTING.md | 13 +++---------- Dockerfile | 15 --------------- Makefile | 26 ------------------------- _config_prod.yml => _config.yml | 0 _config_dev.yml | 28 --------------------------- deploy.d/config.yml | 11 ----------- docker-compose.override.yml | 2 +- docker-compose.production.yml | 13 +------------ sbin/entrypoint.sh | 34 --------------------------------- 11 files changed, 5 insertions(+), 156 deletions(-) delete mode 100644 CHECKS delete mode 100644 Dockerfile delete mode 100644 Makefile rename _config_prod.yml => _config.yml (100%) delete mode 100644 _config_dev.yml delete mode 100644 deploy.d/config.yml delete mode 100755 sbin/entrypoint.sh diff --git a/.drone.yml b/.drone.yml index a6ed416..cd94a99 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,17 +1,3 @@ ---- -kind: pipeline -name: default -steps: - - name: Deploy Autonomic.zone with Dokku - image: appleboy/drone-git-push:0.2.0-linux-amd64 - settings: - remote: ssh://dokku@dokku.autonomic.zone:222/autonomic.zone - ssh_key: - from_secret: drone_deploy_key -trigger: - branch: - - master - --- kind: pipeline name: deploy to swarm.autonomic.zone diff --git a/CHECKS b/CHECKS deleted file mode 100644 index 979a3d2..0000000 --- a/CHECKS +++ /dev/null @@ -1,5 +0,0 @@ -WAIT=3 -TIMEOUT=3 -ATTEMPTS=3 - -/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b39b4f7..3e9c00e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,11 +13,7 @@ with. [writing posts]: https://jekyllrb.com/docs/posts/ [creating pages]: https://jekyllrb.com/docs/pages/ -## Deploy It - -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 +## Development The prerequisites are [Docker](https://www.docker.com/) and [Docker-compose](https://docs.docker.com/compose/). @@ -56,9 +52,6 @@ To stop the container when you're done, you can run: $ docker-compose stop ``` -## Notes +## Production -1. For configuration, please note, we now use a `dev` environment config file: - `_config_dev.yml`. Hence if you edit one `_config*` file and you also want - that change to be reflected in the other environment ("dev", "prod") then - edit the other file as well! +TODO. diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index fed9fa4..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM decentral1se/jekyll:4 - -EXPOSE 4000 - -WORKDIR /usr/src/app - -COPY . ${WORKDIR} - -COPY sbin/* /sbin/ - -RUN bundle config --global frozen 1 - -RUN bundle install - -ENTRYPOINT ["/sbin/entrypoint.sh"] diff --git a/Makefile b/Makefile deleted file mode 100644 index 4bfc302..0000000 --- a/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -IMG := autonomic/autonomic.zone -NAME := autonomic-zone-testing -PORT := 4000 -TAG := testing - -build: - @docker build -t $(IMG):$(TAG) . -.PHONY: build - -stop: - @docker stop $(NAME) && docker rm $(NAME) --force -.PHONY: stop - -serve: - @docker run \ - --name $(NAME) \ - -e JEKYLL_PORT=$(PORT) \ - -e JEKYLL_HOST=0.0.0.0 \ - -e JEKYLL_CONFIG=_config_dev.yml \ - -e JEKYLL_ENV=development \ - -v $$(pwd):/usr/src/app \ - -p $(PORT):$(PORT) \ - -d \ - $(IMG):$(TAG) && \ - echo "Site available at http://localhost:4000" -.PHONY: serve diff --git a/_config_prod.yml b/_config.yml similarity index 100% rename from _config_prod.yml rename to _config.yml diff --git a/_config_dev.yml b/_config_dev.yml deleted file mode 100644 index b137f90..0000000 --- a/_config_dev.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Autonomic Co-operative -email: helo@autonomic.zone -description: Sustainability, Transparency, Privacy -baseurl: "" -url: "" -source: src -destination: dist -sass: - sass_dir: ./assets/styles -featured-image-source: -mastodon_url: https://sunbeam.city/@autonomic -twitter_url: https://twitter.com/autonomiccoop -gitea_url: https://git.autonomic.zone/autonomic-cooperative/ -markdown: kramdown -permalink: pretty -collections: - posts: - output: true - permalink: /blog/:title/ - clients: - output: false -exclude: - - vendor - - Gemfile - - Gemfile.lock -plugins: - - jekyll-feed diff --git a/deploy.d/config.yml b/deploy.d/config.yml deleted file mode 100644 index 927ee0d..0000000 --- a/deploy.d/config.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -vars: - port: "4000" - domain: "autonomic.zone" - -env: - DOKKU_LETSENCRYPT_EMAIL: "helo@autonomic.zone" - JEKYLL_CONFIG: "_config_prod.yml" - JEKYLL_ENV: "production" - JEKYLL_HOST: "0.0.0.0" - JEKYLL_PORT: "4000" diff --git a/docker-compose.override.yml b/docker-compose.override.yml index f83c1a1..da22536 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -8,7 +8,7 @@ services: --watch \ --force_polling \ --verbose \ - --config _config_dev.yml \ + --config _config.yml \ --trace volumes: - ".:/srv/jekyll" diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 1e9a069..92b3b6c 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -6,17 +6,10 @@ services: command: > jekyll serve \ --verbose \ - --config /srv/jekyll/_config_prod.yml \ + --config _config.yml \ --trace - configs: - - source: config-yml-prod-v1 - target: /srv/jekyll/_config_prod.yml networks: - proxy - volumes: - - type: bind - source: ./ - target: /srv/jekyll deploy: mode: replicated replicas: 1 @@ -35,7 +28,3 @@ services: networks: proxy: external: true - -configs: - config-yml-prod-v1: - file: _config_prod.yml diff --git a/sbin/entrypoint.sh b/sbin/entrypoint.sh deleted file mode 100755 index 9598419..0000000 --- a/sbin/entrypoint.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -# Fire up Jekyll with the right configuration -run_jekyll() { - set -eu - - # shellcheck disable=SC2155 - local args="--config $JEKYLL_CONFIG --trace --verbose" - - # shellcheck disable=SC2086 - bundle exec jekyll build $args - - # shellcheck disable=SC2155 - local args="${args} --host $JEKYLL_HOST --port $JEKYLL_PORT" - - if [[ $JEKYLL_ENV == "development" ]]; then - # shellcheck disable=SC2155 - local args="${args} --incremental" - fi - - # shellcheck disable=SC2086 - bundle exec jekyll serve $args -} - -# Main entrypoint -main() { - set -eu - - run_jekyll -} - -main