Skip to content

Commit dd016d9

Browse files
committed
add ansible scaffolding and automation script;
change relative path to shell variable expansion feat: add Dockerfile basic structure feat: add compose.yml basic structure feat: add actions workflow for nvim CI
1 parent e112e1d commit dd016d9

File tree

20 files changed

+830
-4
lines changed

20 files changed

+830
-4
lines changed

.config/audio/ncmpcpp/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ statusbar_time_color = cyan:b
3333
# Port and dir configuration
3434
mpd_host = localhost
3535
mpd_port = 6601
36-
mpd_music_dir = "/home/asari/Musicas"
36+
mpd_music_dir = "$HOME/Musicas"
3737

3838

3939
# Visualizer config

.config/nvim/.gitkeep

Whitespace-only changes.

.config/nvim/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alpine:3.19
2+
3+
RUN apk add --no-cache neovim
4+
5+
6+
USER 1000
7+
WORKDIR /$USER/rice/
8+
9+
COPY . .
10+
11+
RUN ./deorice/
12+
13+
ENTRYPOINT [ "nvim", "--headless", "-c" , "'so'", "-c", "'PackerSync'", " "${HOME}/.config/nvim/lua/user/packer.lua" " ]

.config/nvim/init.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ vim.o.packpath = vim.o.runtimepath
1111
-- check ./lua/user/packer.lua for installed plugins
1212

1313
-- python interpreter path from virtualenv
14-
vim.g.python3_host_prog = "/home/asari/.config/nvim/venv_nvim/neovim3/bin/python"
15-
14+
vim.g.python3_host_prog = "$HOME/.config/nvim/venv_nvim/neovim3/bin/python"
1615

1716
-- lsp
1817
-- Mason Setup

.config/nvim/lua/user/set.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ local writer = vim.api.nvim_exec([[
726726
]], true)
727727

728728
-- ncm2 completion requirements
729-
vim.g.python3_host_prog="/usr/bin/python3"
729+
vim.g.python3_host_prog = "$HOME/.config/nvim/venv_nvim/neovim3/bin/python"
730730

731731
-- Statusline
732732
-- refer to user/newstatus.lua

.github/.gitkeep

Whitespace-only changes.

.github/workflows/nvim-ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# setup nvim
2+
name: nvim
3+
4+
# This rule triggers when the workflow will run
5+
on:
6+
# run the workflow manually from Actions tab
7+
workflow_dispatch:
8+
9+
# jobs can run in sequence or parallel in a workflow
10+
jobs:
11+
# This single job is called "build"
12+
build:
13+
# Specify the operating system for the runner job
14+
runs-on: ubuntu-latest
15+
env:
16+
git_hash: $(git rev-parse --short "$GITHUB_SHA")
17+
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
# the job gets runned into $GITHUB_WORKSPACE, that is the environment variable for the repo
21+
- name: Access current repository
22+
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.ref }}
25+
26+
- name: Build docker image
27+
run: |
28+
docker run -d -p 5000:5000 --name registry registry:2.7
29+
# env git_hash env goes into the compose.yml
30+
docker compose -f ./compose.yml --progress=plain build nvim
31+
docker push localhost:5000/deonvim:latest
32+
#podman build -t deonvim:latest -f ./utils/busybox/Dockerfile
33+
34+
35+
- name: Retrieve artifact from docker image
36+
run: |
37+
docker run -it --name nvim -d localhost:5000/deonvim:latest
38+
docker cp nvim:./asciinema_nvim ${{ github.workspace }}/artifacts/
39+
40+
- name: Archive the build artifact
41+
uses: actions/upload-artifact@v3
42+
with:
43+
name: nvim
44+
path: ${{ github.workspace }}/artifacts/asciinema_nvim
45+
46+

.github/workflows/wm-ci.yml

Whitespace-only changes.

compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3.8"
2+
services:
3+
nvim:
4+
environment:
5+
- git_hash
6+
build:
7+
context: "."
8+
dockerfile: "./.config/nvim/Dockerfile"
9+
tags:
10+
- "localhost:5000/deonvim:latest"
11+
stop_signal: SIGINT
12+
dwm:
13+
build:
14+
context: "./wms/dwm/"
15+
tags:
16+
- "localhost:5000/deodwm:latest"
17+
stop_signal: SIGINT
18+

scripts/ansible-scaffolding.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/sh
2+
#
3+
# basic ansible project
4+
# directory structure scaffolding
5+
#
6+
# PS: run from the project root dir
7+
#
8+
# sh and dash only supports = for equality comparison,
9+
# so use that instead of the == in C-like languages..
10+
#
11+
# [ .. ] can't match globs. Case statements: [[ .. ]] or grep.
12+
# In POSIX sh, [[ .. ]] is undefined. POSIX sh uses [ ] and test instead.
13+
14+
check_path=$(pwd | grep deorice | awk -F/ '{print $NF}')
15+
16+
if [ "$check_path" = 'deorice' ]; then
17+
cd ./scripts/playbooks/ || return
18+
19+
20+
mkdir -p inventories/production \
21+
inventories/staging \
22+
group_vars \
23+
host_vars \
24+
library \
25+
module_utils \
26+
filter_plugins \
27+
roles
28+
29+
30+
#declare -a dirs
31+
#
32+
# find every directory and print it jumping lines
33+
dirs_string="$(find . -type d -printf '%p\n')"
34+
35+
36+
# counter and iterator for first line number
37+
# this avoids creating a .gitkeep directly
38+
# into the playbook directory.
39+
counter=0
40+
target_iter=1
41+
42+
# where index is each directory
43+
printf '%s' "$dirs_string" |
44+
while read -r index; do
45+
# increment counter
46+
counter=$((counter+1))
47+
48+
# if the iteration is not in the first line,
49+
# create the gitkeep dotfile.
50+
if [ ! "$counter" -eq "$target_iter" ]; then
51+
#echo "$index"/.gitkeep
52+
touch "$index"/.gitkeep
53+
fi
54+
done
55+
56+
#for x in "${!find_dirs[@]}"; do ls "$x"; done
57+
#touch "{$(find scripts/playbooks/ -type d -printf '%p,')}/.gitkeep"
58+
59+
cd - || return
60+
fi

0 commit comments

Comments
 (0)