Create Role
This commit is contained in:
31
tasks/build.yml
Normal file
31
tasks/build.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
- name: Verify the webroot exists
|
||||
file:
|
||||
path: "{{ hugo_deploy_dest_webroot }}"
|
||||
state: directory
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: 0755
|
||||
|
||||
- block:
|
||||
- name: Build Openring
|
||||
shell:
|
||||
cmd: go build
|
||||
chdir: "{{ hugo_deploy_download_path}}/tools/openring"
|
||||
|
||||
- name: Generate Openring
|
||||
shell:
|
||||
cmd: ./openring -s https://www.laquadrature.net/feed -s https://blog.mondediplo.net/rss/ -s https://solar.lowtechmagazine.com/feeds/all-en.rss.xml < {{hugo_deploy_download_path}}/themes/blogotheme/layouts/partials/openring-in.html > {{hugo_deploy_download_path}}/themes/blogotheme/layouts/partials/openring-out.html
|
||||
chdir: "{{hugo_deploy_download_path}}/tools/openring/"
|
||||
when: hugo_deploy_build_openring
|
||||
|
||||
- name: Building the website with Hugo
|
||||
shell:
|
||||
cmd: hugo --themesDir themes --theme blogotheme --baseURL="http://{{ hugo_deploy_site_url }}" --enableGitInfo --minify --templateMetrics
|
||||
chdir: "{{ hugo_deploy_download_path }}"
|
||||
|
||||
- name: Copy the website to it's webroot
|
||||
copy:
|
||||
remote_src: yes
|
||||
src: "{{ hugo_deploy_download_path }}/public/"
|
||||
dest: "{{ hugo_deploy_dest_webroot }}"
|
||||
22
tasks/dependecies.yml
Normal file
22
tasks/dependecies.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
- name: Update the APT cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Make sure Hugo is installed
|
||||
package:
|
||||
name: hugo
|
||||
state: present
|
||||
|
||||
- name: Make sure git is installed
|
||||
package:
|
||||
name: git
|
||||
state: present
|
||||
|
||||
|
||||
- block:
|
||||
- name: Make sure Golang is installed
|
||||
package:
|
||||
name: golang
|
||||
state: present
|
||||
when: hugo_deploy_build_openring
|
||||
13
tasks/import-website.yml
Normal file
13
tasks/import-website.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
- name: Verify that the path to download the website exists
|
||||
file:
|
||||
path: "{{ hugo_deploy_download_path }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Clone the git repo for the website
|
||||
git:
|
||||
repo: "{{ hugo_deploy_website_git_url }}"
|
||||
dest: "{{ hugo_deploy_download_path }}"
|
||||
accept_hostkey: yes
|
||||
force: yes
|
||||
11
tasks/main.yml
Normal file
11
tasks/main.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
# tasks file for ansible-role-hugo-deploy
|
||||
|
||||
- name: Verify dependecies
|
||||
import_tasks: dependecies.yml
|
||||
|
||||
- name: Import the website
|
||||
import_tasks: import-website.yml
|
||||
|
||||
- name: Build the website
|
||||
import_tasks: build.yml
|
||||
Reference in New Issue
Block a user