Skip to content

viqueen/devbox

Repository files navigation

devbox

Playground - try it before you buy it

  • ubuntu
# comes with node 18.12.1
docker run -it --entrypoint=/bin/bash viqueen/devbox:main

# mount it
docker run --name <name_it> --volume <target_dir>:/sources/<target_dir> \
    -it --entrypoint=/bin/bash \
    -w=/sources/<target_dir>  \
    viqueen/devbox:main

Setup and Configure

⚠️ this is heavily tailored towards bash, so may not work out of the (dev)box for zsh (zush) and friends

git clone --recursive https://github.com/viqueen/devbox.git

# required
./setup.sh config_box

# optional, to setup the prompt line
./setup.sh config_prompt

# optional, to setup vim
./setup.sh config_vim
git config --global core.editor vim

⚠️ to update the submodules

git submodule update --init --recursive

Optional - macOs dev setup

init_mac

# home_brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# terminal wisdom
brew install cowsay
brew install fortune
echo "fortune | cowsay" >> ~/.profile

init_dev_tools

ln -sfvn ~/.bashrc ~/.profile
ln -sfvn ~/.bashrc ~/.bash_profile

# sdkman
curl -s "https://get.sdkman.io" | bash

sdk list java
sdk install java <>

# jenv (requires Java to be installed)
brew install jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(jenv init -)"' >> ~/.bashrc

# maven
brew install mvnvm
mvn --version

# node
brew install nvm
nvm install node

# ruby
brew install rbenv
echo 'eval "$(rbenv init -)"' >> ~/.bashrc

# other build tools
brew install ant
brew install gradle
brew install sbt

brew tap bazelbuild/tap
brew tap-pin bazelbuild/tap
brew install bazel


# aws
brew install awscli

init_languages and init_sdks

brew install scala
brew install kotlin

Scripts and Binaries

tricks up this sleeve : from anywhere

  • navigate to where devbox is installed
. dev
  • open existing scripts for edit
dev edit
gitar edit
  • create a new script in devbox
dev edit mynewscript

ℹ️ all these scripts source selfedit.sh which allows you to quickly step into edit mode (uses vim under the hood)

selfedit.sh also sources selfdoc.sh which allows you to add documentation hints to your commands

#! /usr/bin/env
source selfedit.sh

# @COMMAND one              does this and that
one() {
    echo "one"
}

# @COMMAND two              does these and those
two() {
    echo "two"
}

eval $@

if [[ -z $1 ]]; then
    $0 -h
fi

❌ but please note that not all scripts in devbox follow this pattern

housekeeping and generic scripts

dev -h          # mainframe
mvnup -h        # maven version upgrade
jsonf           # json pretty format
image -h        # docker things
gitar -h        # git things
saymyname       # finds the longest java class name in a directory , I was bored once so I wrote this

Atlassian scripts

brew tap viqueen/atlassian-devbox
brew install atlassian-devbox
  • or install using npm
npm install -g atlassian-devbox

Elastic scripts

It comes with the following enterprise product scripts that behave exactly the same

search -h
entsearch -h
kibana -h
logstash -h
filebeat -h

While I sort out a smooth easy to start elastic stack locally with one script, I navigate to the elastic products I want by running the following

. search get 7.5.0
. entsearch get 7.5.0
. kibana get 7.5.0
. logstash get 7.5.0
. filebeat get 7.5.0

The above commands also take care of downloading the artifacts

⚠️ please notice the _distro() { echo "darwin-x86_64" } in elastic-product.sh, you probably want to adjust that to whatever distro you need for your platform.

About

people keep dot-files , I keep an entire ecosystem for myself . it's a one stop shop to bootstrap any laptop I use

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •