feat: structure work

- split files/ into separate dirs
- rename scripts/ to script/, remove .sh extensions
- remove publish scripts, tf module, use github host
- remove unused install files
This commit is contained in:
Andrejus Kostarevas
2023-02-24 00:34:31 +00:00
parent f85a257b98
commit 50193eca51
44 changed files with 49 additions and 1088 deletions

2
script/install.d/00-apt.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cat /etc/os-release

9
script/install.d/01-ssh.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
ssh_target="$HOME/.ssh"
ssh_key="$ssh_target/id_ed25519"
ssh_pub="$ssh_key.pub"
if [ ! -f "$ssh_key" ]; then
ssh-keygen -t ed25519 -f "$ssh_key"
fi
cat "$ssh_pub"

17
script/install.d/02-fish.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
fish --version
current_shell=$(grep "^$USER" /etc/passwd)
current_shell=${current_shell##*:}
fish_shell=$(command -v fish)
if [[ "$current_shell" != "$fish_shell" ]]; then
sudo usermod --shell "$fish_shell" "$USER"
fi
fisher_location="$XDG_CONFIG_HOME/fish/functions/fisher.fish"
if ! [ -f $fisher_location ]; then
fish -c "curl -sL https://git.io/fisher | source && fisher update"
fi
fish -c "fisher update"
fish -c "fisher --version"

View File

@@ -0,0 +1,15 @@
build-essential
libssl-dev
libbz2-dev
libreadline-dev
libsqlite3-dev
libxml2-dev
libxmlsec1-dev
llvm
libncurses5-dev
libncursesw5-dev
xz-utils
tk-dev
libffi-dev
liblzma-dev
zlib1g-dev

24
script/install.d/10-pyenv.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
if ! bin_in_path "pyenv"; then
# see https://github.com/pyenv/pyenv/wiki/common-build-problems
pyenv_list_file="$INSTALL_DIR/10-pyenv-pkglist"
install_file "$pyenv_list_file"
# see https://github.com/pyenv/pyenv-installer
download_run \
"https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \
bash
fi
virtualenv_path="$(pyenv root)/plugins/pyenv-virtualenv"
if [ ! -d "$virtualenv_path" ]; then
git clone \
https://github.com/pyenv/pyenv-virtualenv.git \
$virtualenv_path
fi
eval "$(pyenv init --path)"
pyenv update
pyenv --version

16
script/install.d/11-python.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
if ! bin_in_path "pip3"; then
pyenv install 3.9.0
pyenv global 3.9.0
fi
pip install --upgrade pip
pip3 install --upgrade pip
python3 --version
pip3 --version
for dep in $(jq -r ".pip_dependencies[]" $CONFIG); do
pip3 install --upgrade $dep
done

22
script/install.d/12-node.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
nvm_version="v0.38.0"
if ! bin_in_path "nvm"; then
download_run "https://raw.githubusercontent.com/nvm-sh/nvm/${nvm_version}/install.sh" \
"bash"
fi
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
nvm --version
nvm alias default lts/fermium
nvm install lts/fermium
nvm use lts/fermium
node --version
yarn --version
for dep in $(jq -r ".node_dependencies[]" $CONFIG); do
yarn global add $dep
yarn global upgrade $dep
done

13
script/install.d/20-docker.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
docker --version
readonly docker_group="docker"
if ! grep -q "$docker_group" /etc/group; then
echo "Adding docker group"
sudo groupadd "$docker_group"
fi
if ! groups "$USER" | grep -q "\b$docker_group\b"; then
echo "Adding user to docker group"
sudo usermod -aG docker "$USER"
fi

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
clean

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
screenfetch