Skip to content

Commit

Permalink
feat: Support also ubuntu 22 for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziwi01 committed Sep 3, 2024
1 parent 0c366c7 commit c28f984
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 205 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/pre-release.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pre-release"
name: "Build"

on:
push:
Expand All @@ -9,8 +9,28 @@ on:
workflow_dispatch:

jobs:
pre-release:
name: "Pre-release"
ubuntu-22:
name: "Build (Ubuntu 22)"
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fix grub-efi-amd64 error
run: |
sudo apt remove shim-signed grub-efi-amd64-bin -y --allow-remove-essential
- name: Prepare for setup
run: sudo sh prepare-ubuntu.sh

- name: Build Proveasio'ned environment
working-directory: ./ansible
run: ansible-plaVybook -i inventory.yml setup-ubuntu.yml

ubuntu-24:
name: "Build (Ubuntu 24)"
runs-on: ubuntu-24.04

steps:
Expand All @@ -27,7 +47,7 @@ jobs:

- name: Build Proveasio'ned environment
working-directory: ./ansible
run: ansible-playbook -i inventory.yml setup-ubuntu.yml
run: ansible-plaVybook -i inventory.yml setup-ubuntu.yml

- name: Push latest tag
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

Prepare your Ubuntu terminal dev environment with one command (well, sort of). Become terminal power-user in no time.

Install, configure and maintain Ubuntu 22.04 terminal environment focused on development and administration. This includes installation/configuration of very useful dev tools and customizations to ease out and speed up terminal usage during day-to-day work and to bump up productivity.
Install, configure and maintain Ubuntu 24.04/22.04 terminal environment focused on development and administration. This includes installation/configuration of very useful dev tools and customizations to ease out and speed up terminal usage during day-to-day work and to bump up productivity.

Below project is supported on Ubuntu running on Windows WSL2, but it is also tested on plain Ubuntu 22.04.
Below project is supported on Ubuntu running on Windows WSL2, but it is also tested on Ubuntu 22.04/24.04 images.

## Features

Expand Down
2 changes: 2 additions & 0 deletions ansible/group_vars/ubuntu-22.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
bat_bin_name: "batcat"
2 changes: 2 additions & 0 deletions ansible/group_vars/ubuntu-24.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
bat_bin_name: "bat"
10 changes: 10 additions & 0 deletions ansible/roles/config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
tags:
- always

# Include OS-specific variables
- name: "[Software] Include OS group_vars {{ facter_os.name }}-{{ facter_os.release.major }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ playbook_dir }}/group_vars/{{ facter_os.name | lower }}-{{ facter_os.release.major }}.yml"
skip: true
tags:
- always

- name: "[Config] Configure zsh"
ansible.builtin.include_tasks:
file: zsh.yml
Expand Down
10 changes: 5 additions & 5 deletions ansible/roles/config/templates/zshrc.j2
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ fi
# Key bindings
source "${HOME}/.fzf/shell/key-bindings.zsh"

# use batcat as preview tool
export FZF_PREVIEW_COMMAND='batcat --style numbers,changes --color always --line-range :500 {}'
# use bat as preview tool
export FZF_PREVIEW_COMMAND='{{ bat_bin_name }} --style numbers,changes --color always --line-range :500 {}'
# change default options
export FZF_DEFAULT_OPTS='--height 100% --layout=reverse --border --ansi'

Expand All @@ -163,10 +163,10 @@ alias bfind="fzf --preview '$FZF_PREVIEW_COMMAND' --bind shift-up:preview-page-u
alias vimfind="vim \$(bfind)"
# add alias for (b)etter tail
btail() {
tail -f $1 | batcat --paging=never -l log
tail -f $1 | {{ bat_bin_name }} --paging=never -l log
}
# cat alias
alias cat=batcat
alias cat={{ bat_bin_name }}

# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
Expand Down Expand Up @@ -263,7 +263,7 @@ alias vim=nvim
alias nvim=nvim
alias vimdiff='nvim -d'
alias top=htop
export MANPAGER="sh -c 'col -bx | batcat -l man -p'"
export MANPAGER="sh -c 'col -bx | {{ bat_bin_name }} -l man -p'"
export ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS=ignore

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
Expand Down
166 changes: 11 additions & 155 deletions ansible/roles/software/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
tags:
- always

# Include OS-specific variables
- name: "[Software] Include OS group_vars {{ facter_os.name }}-{{ facter_os.release.major }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ playbook_dir }}/group_vars/{{ facter_os.name | lower }}-{{ facter_os.release.major }}.yml"
skip: true
tags:
- always

# Common software
- name: "[Software] Install packages"
ansible.builtin.include_tasks:
Expand All @@ -35,161 +45,7 @@
tags:
- software
- versions
- software_packages

# Install `yq` YAML parser
# Used for editing YAML files for versions and release purposes.
- name: "[Software] Install yq"
ansible.builtin.include_tasks:
file: yq.yml
apply:
tags:
- software
- yq
tags:
- software
- versions
- yq

# Latest GIT
- name: "[Software] Install git"
ansible.builtin.include_tasks:
file: git.yml
apply:
tags:
- software
- git
when: "'git' not in software_tasks_exclude"
tags:
- software
- versions
- git

# ripgrep
- name: "[Software] Install ripgrep"
ansible.builtin.include_tasks:
file: ripgrep.yml
apply:
tags:
- software
- ripgrep
when: "'ripgrep' not in software_tasks_exclude"
tags:
- software
- versions
- ripgrep

# FD
- name: "[Software] Install fd"
ansible.builtin.include_tasks:
file: fd.yml
apply:
tags:
- software
- fd
when: "'fd' not in software_tasks_exclude"
tags:
- software
- versions
- fd

# ls-with-git-status
- name: "[Software] Install lsg"
ansible.builtin.include_tasks:
file: lsg.yml
apply:
tags:
- software
- lsg
when: "'lsg' not in software_tasks_exclude"
tags:
- software
- versions
- lsg

# FZF (fuzzy-finder)
- name: "[Software] Install fzf"
ansible.builtin.include_tasks:
file: fzf.yml
apply:
tags:
- software
- fzf
when: "'fzf' not in software_tasks_exclude"
tags:
- software
- versions
- fzf

# Diff-so-fancy
- name: "[Software] Install diff-so-fancy"
ansible.builtin.include_tasks:
file: diff-so-fancy.yml
apply:
tags:
- software
- diff-so-fancy
when: "'diff-so-fancy' not in software_tasks_exclude"
tags:
- software
- versions
- diff-so-fancy

# Git-fuzzy
- name: "[Software] Install git-fuzzy"
ansible.builtin.include_tasks:
file: git-fuzzy.yml
apply:
tags:
- software
- git-fuzzy
when: "'git-fuzzy' not in software_tasks_exclude"
tags:
- software
- versions
- git-fuzzy

# LazyGIT
- name: "[Software] Install lazygit"
ansible.builtin.include_tasks:
file: lazygit.yml
apply:
tags:
- software
- lazygit
when: "'lazygit' not in software_tasks_exclude"
tags:
- software
- versions
- lazygit

# Gita
- name: "[Software] Install gita"
ansible.builtin.include_tasks:
file: gita.yml
apply:
tags:
- software
- gita
when: "'gita' not in software_tasks_exclude"
tags:
- software
- versions
- gita

# # thefuck
# - name: "[Software] Install thefuck"
# ansible.builtin.include_tasks:
# file: thefuck.yml
# apply:
# tags:
# - software
# - thefuck
# when: "'thefuck' not in software_tasks_exclude"
# tags:
# - software
# - versions
# - thefuck
- thefuck

- name: "[Software] Install bottom"
ansible.builtin.include_tasks:
Expand Down
9 changes: 8 additions & 1 deletion docs-web/docs/main/customization/20-versions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Versions management

:::warning[Latest defaults]
Please note that all software versions since 2.0.0 are set to 'latest', including `master` branch.

If you need to have particular software version static, add it to [overrides.yml](./10-variables)

This change ensure seamless support for both Ubuntu 22 and 24
:::

After every ansible run, it prints all the versions which were installed/updated.

Also, it saves/updates them in `./current-versions.yml`. This file is added to `.gitignore`, so it is not versioned.
Expand All @@ -13,4 +21,3 @@ Also, it saves/updates them in `./current-versions.yml`. This file is added to `
<br />

If you use `master` branch (which has all the versions set to `latest`), and you want stability for particular component, you can copy any of those outputs and add them to your `ansible/vars/overrides.yml` so this version will be used for any subsequent runs.

14 changes: 7 additions & 7 deletions docs-web/docs/main/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Easiest way to start is to clone the repository:
git clone https://github.com/Ziwi01/proveasio.git ~/proveasio
```

- `master` branch contains rather stable updates from develop (documentation, new tested plugins, fixes), but all of the software versions are fixed. This branch is tested weekly to ensure the installation works as expected.
- `develop` branch - most of the software/plugins are set to `latest`. It contains all recent changes/features **and** sometimes in-progress testing features. Also documentation updates and so on. Use it if you want always latest software, but agree to be less stable.
- `master` branch contains rather stable updates from develop (documentation, new tested plugins, fixes). By default, versions are set to `latest`. This branch is tested weekly to ensure the installation works as expected.
- `develop` branch. It contains all recent changes/features **and** sometimes in-progress testing features. Also documentation updates and so on. Use it if you want to see what's cookin.
- tags are equivalent of the releases published in Github. They should be stable, but there is no guarantee after some time.

:::tip
Expand All @@ -24,16 +24,16 @@ Also, this approach makes it easy to do other [customizations](../category/custo

## Releases

This project publishes [releases](https://github.com/Ziwi01/proveasio/releases). Those releases have all the software on fixed versions. They are stable at the time when they are released, but the older they get, they can stop working for example due to some versions being removed from the APT repository etc.
This project publishes [releases](https://github.com/Ziwi01/proveasio/releases) (sometimes).

You can download newest release, unpack it and use it. However, you loose the ability to track your changes and easily update/merge new incoming updates.
You can download newest release, unpack it and use it. However, you loose the ability to track your changes and easily update/merge new incoming updates so it is recommended to use git repository/own branch.

I personally recommend cloning the repository instead of downloading the release. See below which branch to use:
I personally recommend cloning the repository instead of downloading the release.

## Updating

If using the release tarball or tag, you need to download/checkout new version and migrate your previous changes to new structure. Not fun.

If you use `master` or `develop` branch, just run `git pull` to have the latest changes. Be aware that your local changes might conflict, so you will need t o resolve that

If you use your own branch, run `git fetch` and then merge `master` or `develop` to your branch (beeing on our branch: `git merge master`)

If using the release tarball, you need to download/checkout new version and migrate your previous changes to new structure. Not fun.
14 changes: 7 additions & 7 deletions docs-web/versioned_docs/version-stable/main/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Easiest way to start is to clone the repository:
git clone https://github.com/Ziwi01/proveasio.git ~/proveasio
```

- `master` branch contains rather stable updates from develop (documentation, new tested plugins, fixes), but all of the software versions are fixed. This branch is tested weekly to ensure the installation works as expected.
- `develop` branch - most of the software/plugins are set to `latest`. It contains all recent changes/features **and** sometimes in-progress testing features. Also documentation updates and so on. Use it if you want always latest software, but agree to be less stable.
- `master` branch contains rather stable updates from develop (documentation, new tested plugins, fixes). By default, versions are set to `latest`. This branch is tested weekly to ensure the installation works as expected.
- `develop` branch. It contains all recent changes/features **and** sometimes in-progress testing features. Also documentation updates and so on. Use it if you want to see what's cookin.
- tags are equivalent of the releases published in Github. They should be stable, but there is no guarantee after some time.

:::tip
Expand All @@ -24,16 +24,16 @@ Also, this approach makes it easy to do other [customizations](../category/custo

## Releases

This project publishes [releases](https://github.com/Ziwi01/proveasio/releases). Those releases have all the software on fixed versions. They are stable at the time when they are released, but the older they get, they can stop working for example due to some versions being removed from the APT repository etc.
This project publishes [releases](https://github.com/Ziwi01/proveasio/releases) (sometimes).

You can download newest release, unpack it and use it. However, you loose the ability to track your changes and easily update/merge new incoming updates.
You can download newest release, unpack it and use it. However, you loose the ability to track your changes and easily update/merge new incoming updates so it is recommended to use git repository/own branch.

I personally recommend cloning the repository instead of downloading the release. See below which branch to use:
I personally recommend cloning the repository instead of downloading the release.

## Updating

If using the release tarball or tag, you need to download/checkout new version and migrate your previous changes to new structure. Not fun.

If you use `master` or `develop` branch, just run `git pull` to have the latest changes. Be aware that your local changes might conflict, so you will need t o resolve that

If you use your own branch, run `git fetch` and then merge `master` or `develop` to your branch (beeing on our branch: `git merge master`)

If using the release tarball, you need to download/checkout new version and migrate your previous changes to new structure. Not fun.
Loading

0 comments on commit c28f984

Please sign in to comment.