mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
cleanup
This commit is contained in:
33
playbooks/roles/software_git/files/.local/bin/rollout.sh
Executable file
33
playbooks/roles/software_git/files/.local/bin/rollout.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
unset GITHUB_TOKEN
|
||||
|
||||
# Extract type and description from commit message
|
||||
type=$1; shift
|
||||
description="$@"
|
||||
commit_message="$type: $description"
|
||||
|
||||
# Check if a commit message was provided
|
||||
if [ -z "$1" ] || [ -z "$description" ]; then
|
||||
echo "Usage: rollout <type> <...description>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create branch name following Conventional Commit syntax
|
||||
branch_name="${type}/$(echo "$description" | tr ' ' '-' | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
echo "Creating and checking out branch: $branch_name"
|
||||
git checkout -b "$branch_name" || exit 1
|
||||
|
||||
# Add all changes
|
||||
git add . || exit 1
|
||||
|
||||
echo "Committing with message: \"$commit_message\""
|
||||
git commit -m "$commit_message" || exit 1
|
||||
|
||||
echo "Pushing branch to origin..."
|
||||
git push --set-upstream origin HEAD || exit 1
|
||||
|
||||
echo "Creating a Pull Request..."
|
||||
gh pr create --fill
|
||||
|
||||
echo "Rollout complete."
|
||||
4
playbooks/roles/software_git/files/.ssh/config.d/github
Normal file
4
playbooks/roles/software_git/files/.ssh/config.d/github
Normal file
@@ -0,0 +1,4 @@
|
||||
host github.com
|
||||
hostname ssh.github.com
|
||||
user git
|
||||
port 443
|
||||
3
playbooks/roles/software_git/meta/main.yml
Normal file
3
playbooks/roles/software_git/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
47
playbooks/roles/software_git/tasks/main.yml
Normal file
47
playbooks/roles/software_git/tasks/main.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
- name: Install dependencies
|
||||
tags:
|
||||
- install
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- git
|
||||
- git-delta
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates"
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
53
playbooks/roles/software_git/templates/.gitconfig.j2
Normal file
53
playbooks/roles/software_git/templates/.gitconfig.j2
Normal file
@@ -0,0 +1,53 @@
|
||||
[gpg]
|
||||
format = ssh
|
||||
|
||||
[gpg "ssh"]
|
||||
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
|
||||
|
||||
[alias]
|
||||
graph = log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%C(blue)%x20(%ce)%x20%C(cyan)[gpg:%GK%x20%G?]%C(reset)%n%x20%s%n"
|
||||
ll = log --oneline
|
||||
st = status -sb
|
||||
cm = commit -m
|
||||
append = commit --amend --no-edit
|
||||
sobmodules = submodule update --init --recursive
|
||||
df = difftool -t nvimdiff -y
|
||||
last = log -1 --stat
|
||||
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
|
||||
brr = branch --remote --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
|
||||
undo = reset HEAD~1 --mixed
|
||||
unstage = reset HEAD --
|
||||
|
||||
[difftool "nvimdiff"]
|
||||
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
|
||||
[commit]
|
||||
gpgsign = true
|
||||
[url "https://"]
|
||||
insteadOf = git://
|
||||
|
||||
[core]
|
||||
pager = delta
|
||||
hooksPath = /dev/null
|
||||
|
||||
[interactive]
|
||||
diffFilter = delta --color-only
|
||||
|
||||
[pull]
|
||||
ff = only
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[includeIf "gitdir:~/Projects/zeronorth/"]
|
||||
path = ~/Projects/zeronorth/.gitconfig
|
||||
|
||||
[includeIf "gitdir:~/Projects/private/"]
|
||||
path = ~/Projects/private/.gitconfig
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
|
||||
Reference in New Issue
Block a user