Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #55 from caarlos0/tests
Browse files Browse the repository at this point in the history
Fixed all sorts of bugs with Linux bootstrap
  • Loading branch information
caarlos0 committed Mar 30, 2015
2 parents 8986529 + d413257 commit 151b0a9
Show file tree
Hide file tree
Showing 24 changed files with 83 additions and 50 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# caarlos0/dotfiles test container
FROM ubuntu
MAINTAINER Carlos Alexandro Becker <[email protected]>

RUN apt-get install -y software-properties-common wget zsh git curl python

COPY . /root/.dotfiles

RUN cd /root/.dotfiles && \
rm -f ./git/gitconfig.symlink && \
sed \
-e "s/AUTHORNAME/dotfiles-demo/g" \
-e "s/AUTHOREMAIL/dotfiles-demo/g" \
-e "s/GIT_CREDENTIAL_HELPER/cache/g" \
./git/gitconfig.symlink.example > ./git/gitconfig.symlink && \
git remote rm origin && \
./script/bootstrap && \
zsh -c "source ~/.zshrc" || true

ENTRYPOINT zsh
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ All those are managed by [antigen][antigen].
I try to keep it working in both Linux (no specific distro) and OS X,
mostly because I use OS X at home and Linux at work.

## test it within Docker

Yes you can! Pull the repo and run:

```sh
$ docker build -t dotfiles .
$ docker run -it dotfiles
```

It will start a fresh container with my dotfiles inside and dumb git
credentials.

## bugs

I want this to work for everyone; that means when you clone it down it should
Expand Down
2 changes: 2 additions & 0 deletions antigen/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/zsh
touch ~/.z
12 changes: 4 additions & 8 deletions atom.symlink/install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/zsh
if [ "$(uname -s)" = "Darwin" ]; then
brew cask install atom
fi

# base
apm install editorconfig autocomplete-plus language-docker
# linters
apm install linter linter-shellcheck linter-javac linter-jshint linter-ruby
[ "$(uname -s)" = "Darwin" ] && brew cask install atom
apm install \
editorconfig autocomplete-plus language-docker \
linter linter-shellcheck linter-javac linter-jshint linter-ruby || true
7 changes: 5 additions & 2 deletions bin/dot
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
# to make sure you're on the latest and greatest.
main() {
cd ~/.dotfiles
export ZSH="$(pwd)"
echo "Updating dotfiles..."
git pull origin master

echo "Updating antigen plugins..."
git submodule update
source ./antigen/antigen/antigen.zsh
antigen apply
antigen update

echo "Setting OSX/Gnome defaults..."
Expand All @@ -23,8 +25,9 @@ main() {
./homebrew/install.sh

# find the installers and run them iteratively
find . -name install.sh | grep -v homebrew | grep -v build | while read installer; do
sh -c "$installer"
find . -name install.sh | egrep -v "homebrew|build" | while read installer; do
echo "$ ${installer}..."
sh -c "$installer" >> /tmp/dotfiles-dot
done
}

Expand Down
Empty file modified docker/install.sh
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions docker/path.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/zsh
reload-docker() {
# shellcheck disable=SC2091
$(docker-machine env dev)
}
reload-docker >/dev/null 2>&1
2 changes: 1 addition & 1 deletion git/gitconfig.symlink.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[user]
name = AUTHORNAME
email = AUTHOREMAIL
helper = osxkeychain
helper = GIT_CREDENTIAL_HELPER
[alias]
co = checkout
promote = !$ZSH/bin/git-promote
Expand Down
5 changes: 3 additions & 2 deletions git/install.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
[ "$(uname -s)" = "Darwin" ] && brew install git
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0
brew install git
5 changes: 2 additions & 3 deletions golang/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0

#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0
brew install go
7 changes: 3 additions & 4 deletions homebrew/install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#!/bin/zsh
#
# Homebrew
#
# This installs some of the common dependencies needed (or at least desired)
# using Homebrew.
[[ "$(uname -s)" != "Darwin" ]] && exit 0
[ "$(uname -s)" != "Darwin" ] && return 0

# Check for Homebrew
if test ! "$(which brew)"; then
Expand All @@ -29,8 +29,7 @@ brew cask install iterm2 the-unarchiver disk-inventory-x appcleaner diffmerge \
brew cask install virtualbox vagrant

# chat, books, notes, documents, mail, etc
brew cask install kindle calibre dropbox skype slack messenger-for-telegram \
mailbox
brew cask install kindle calibre dropbox skype slack messenger-for-telegram

# browser
brew cask install google-chrome
Expand Down
4 changes: 2 additions & 2 deletions java/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0

# install some java stuff
brew install maven
Expand Down
4 changes: 2 additions & 2 deletions media/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0

# watch and download stuff
brew install youtube-dl
Expand Down
4 changes: 2 additions & 2 deletions mysql/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0

brew install mariadb
brew cask install sequel-pro
3 changes: 1 addition & 2 deletions node/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/zsh
[[ "$(uname -s)" != "Darwin" ]] && exit 0

[ "$(uname -s)" != "Darwin" ] && return 0
brew install node
5 changes: 2 additions & 3 deletions postgres/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0

#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0
brew cask install postgres pg-commander
4 changes: 2 additions & 2 deletions quicklook/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0
# quick look plugins - https://github.com/sindresorhus/quick-look-plugins
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json \
qlprettypatch quicklook-csv betterzipql qlimagesize webpquicklook \
Expand Down
4 changes: 2 additions & 2 deletions redis/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0
brew install redis
10 changes: 4 additions & 6 deletions ruby/install.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0

if test ! "$(which rbenv)"
then
if test ! "$(which rbenv)"; then
echo " Installing rbenv for you."
brew install rbenv > /tmp/rbenv-install.log
fi

if test ! "$(which ruby-build)"
then
if test ! "$(which ruby-build)"; then
echo " Installing ruby-build for you."
brew install ruby-build > /tmp/ruby-build-install.log
fi
4 changes: 2 additions & 2 deletions slate/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
[[ "$(uname -s)" != "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" != "Darwin" ] && return 0
brew cask install slate
4 changes: 2 additions & 2 deletions sublime-text-3/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/zsh

if [ "$(uname -s)" = "Darwin" ]; then
brew cask install sublime-text3
Expand All @@ -13,7 +13,7 @@ mkdir -p "$ST3_LOCAL/Packages/User/"

# Install Package Control
PKG_CTRL_FILE="$ST3_LOCAL/Installed Packages/Package Control.sublime-package"
[[ ! -f "$PKG_CTRL_FILE" ]] && curl -o "$PKG_CTRL_FILE" \
[ ! -f "$PKG_CTRL_FILE" ] && curl -o "$PKG_CTRL_FILE" \
"https://sublime.wbond.net/Package Control.sublime-package"

# Link keymaps
Expand Down
4 changes: 2 additions & 2 deletions terminator/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
[[ "$(uname -s)" = "Darwin" ]] && exit 0
#!/bin/zsh
[ "$(uname -s)" = "Darwin" ] && return 0
mkdir -p ~/.config/terminator/
ln -sf "$ZSH"/terminator/base16-ocean-dark.config ~/.config/terminator/config
4 changes: 2 additions & 2 deletions vim/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ setup_command_t() {
make
}
[ "$(uname -s)" = "Darwin" ] && brew install vim
vim +PluginInstall +qall
setup_command_t &> /tmp/cmd-t.log
vim +PluginInstall +qall >/tmp/vim-plugins.log 2>&1 || true
setup_command_t >/tmp/cmd-t.log 2>&1 || true
1 change: 0 additions & 1 deletion zsh/zshrc.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ unset config_files
# use .localrc for SUPER SECRET CRAP that you don't
# want in your public, versioned repo.
[[ -a ~/.localrc ]] && source ~/.localrc

0 comments on commit 151b0a9

Please sign in to comment.