Skip to content

Setup your projects in a consistent way. Help other devs onboard easily!

License

Notifications You must be signed in to change notification settings

manumilou/devbuddy

 
 

Repository files navigation

DevBuddy

Go Report Card CircleCI GitHub Release GitHub Release Date

What is this?

DevBuddy (previously known as "Dad") is an open-source implementation of an amazing internal tool developed at Shopify called "Dev".

The first goal of this tools is to automate the setup tasks required to work on a project.

With DevBuddy, pushing a change on a project you never touched look like this:

  • bud clone devbuddy/devbuddy
  • bud up
  • git commit
  • bud test
  • git push

Status and progress

DevBuddy is mostly useful for Python and Go projects. More languages will be natively supported. Additional automatic tasks will also be implemented, making DevBuddy also useful for languages without native support.

See the project config documentation.

Tasks:

Python:

  • Python (version + virtualenv): working
  • Pip (requirements file): simple
  • Pipenv (support for Pipfile): simple

Go:

  • Go (version): working
  • Dep (support for Go Dep): simple

Others

  • Custom (conditional shell command): working
  • Packages (Homebrew, Apt...): planned
  • Docker Compose (manage a docker-compose setup): planned

Automatic environment:

  • Virtualenv: working
  • Go: working

Features:

  • Notification when important files (eg: requirements.txt) are updated locally (eg: by git pull)
  • A help command to guide a new developer based on dev.yml
  • A upgrade command to auto-upgrade DevBuddy

Hosting platform:

  • Github: working
  • Any git remote-url: planned
  • Gitlab: planned
  • Bitbucket (with Git): planned

Shell integration

  • Bash: working
  • Zsh: working
  • Fish: planned

Install

$ bash -c "$(curl -sL https://raw.githubusercontent.com/devbuddy/devbuddy/master/install.sh)"

Uninstall it:

$ sudo rm /usr/local/bin/bud

Setup

★ Install the shell integration (in ~/.bash_profile):

eval "$(bud --shell-init --with-completion)"

A safer version:

type bud > /dev/null 2> /dev/null && eval "$(bud --shell-init --with-completion)"

Usage

★ Add a dev.yml file in your project:

up:
  - go: 1.9.2
  - golang_dep
  - python: 3.6.4rc1
  - pip:
    - requirements.txt

commands:
  test:
    desc: Run the tests
    run: script/test
  lint:
    desc: Lint the project
    run: script/lint

open:
  staging: https://staging.myapp.com
  doc: https://godoc.org/github.com/org/myapp

See DevBuddy own dev.yml

$ bud
Usage:
  bud [flags]
  bud [command]

Available Commands:
  cd              Jump to a local project
  ci              Custom: Run all tests as CI would do
  clone           Clone a project from github.com
  create          Create a new project
  godoc           Custom: Starting GoDoc server on https://0.0.0.0:6060
  help            Help about any command
  inspect         Inspect the project and its tasks
  install-dev     Custom: Install bud in the GOROOT
  install-release Custom: Remove all bud binaries and install a released version
  integration     Custom: Run the integration tests
  lint            Custom: Lint the project
  lint-shell      Custom: Lint the shell scripts
  open            Open a link about your project
  release         Custom: Create a new release (bud release [VERSION])
  test            Custom: Run the unittests
  testup          Custom: Build, install and run the development version
  up              Ensure the project is up and running
  upgrade         [experimental] Upgrade DevBuddy to the latest available release.

Flags:
  -h, --help              help for bud
      --shell-init        Shell initialization
      --version           version for bud
      --with-completion   Enable completion during initialization

Use "bud [command] --help" for more information about a command.

Development

★ Clone the repository:

~ $ mkdir -p ~/src/github.com/pior
~ $ cd ~/src/github.com/pior
~/src/github.com/pior $ git clone [email protected]:devbuddy/devbuddy.git

★ Fetch the dependencies (in vendor)

~/src/github.com/pior $ dep ensure

★ Install the go executable somewhere in your PATH:

~/src/github.com/pior $ go install

Debugging

To show the debug messages, add this before in your environment:

export BUD_DEBUG=1

Or:

$ bud-enable-debug  # bud-disable-debug

Release

$ bud release 1.0.0

The big idea:

  1. Create a release commit to ensure the release is visible in the git log
  2. Create an annotated tag
  3. Push the commit and tag upstream

Expected:

  1. The CI process will test the release
  2. The CI process will publish macOS/Linux binaries to the Github Releases page

Updating the install.sh script is probably a good idea.

License

MIT

Authors:

About

Setup your projects in a consistent way. Help other devs onboard easily!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 64.2%
  • Shell 35.8%