From 663fab198f88f1ec2340bfde14a4d3c35c74eddb Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Wed, 17 Oct 2018 10:28:55 +0800 Subject: [PATCH] Fix tests --- .dockerfile | 1 + .drone.yml | 8 ++++++-- .install/dircolors.sh | 9 +++++++++ .install/kubectl.sh | 1 + .install/yadm.sh | 1 + .zshrc | 17 ++++++++++++----- 6 files changed, 30 insertions(+), 7 deletions(-) create mode 100755 .install/dircolors.sh diff --git a/.dockerfile b/.dockerfile index 2fc824a..e1e47be 100644 --- a/.dockerfile +++ b/.dockerfile @@ -34,6 +34,7 @@ USER ambrose # install user programs # shell config +RUN ./.install/dircolors.sh RUN ./.install/pure.sh RUN ./.install/thefuck.sh RUN ./.install/zsh-autosuggestions.sh diff --git a/.drone.yml b/.drone.yml index 8aa724e..fec955f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,6 +17,7 @@ pipeline: group: test image: alpine:latest commands: + - ./.install/repositories.sh - ./.install/neovim.sh - nvim -version - nvim +checkhealth +qa @@ -36,7 +37,7 @@ pipeline: commands: - ./.install/sudo.sh - ./.install/thefuck.sh - - thefuck -v + - ./.local/bin/thefuck -v when: status: [ failure, success ] test-yadm: @@ -45,13 +46,14 @@ pipeline: commands: - ./.install/sudo.sh - ./.install/yadm.sh - - yadm version + - ./.local/bin/yadm version when: status: [ failure, success ] test-golang: group: test image: alpine:latest commands: + - ./.install/repositories.sh - ./.install/golang.sh - go version - go get github.com/golang/example/hello @@ -62,6 +64,7 @@ pipeline: group: test image: alpine:latest commands: + - ./.install/repositories.sh - ./.install/node.sh - node -e "console.log(process.versions)" when: @@ -70,6 +73,7 @@ pipeline: group: test image: alpine:latest commands: + - ./.install/repositories.sh - ./.install/node.sh - ./.install/yarn.sh - yarn --version diff --git a/.install/dircolors.sh b/.install/dircolors.sh new file mode 100755 index 0000000..0b2047f --- /dev/null +++ b/.install/dircolors.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +echo +echo "Downloading LS_COLORS..." +echo + +wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O ~/.dircolors diff --git a/.install/kubectl.sh b/.install/kubectl.sh index 0035c2e..0e57a37 100755 --- a/.install/kubectl.sh +++ b/.install/kubectl.sh @@ -10,6 +10,7 @@ echo sudo apk add --no-cache --virtual .build-deps \ curl +mkdir -p ~/.local/bin curl -fLo ~/.local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl chmod a+x ~/.local/bin/kubectl diff --git a/.install/yadm.sh b/.install/yadm.sh index 762d66b..fa6b342 100755 --- a/.install/yadm.sh +++ b/.install/yadm.sh @@ -14,6 +14,7 @@ sudo apk add --no-cache \ git \ bash +mkdir -p ~/.local/bin curl -fLo ~/.local/bin/yadm https://github.com/TheLocehiliosan/yadm/raw/master/yadm chmod a+x ~/.local/bin/yadm diff --git a/.zshrc b/.zshrc index 66f304c..c538fdb 100644 --- a/.zshrc +++ b/.zshrc @@ -4,7 +4,7 @@ # zsh settings export SAVEHIST=10000 -export HISTFILE=~/.zsh_history +export HISTFILE=$HOME/.zsh_history setopt append_history setopt extended_history setopt share_history @@ -23,7 +23,10 @@ bindkey -v bindkey '^R' history-incremental-search-backward # zsh imports -fpath=( ~/.zsh/functions $fpath ) +fpath=( $HOME/.zsh/functions $fpath ) + +# ls colors +eval $(dircolors -b $HOME/.dircolors) # editor export EDITOR=nvim @@ -35,7 +38,7 @@ autoload -U promptinit; promptinit prompt pure # autosuggestions -source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=239' export ZSH_AUTOSUGGEST_USE_ASYNC=true bindkey '^e' autosuggest-accept @@ -50,11 +53,15 @@ export PATH="$(go env GOPATH)/bin:$PATH" # aliases alias vim=nvim -# iTerm2 shell integration +# gpg as ssh agent +test -e "$(which gpgconf)" && export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + +# iTerm2 integration test -e "$HOME/.iterm2_shell_integration.zsh" && source "$HOME/.iterm2_shell_integration.zsh" -# Hack to optionally get some oh-my-zsh back +# hack to optionally get some oh-my-zsh back export ZSH="$HOME/.oh-my-zsh" test -e "$HOME/.oh-my-zsh/plugins/osx/osx.plugin.zsh" && source "$HOME/.oh-my-zsh/plugins/osx/osx.plugin.zsh" +# legacy scripts test -e "$HOME/.bin" && export PATH="$HOME/.bin:$PATH" # TODO: move to .local/bin # tips