Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
fc6bd36d2f | |||
6fdf99b0f3 | |||
71f107e2ee | |||
07a3b7821a | |||
7ef0bd900e | |||
050b220e7b | |||
27fa3c7818 | |||
5e86455eb4 | |||
2bbdbaece5 |
@ -1,10 +0,0 @@
|
|||||||
[all:vars]
|
|
||||||
ansible_user='debian'
|
|
||||||
ansible_become=yes
|
|
||||||
ansible_become_method=sudo
|
|
||||||
ansible_python_interpreter='/usr/bin/env python3'
|
|
||||||
project='CyfroweAukcje'
|
|
||||||
main_packages="vim, vim-common, curl, wget"
|
|
||||||
|
|
||||||
[servers]
|
|
||||||
# example1 ansible_host=ip ansible_port=65522
|
|
@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
- name: System preconfiguration
|
|
||||||
hosts: all
|
|
||||||
tasks:
|
|
||||||
- name: Prepare motd
|
|
||||||
template:
|
|
||||||
src: templates/motd.jinja
|
|
||||||
dest: /etc/motd
|
|
||||||
- name: Trusted ca
|
|
||||||
template:
|
|
||||||
src: templates/trusted-user-ca-keys.pem
|
|
||||||
dest: /etc/ssh/trusted-user-ca-keys.pem
|
|
||||||
- name: Configure sshd
|
|
||||||
template:
|
|
||||||
src: templates/sshd_config
|
|
||||||
dest: /etc/ssh/sshd_config
|
|
||||||
- name: Restart sshd service
|
|
||||||
systemd:
|
|
||||||
name: sshd
|
|
||||||
state: reloaded
|
|
||||||
|
|
||||||
- name: Upgrade system
|
|
||||||
hosts: all
|
|
||||||
tasks:
|
|
||||||
- name: Update apt-get repo and cache
|
|
||||||
apt: update_cache=yes force_apt_get=yes cache_valid_time=3600
|
|
||||||
- name: Upgrade all apt packages
|
|
||||||
apt: upgrade=dist force_apt_get=yes
|
|
||||||
- name: Remove dependencies that are no longer required
|
|
||||||
apt:
|
|
||||||
autoremove: yes
|
|
||||||
|
|
||||||
- name: Install my packages
|
|
||||||
hosts: all
|
|
||||||
tasks:
|
|
||||||
- name: Install main packages
|
|
||||||
apt:
|
|
||||||
name: "{{ main_packages }}"
|
|
||||||
state: present
|
|
@ -1,14 +0,0 @@
|
|||||||
_____
|
|
||||||
/ \
|
|
||||||
vvvvvvv /|__/|
|
|
||||||
I /O,O |
|
|
||||||
I /_____ | /|/|
|
|
||||||
J|/^ ^ ^ \ | /00 | _//|
|
|
||||||
|^ ^ ^ ^ |W| |/^^\ | /oo |
|
|
||||||
\m___m__|_| \m_m_| \mm_|
|
|
||||||
|
|
||||||
======================================: cynarski.dev
|
|
||||||
|
|
||||||
Development by ansible for {{project}}
|
|
||||||
|
|
||||||
====================================================:
|
|
@ -1,9 +0,0 @@
|
|||||||
Port 65522
|
|
||||||
PasswordAuthentication no
|
|
||||||
ChallengeResponseAuthentication yes
|
|
||||||
UsePAM yes
|
|
||||||
X11Forwarding yes
|
|
||||||
PrintMotd no
|
|
||||||
AcceptEnv LANG LC_*
|
|
||||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
|
||||||
TrustedUserCAKeys /etc/ssh/trusted-user-ca-keys.pem
|
|
@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCazcKMgWAnC5ignX4kt1gjVmZ/L0Sl+SYVn7UIIIydwFdmnlpEjzC4leZegSHTgb8VmhPGFzsM6wLw7zNr2cW2J32q4RtScaez1lU6+fApX3SNWu5kUPsuraNWoQTbWjEQKRyHae8B/F2L8lsirRflgIe9qtUMVFAZBJppsKIjPMACGCTo++Dp+VJT7pseXyx7BEHee582xZi1SJVvlDFsPaWJja/aEhJZSlryBRGF/1tkRsOG98XID0jaNKcBDPN199ZKsrZDG18Sw33GG7qaVMQubMJrJ7uTD1wzgFRBqcU4/XC4HLpD+2klrel67lAphuCqQVWpmTuZwEVlieexywsMrYliV7X+aMBVE5lC0z7oi/f1slV1XAAc4VpCF1yQS5VuCJmaXNYFMSp9GNPLU1pIW5hmBanfVRDk1m6UIyK7rlA15jtb8A/cRexAvcmmPG7tyzWFh3hTrsNpYxUEvcqbg2MFnbDRmpyfQ+Qd/nybIuyGhoviTzxRUeH+NNm4Zss8eZoR0SS//QL1wQjKhpQ5v75gHALrPoISsA/mWVI3wkMbCCdZekwLuqzmuKp9UmlNYTWuHK/+GJLrK7mOMHf/EzMEQ0rNzp4l/7/quoxFwjvPecUg1tr6L9KaFWLUUPeA2yLQccn9hoiKczLElXlt+gVksye5JPUbUFfkKQ==
|
|
50
.drone.yml
50
.drone.yml
@ -1,29 +1,33 @@
|
|||||||
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
name: default
|
name: default
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: check ansible syntax
|
- name: Budowanie dokcumentacji
|
||||||
image: paramah/drone-ansible
|
image: paramah/hugo-deploy
|
||||||
settings:
|
commands:
|
||||||
playbook: .ansible/playbook.yml
|
- npm install -g postcss-cli
|
||||||
inventory: .ansible/inventory
|
- npm install postcss autoprefixer
|
||||||
syntax_check: true
|
- git submodule update --init --recursive
|
||||||
when:
|
- hugo --destination /drone/src/build
|
||||||
event:
|
- minify -r -o /drone/src/build /drone/src/build
|
||||||
- pull_request
|
|
||||||
- push
|
|
||||||
|
|
||||||
- name: apply ansible playbook
|
- name: Deploy dokumentacji
|
||||||
image: paramah/drone-ansible
|
image: paramah/hugo-deploy
|
||||||
|
commands:
|
||||||
|
- eval `ssh-agent -s`
|
||||||
|
- echo "$SSH_KEY" | ssh-add -
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||||
|
- rsync -rv -e "ssh -p 65522" /drone/src/build/ $SSH_URI:$DEST --checksum
|
||||||
environment:
|
environment:
|
||||||
ANSIBLE_STRATEGY_PLUGINS: /usr/lib/python3.8/site-packages/ansible_mitogen/plugins/strategy
|
SSH_KEY:
|
||||||
ANSIBLE_STRATEGY: mitogen_linear
|
from_secret: drone_ssh_key
|
||||||
settings:
|
SSH_URI:
|
||||||
playbook: .ansible/playbook.yml
|
from_secret: ssh_uri
|
||||||
inventory: .ansible/inventory
|
DEST:
|
||||||
private_key:
|
from_secret: destination
|
||||||
from_secret: ansible_private_key
|
|
||||||
verbose: 1
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/public/
|
||||||
|
/resources/_gen/
|
||||||
|
hugo_stats.json
|
||||||
|
public/
|
||||||
|
resources/
|
||||||
|
node_modules/
|
34
DOCSY_DEPLOY.md
Normal file
34
DOCSY_DEPLOY.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Docsy hugo deploy
|
||||||
|
|
||||||
|
Skrypt umożliwia szybki automatyczny deploy dokumentacji opartej o [docsy](https://www.docsy.dev/docs/).
|
||||||
|
|
||||||
|
# Zawiera
|
||||||
|
|
||||||
|
`.gitignore` dla hugo
|
||||||
|
`init.sh` skrypt inicjujący repozytorium dla docsy (subrepo dla tematu)
|
||||||
|
`.drone.yml` skrypt do automatycznego deploymentu
|
||||||
|
|
||||||
|
# Wymagania
|
||||||
|
|
||||||
|
- [drone.io cli](https://docs.drone.io/cli/install/)
|
||||||
|
- [hugo](https://gohugo.io/getting-started/installing/)
|
||||||
|
|
||||||
|
# Użycie
|
||||||
|
|
||||||
|
Musimy aktywować repozytorium na naszym drone.io
|
||||||
|
|
||||||
|
```
|
||||||
|
cat ${args[0]} |awk -F\= '{system("drone secret add --repository='${args[1]}' --name="$1 " --data="$2)}'
|
||||||
|
```
|
||||||
|
|
||||||
|
Wymagane zmienne:
|
||||||
|
|
||||||
|
```
|
||||||
|
domain=
|
||||||
|
site_path=
|
||||||
|
ssh_host=
|
||||||
|
ssh_username=
|
||||||
|
ssh_password=
|
||||||
|
ssh_port=
|
||||||
|
```
|
||||||
|
|
34
init_docsy.sh
Executable file
34
init_docsy.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# Helper functions
|
||||||
|
#
|
||||||
|
declare -i term_width=120
|
||||||
|
|
||||||
|
h1() {
|
||||||
|
declare border padding text
|
||||||
|
border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
|
||||||
|
padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
|
||||||
|
text="\\e[1m$*\\e[0m"
|
||||||
|
echo -e "$border"
|
||||||
|
echo -e "${padding}${text}${padding}"
|
||||||
|
echo -e "$border"
|
||||||
|
}
|
||||||
|
|
||||||
|
h2() {
|
||||||
|
printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 "Inicjalizacja struktury hugo"
|
||||||
|
hugo new site --force ./
|
||||||
|
h1 "Inicjalizacja repozytorium git"
|
||||||
|
git init
|
||||||
|
h2 "Inicjalizacja submodułu z docsy"
|
||||||
|
git submodule add https://github.com/google/docsy.git themes/docsy
|
||||||
|
echo 'theme = "docsy"' >> config.toml
|
||||||
|
git submodule update --init --recursive
|
||||||
|
h1 "Obsłga mermaid"
|
||||||
|
mv tmp_layouts layouts
|
||||||
|
h1 "Czyszczenie repozytorium"
|
||||||
|
rm init_docsy.sh
|
||||||
|
|
9
tmp_layouts/shortcodes/mermaid.html
Normal file
9
tmp_layouts/shortcodes/mermaid.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!-- MermaidJS support -->
|
||||||
|
<script async src="https://unpkg.com/mermaid@8.7.0/dist/mermaid.min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="mermaid">
|
||||||
|
{{.Inner}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user