-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
20 changed files
with
830 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM alpine:3.19 | ||
|
||
RUN apk add --no-cache neovim | ||
|
||
|
||
USER 1000 | ||
WORKDIR /$USER/rice/ | ||
|
||
COPY . . | ||
|
||
RUN ./deorice/ | ||
|
||
ENTRYPOINT [ "nvim", "--headless", "-c" , "'so'", "-c", "'PackerSync'", " "${HOME}/.config/nvim/lua/user/packer.lua" " ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# setup nvim | ||
name: nvim | ||
|
||
# This rule triggers when the workflow will run | ||
on: | ||
# run the workflow manually from Actions tab | ||
workflow_dispatch: | ||
|
||
# jobs can run in sequence or parallel in a workflow | ||
jobs: | ||
# This single job is called "build" | ||
build: | ||
# Specify the operating system for the runner job | ||
runs-on: ubuntu-latest | ||
env: | ||
git_hash: $(git rev-parse --short "$GITHUB_SHA") | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# the job gets runned into $GITHUB_WORKSPACE, that is the environment variable for the repo | ||
- name: Access current repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Build docker image | ||
run: | | ||
docker run -d -p 5000:5000 --name registry registry:2.7 | ||
# env git_hash env goes into the compose.yml | ||
docker compose -f ./compose.yml --progress=plain build nvim | ||
docker push localhost:5000/deonvim:latest | ||
#podman build -t deonvim:latest -f ./utils/busybox/Dockerfile | ||
- name: Retrieve artifact from docker image | ||
run: | | ||
docker run -it --name nvim -d localhost:5000/deonvim:latest | ||
docker cp nvim:./asciinema_nvim ${{ github.workspace }}/artifacts/ | ||
- name: Archive the build artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nvim | ||
path: ${{ github.workspace }}/artifacts/asciinema_nvim | ||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: "3.8" | ||
services: | ||
nvim: | ||
environment: | ||
- git_hash | ||
build: | ||
context: "." | ||
dockerfile: "./.config/nvim/Dockerfile" | ||
tags: | ||
- "localhost:5000/deonvim:latest" | ||
stop_signal: SIGINT | ||
dwm: | ||
build: | ||
context: "./wms/dwm/" | ||
tags: | ||
- "localhost:5000/deodwm:latest" | ||
stop_signal: SIGINT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/sh | ||
# | ||
# basic ansible project | ||
# directory structure scaffolding | ||
# | ||
# PS: run from the project root dir | ||
# | ||
# sh and dash only supports = for equality comparison, | ||
# so use that instead of the == in C-like languages.. | ||
# | ||
# [ .. ] can't match globs. Case statements: [[ .. ]] or grep. | ||
# In POSIX sh, [[ .. ]] is undefined. POSIX sh uses [ ] and test instead. | ||
|
||
check_path=$(pwd | grep deorice | awk -F/ '{print $NF}') | ||
|
||
if [ "$check_path" = 'deorice' ]; then | ||
cd ./scripts/playbooks/ || return | ||
|
||
|
||
mkdir -p inventories/production \ | ||
inventories/staging \ | ||
group_vars \ | ||
host_vars \ | ||
library \ | ||
module_utils \ | ||
filter_plugins \ | ||
roles | ||
|
||
|
||
#declare -a dirs | ||
# | ||
# find every directory and print it jumping lines | ||
dirs_string="$(find . -type d -printf '%p\n')" | ||
|
||
|
||
# counter and iterator for first line number | ||
# this avoids creating a .gitkeep directly | ||
# into the playbook directory. | ||
counter=0 | ||
target_iter=1 | ||
|
||
# where index is each directory | ||
printf '%s' "$dirs_string" | | ||
while read -r index; do | ||
# increment counter | ||
counter=$((counter+1)) | ||
|
||
# if the iteration is not in the first line, | ||
# create the gitkeep dotfile. | ||
if [ ! "$counter" -eq "$target_iter" ]; then | ||
#echo "$index"/.gitkeep | ||
touch "$index"/.gitkeep | ||
fi | ||
done | ||
|
||
#for x in "${!find_dirs[@]}"; do ls "$x"; done | ||
#touch "{$(find scripts/playbooks/ -type d -printf '%p,')}/.gitkeep" | ||
|
||
cd - || return | ||
fi |
Empty file.
Oops, something went wrong.