aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-12-23 14:47:56 -0500
committerJesús <heckyel@hyperbola.info>2021-12-23 14:47:56 -0500
commit9ad16fd3cc51f9bf36674d580d4fd9ae1fc66bda (patch)
tree6eaa9bbb354f5c2c9ec9f30baf1e0752fd33547d
parent4547c3cb6137620e9016f87f871db0ad14486a91 (diff)
downloadcl-9ad16fd3cc51f9bf36674d580d4fd9ae1fc66bda.tar.lz
cl-9ad16fd3cc51f9bf36674d580d4fd9ae1fc66bda.tar.xz
cl-9ad16fd3cc51f9bf36674d580d4fd9ae1fc66bda.zip
[drone-ci]: add deploy
-rw-r--r--.drone.yml52
-rw-r--r--devscripts/comments.bash22
2 files changed, 71 insertions, 3 deletions
diff --git a/.drone.yml b/.drone.yml
index da6e753..ed9157b 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -2,22 +2,68 @@ kind: pipeline
name: default
steps:
-- name: hyperbola
+- name: build
image: rusian/hyperbola:0.4
+ environment:
+ SSH_KEY:
+ from_secret: SSH_KEY
commands:
- export SHELL=/bin/bash # hack custom shell
- pacman -Syu --noconfirm
- - pacman -S python-virtualenv python-setuptools make --noconfirm
+ - pacman -S python-virtualenv python-setuptools make git openssh --noconfirm
- sed -e 's|^# es_ES.UTF-8 UTF-8|es_ES.UTF-8 UTF-8|g' -i /etc/locale.gen
- sed -e 's|^# en_US.UTF-8 UTF-8|en_US.UTF-8 UTF-8|g' -i /etc/locale.gen
- sed -e 's|^# eo UTF-8|eo UTF-8|g' -i /etc/locale.gen
- sed -e 's|^# fr_FR.UTF-8 UTF-8|fr_FR.UTF-8 UTF-8|g' -i /etc/locale.gen
- locale-gen
- export LANG=es_ES.UTF-8 LANGUAGE=es_ES
+ - bash devscripts/comments.bash # import comments CL
- virtualenv -p python3 venv
- source venv/bin/activate
- rm -f /usr/bin/lsb_release # hack fix python-distro
- pip install -U -r requirements.txt
- (cd cl-theme/ && make compile)
- cp -v Makefile.example Makefile
- - make html # make validate disable because java no is present on Hyperbola
+ - make publish # make validate (disable because java no is present on Hyperbola)
+
+- name: deploy-tux
+ image: drillster/drone-rsync
+ settings:
+ hosts:
+ from_secret: TUX_SSH_HOST
+ port:
+ from_secret: TUX_SSH_PORT
+ key:
+ from_secret: SSH_KEY
+ user:
+ from_secret: TUX_SSH_USER
+ source: ./output/*
+ target:
+ from_secret: TUX_SSH_TARGET_DIR
+ recursive: true
+ delete: true
+ when:
+ branch: [master]
+ event: [push]
+
+- name: deploy-main
+ image: drillster/drone-rsync
+ settings:
+ hosts:
+ from_secret: SSH_HOST
+ port:
+ from_secret: SSH_PORT
+ key:
+ from_secret: SSH_KEY
+ user:
+ from_secret: SSH_USER
+ source: ./output/*
+ exclude:
+ - ./output/.htaccess
+ target:
+ from_secret: SSH_TARGET_DIR
+ recursive: true
+ delete: true
+ when:
+ branch: [master]
+ event: [push]
diff --git a/devscripts/comments.bash b/devscripts/comments.bash
new file mode 100644
index 0000000..8aebff5
--- /dev/null
+++ b/devscripts/comments.bash
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Prepare SSH
+home="/root"
+
+mkdir -p "$home/.ssh"
+
+printf "StrictHostKeyChecking no\n" > "$home/.ssh/config"
+
+chmod 0700 "$home/.ssh/config"
+
+keyfile="$home/.ssh/id_rsa"
+echo "$SSH_KEY" | grep -q "ssh-ed25519"
+if [ $? -eq 0 ]; then
+ printf "Using ed25519 based key\n"
+ keyfile="$home/.ssh/id_ed25519"
+fi
+echo "$SSH_KEY" > $keyfile
+chmod 0600 $keyfile
+
+# pull comments
+git clone git@git.conocimientoslibres.ga:cl-syscomment.git ./content/comments