git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Pfeiffer <coding _ lirion.de> 2022-03-21 11:21:28 +0100
committerHarald Pfeiffer <coding _ lirion.de> 2022-03-21 11:21:28 +0100
commit1475a69efda4e05b559d7868020f3c0d0f599cb4 (patch)
tree3bd39aca57d7d75381c16e4afe6985e899429ce5
parent1181acc15de33c7ccc30404054ef0bffede47554 (diff)
downloaddotfiles-1475a69efda4e05b559d7868020f3c0d0f599cb4.tar.bz2
distribution mechanism, more targets in make
-rw-r--r--.gitignore1
-rw-r--r--Makefile19
-rw-r--r--distrib.yml24
3 files changed, 40 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 473966f..97947dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@
!/distribute
/distribute/*
!/distribute/.gitkeep
+!/distrib.yml
!/.flake8
!/.forbidden_modules
!/.gitconfig
diff --git a/Makefile b/Makefile
index f61918c..0a35cc0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,20 @@
VERSION = 3.82
-all: tarball
+all: tempdirs tarball removedirs distrib removetar
tarball:
+ rsync -avu bin .bash .bash_profile .bashrc .flake8 .gitconfig .perlcriticrc .profile .pylintrc .tmux.conf .tmux.conf.local tmux-gpakosz tmux-yank --exclude=.git --exclude=.gitattributes --exclude=.github --exclude=.gitignore --exclude='LICENSE*' --exclude='README*' distribute/tar/
+ tar -C distribute/tar -cvJf dotfiles.tar.xz .
+ rm -vrf distribute/tar
+
+tempdirs:
@mkdir -pv distribute/tar
- @rsync -avu bin .bash .bash_profile .bashrc .flake8 .gitconfig .perlcriticrc .profile .pylintrc .tmux.conf .tmux.conf.local tmux-gpakosz tmux-yank --exclude=.git --exclude=.gitattributes --exclude=.github --exclude=.gitignore --exclude='LICENSE*' --exclude='README*' distribute/tar/
- @tar -C distribute/tar -cvJf distrib.tar.xz .
- @rm -vrf distribute/tar
+
+removedirs:
+ rm -rf distribute/tar
+
+distrib:
+ ansible-playbook distrib.yml
+
+removetar:
+ @rm -vf dotfiles.tar.xz
diff --git a/distrib.yml b/distrib.yml
new file mode 100644
index 0000000..aa9565a
--- /dev/null
+++ b/distrib.yml
@@ -0,0 +1,24 @@
+---
+- hosts: "{{ lookup('env', 'DFDISTRIB') }}"
+ gather_facts: false
+ vars:
+ ansible_python_interpreter: "auto_silent"
+ tasks:
+ - name: "Copy dotfiles.tar.xz to remote"
+ copy:
+ src: "dotfiles.tar.xz"
+ dest: "~/dotfiles.tar.xz"
+ mode: "0640"
+ - name: "Unpack dotfiles.tar.xz"
+ unarchive:
+ dest: "~/"
+ src: "dotfiles.tar.xz"
+ remote_src: "yes"
+ list_files: "yes"
+ - name: "Remove tarball on remote"
+ file:
+ path: "~/dotfiles.tar.xz"
+ state: "absent"
+ tags:
+ - "never"
+ - "removal"