From 0c3fc88325b0c771aa220444d9ede24153e35d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Fri, 24 Mar 2017 18:11:40 +0100 Subject: [PATCH] Makefile! --- .gitignore | 1 - Docker/Dockerfile => Dockerfile | 47 +++++++++++++++++---------------- Makefile | 15 +++++++++++ README.md | 7 ++++- make.sh | 24 ----------------- 5 files changed, 45 insertions(+), 49 deletions(-) rename Docker/Dockerfile => Dockerfile (51%) create mode 100644 Makefile delete mode 100644 make.sh diff --git a/.gitignore b/.gitignore index cd398a2..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -vim/Session.vim diff --git a/Docker/Dockerfile b/Dockerfile similarity index 51% rename from Docker/Dockerfile rename to Dockerfile index beb7e9e..b124d6b 100644 --- a/Docker/Dockerfile +++ b/Dockerfile @@ -1,22 +1,25 @@ FROM ubuntu:16.04 -RUN apt-get update -y -RUN apt-get install -y build-essential -RUN apt-get install -y cmake -RUN apt-get install -y curl -RUN apt-get install -y diffstat -RUN apt-get install -y git -RUN apt-get install -y pkg-config -RUN apt-get install -y python -RUN apt-get install -y python-dev -RUN apt-get install -y python3 -RUN apt-get install -y tmux -RUN apt-get install -y vim -RUN apt-get install -y zsh - -RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python2 -RUN pip install virtualenv -RUN pip install virtualenvwrapper +RUN apt-get update -y && \ + apt-get install -y build-essential \ + cmake \ + curl \ + diffstat \ + git \ + pkg-config \ + python \ + python-dev \ + python \ + python3 \ + tmux \ + stow \ + sudo \ + vim \ + zsh && \ + apt clean + +RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 +RUN pip install virtualenv virtualenvwrapper # Setup home environment RUN useradd dev @@ -38,17 +41,15 @@ VOLUME /usr/src/app WORKDIR /home/dev ENV HOME /home/dev -RUN git clone https://github.com/balkian/dotfiles /home/dev/dotfiles +RUN mkdir /home/dev/dotfiles/ +RUN ls /home/dev/dotfiles +COPY . /home/dev/dotfiles RUN sh /home/dev/dotfiles/make.sh # Link in shared parts of the home directory -RUN ln -s /var/shared/.ssh -RUN ln -s /usr/src/app +RUN ln -s /var/shared/.ssh && ln -s /usr/src/app RUN chsh dev -s /usr/bin/zsh -RUN chown -R dev: /home/dev -RUN chown -R dev: /usr/local/ - RUN echo "dev ALL = NOPASSWD: ALL" >> /etc/sudoers USER dev diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5302052 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +########## Variables + +# change to the dotfiles directory + +stow: submodules + find . -maxdepth 0 -type d | xargs stow -v + +submodules: + git submodule update --init --recursive + +docker: Dockerfile + git clone . /tmp/dotfiles + docker build -t balkian/devmachine /tmp/dotfiles + +.PHONY: stow submodules docker diff --git a/README.md b/README.md index 6ff9cc8..cf264ce 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,11 @@ The fast way: ```bash curl -#L https://github.com/balkian/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md} ``` +### Quick install + +``` +make +``` ### Install Each folder contains the configuration files for a specific program, as they would appear under "$HOME" (~). To install them, first initialize the submodules: @@ -24,4 +29,4 @@ Then, you can use the [GNU Stow](https://www.gnu.org/software/stow/) utility to stow ``` -Alternatively, you may simply copy the files to your $HOME folder. \ No newline at end of file +Alternatively, you may simply copy the files to your $HOME folder. diff --git a/make.sh b/make.sh deleted file mode 100644 index 3262fd4..0000000 --- a/make.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -############################ -# .make.sh -# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles -############################ - -########## Variables - -# change to the dotfiles directory -cd `dirname $0` - -########## Don't forget the submodules -git submodule init -git submodule update --recursive - -olddir=~/dotfiles$(date +%Y-%m-%d_%H:%M:%S) # old dotfiles backup directory -files=$(ls -1 --ignore="not_dots" --ignore="README.md" --ignore="make.sh" --ignore="Docker" $PWD) # list of files/folders to symlink in homedir - -########## - -# create dotfiles_old in homedir -for file in $files; do - stow -v $file -done