From c045e019fad5673acf1771cb849e9e252c9b09da Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 22 Sep 2020 13:41:52 +0200 Subject: [PATCH] First stab at abra installer script --- .drone.yml | 21 +++++++++++++++++++++ Makefile | 9 +++++++++ README.md | 7 +++++++ abra/abra.conf | 10 ++++++++++ abra/installer | 18 ++++++++++++++++++ compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+) create mode 100644 .drone.yml create mode 100644 Makefile create mode 100644 README.md create mode 100644 abra/abra.conf create mode 100644 abra/installer create mode 100644 compose.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..51c43fd --- /dev/null +++ b/.drone.yml @@ -0,0 +1,21 @@ +--- +kind: pipeline +name: deploy to swarm.autonomic.zone +steps: + - name: deployment + image: decentral1se/drone-stack:19.03.8 + settings: + compose: compose.yml + host: tcp://swarm.autonomic.zone:2376 + stack_name: installer-scripts + 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/Makefile b/Makefile new file mode 100644 index 0000000..b2834d3 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +ABRA_VERSION := 0.1.1 +ABRA_SRC := "https://git.autonomic.zone/autonomic-cooperative/abra/raw/tag/$(ABRA_VERSION)/installer" + +default: update-abra-installer + +update-abra-installer: + @curl $(ABRA_SRC) > abra/installer + +.PHONY: update-abra-installer diff --git a/README.md b/README.md new file mode 100644 index 0000000..16b0c71 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# installer-scripts + +Plain text script hosting so we can do `curl -fsSL foo.autonomic.zone | bash` installations. + +Currently hosting the following: + +- [install.abra.autonomic.zone](https://install.abra.autonomic.zone) diff --git a/abra/abra.conf b/abra/abra.conf new file mode 100644 index 0000000..2fc8e91 --- /dev/null +++ b/abra/abra.conf @@ -0,0 +1,10 @@ +server { + listen 80 default_server; + server_name install.abra.autonomic.zone; + + location / { + root /var/www/abra-installer; + wadd_header Content-Type text/plain; + index installer + } +} diff --git a/abra/installer b/abra/installer new file mode 100644 index 0000000..2b7d495 --- /dev/null +++ b/abra/installer @@ -0,0 +1,18 @@ +#!/bin/bash + +ABRA_VERSION="0.1.0" +ABRA_SRC="https://git.autonomic.zone/autonomic-cooperative/abra/raw/tag/$ABRA_VERSION/abra" + +function install_abra { + mkdir -p "$HOME/.local/bin" + curl "$ABRA_SRC" > "$HOME/.local/bin/abra" + chmod +x "$HOME/.local/bin/abra" + echo "abra installed to $HOME/.loca/bin/abra" +} + +function run_installation { + install_abra +} + +run_installation +exit 0 diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..93b8221 --- /dev/null +++ b/compose.yml @@ -0,0 +1,40 @@ +--- +version: "3.8" + +services: + nginx: + image: "nginx:stable" + configs: + - source: abra_conf + target: /etc/nginx/conf.d/abra.conf + - source: abra_installer + target: /var/www/abra-installer/installer + volumes: + - "public:/var/www/abra-installer" + networks: + - proxy + deploy: + update_config: + failure_action: rollback + order: start-first + labels: + - "traefik.enable=true" + - "traefik.http.services.well-known-uris.loadbalancer.server.port=80" + - "traefik.http.routers.gitea.rule=Host(`install.abra.autonomic.zone`)" + - "traefik.http.routers.well-known-uris.entrypoints=web-secure" + - "traefik.http.routers.well-known-uris.tls.certresolver=production" + +configs: + abra_installer: + name: abra_installer_v1 + file: abra/installer + abra_conf: + name: abra_conf_v1 + file: abra/abra.conf + +networks: + proxy: + external: true + +volumes: + public: