Dad

What is this?
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 Dad, pushing a change on a project you never touched look like this:
dad clone pior/dad
dad up
git commit
dad test
git push
Status and progress
Dad is mostly useful for Python and Go projects. More languages will be natively
supported. Additional automatic tasks will also be implemented, making Dad 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 Dad
- 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/pior/dad/master/install.sh)"
Uninstall it:
$ sudo rm /usr/local/bin/dad
Setup
★ Install the shell integration (in ~/.bash_profile):
eval "$(dad --shell-init --with-completion)"
A safer version:
type dad > /dev/null 2> /dev/null && eval "$(dad --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
See Dad own dev.yml
$ dad
Usage:
dad [flags]
dad [command]
Available Commands:
cd Jump to a local project
clone Clone a project from github.com
create Create a new project
godoc Custom: Starting GoDoc server on http://0.0.0.0:6060
help Help about any command
lint Custom: Lint the project
test Custom: Run tests
up Ensure the project is up and running
Flags:
-h, --help help for dad
--shell-init Shell initialization
--version version for dad
--with-completion Enable completion during initialization
Use "dad [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 git@github.com:pior/dad.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 DAD_DEBUG=1
Or:
$ dad-enable-debug # dad-disable-debug
Release
$ dad release 1.0.0
The big idea:
- Create a release commit to ensure the release is visible in the git log
- Create an annotated tag
- Push the commit and tag upstream
Expected:
- The CI process will test the release
- 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