Git Product home page Git Product logo

devbox's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.