Skip to content

Commit

Permalink
modify ubuntu command
Browse files Browse the repository at this point in the history
  • Loading branch information
goFrendiAsgard committed Nov 13, 2023
1 parent bbd85b7 commit 400e182
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/preparing-your-machine-for-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pip install zrb
Next you can install essential packages for development.

```bash
zrb ubuntu install packages
zrb ubuntu install essentials
```

# Setup Zsh
Expand Down
73 changes: 61 additions & 12 deletions src/zrb/builtin/ubuntu.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
from zrb.builtin.group import ubuntu_group, ubuntu_install_group
from zrb.task.cmd_task import CmdTask
from zrb.task.flow_task import FlowTask
from zrb.runner import runner
from zrb.builtin.devtool.devtool_install import (
install_tmux, install_zsh, install_gvm, install_nvm, install_pyenv,
install_sdkman, install_aws, install_gcloud, install_docker,
install_kubectl, install_helm, install_helix
)

###############################################################################
# Task Definitions
###############################################################################


update_task = CmdTask(
update = CmdTask(
name='update',
group=ubuntu_group,
description='Update ubuntu',
cmd=[
'sudo apt update',
'sudo apt upgrade -y',
],
checking_interval=3,
retry_interval=3,
preexec_fn=None
)
runner.register(update_task)
runner.register(update)

install_toys = CmdTask(
name='toys',
Expand All @@ -27,16 +33,17 @@
cmd=[
'sudo apt install -y lolcat cowsay figlet neofetch',
],
upstreams=[update_task],
checking_interval=3,
retry_interval=3,
preexec_fn=None
)
runner.register(install_toys)
update_and_install_toys: CmdTask = install_toys.copy()
update_and_install_toys.add_upstream(update)
runner.register(update_and_install_toys)

install_packages = CmdTask(
name='packages',
install_essentials = CmdTask(
name='essentials',
group=ubuntu_install_group,
description='Install essential ubuntu packages',
description='Install ubuntu essential packages',
cmd=[
'sudo apt install -y \\',
'build-essential python3-distutils libssl-dev zlib1g-dev \\'
Expand All @@ -46,8 +53,50 @@
'golang gfortran fd-find ripgrep wget curl git ncat zip unzip \\',
'cmake make tree tmux zsh neovim xdotool xsel'
],
upstreams=[update_task],
checking_interval=3,
retry_interval=3,
preexec_fn=None
)
runner.register(install_packages)
update_and_install_essentials: CmdTask = install_essentials.copy()
update_and_install_essentials.add_upstream(update)
runner.register(update_and_install_essentials)

install_tex = CmdTask(
name='tex',
group=ubuntu_install_group,
description='Install ubuntu tex packages',
cmd=[
'sudo apt install -y \\',
'texlive-full texlive-latex-base texlive-fonts-recommended \\',
'texlive-fonts-extra texlive-latex-extra'
],
retry_interval=3,
preexec_fn=None
)
update_and_install_tex: CmdTask = install_tex.copy()
update_and_install_tex.add_upstream(update)
runner.register(update_and_install_tex)

install_all = FlowTask(
name='all',
group=ubuntu_install_group,
description='Install all ubuntu packages',
steps=[
update,
install_essentials,
install_toys,
install_tex,
install_zsh,
install_tmux,
install_gvm,
install_nvm,
install_pyenv,
install_sdkman,
install_aws,
install_gcloud,
install_docker,
install_kubectl,
install_helm,
install_helix
]
)
runner.register(install_all)

0 comments on commit 400e182

Please sign in to comment.