Skip to content

Commit

Permalink
add Dockerfile to test
Browse files Browse the repository at this point in the history
  • Loading branch information
polym committed Feb 19, 2022
1 parent 6363905 commit 951e375
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 35 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:20.04

ADD . /sysinit

ENV CI=true

RUN /sysinit/start.sh
24 changes: 2 additions & 22 deletions etc/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,8 @@ set fileencodings=utf-8,gb2312,gbk,gb18030
set termencoding=utf-8
set encoding=utf-8

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'git://github.com/altercation/vim-colors-solarized.git'
"Plugin 'https://github.com/Valloric/YouCompleteMe'
Plugin 'https://github.com/fatih/vim-go.git'
Plugin 'https://github.com/honza/dockerfile.vim'
Plugin 'git://github.com/tpope/vim-commentary.git'
Plugin 'https://github.com/mileszs/ack.vim'
Plugin 'https://github.com/scrooloose/nerdtree.git'
Plugin 'https://github.com/majutsushi/tagbar.git'
Plugin 'https://github.com/lambdalisue/gina.vim.git'
Plugin 'https://github.com/greymd/oscyank.vim'
Plugin 'https://github.com/junegunn/fzf.git'
Plugin 'https://github.com/codota/tabnine-vim'
Plugin 'google/vim-maktaba'
Plugin 'google/vim-codefmt'
Plugin 'google/vim-glaive'
Plugin 'junegunn/vim-easy-align'
Plugin 'rust-lang/rust.vim'
Plugin 'racer-rust/vim-racer'
call vundle#end()
"load vundle
source /root/.vimrc.vundle

"let g:go_def_mode = 'godef'
let g:go_def_reuse_buffer = 1
Expand Down
20 changes: 18 additions & 2 deletions etc/.vimrc.vundle
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
set encoding=utf-8
"https://askubuntu.com/questions/894118/vundle-installation-fail

set nocompatible

" filetype func off
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'git://github.com/altercation/vim-colors-solarized.git'
Plugin 'https://github.com/Valloric/YouCompleteMe'
"Plugin 'https://github.com/Valloric/YouCompleteMe'
Plugin 'https://github.com/fatih/vim-go.git'
Plugin 'https://github.com/honza/dockerfile.vim'
Plugin 'git://github.com/tpope/vim-commentary.git'
Plugin 'https://github.com/mileszs/ack.vim'
Plugin 'https://github.com/scrooloose/nerdtree.git'
Plugin 'https://github.com/majutsushi/tagbar.git'
Plugin 'https://github.com/lambdalisue/gina.vim.git'
Plugin 'https://github.com/greymd/oscyank.vim'
Plugin 'https://github.com/junegunn/fzf.git'
Plugin 'https://github.com/codota/tabnine-vim'
Plugin 'google/vim-maktaba'
Plugin 'google/vim-codefmt'
Plugin 'google/vim-glaive'
Plugin 'junegunn/vim-easy-align'
Plugin 'rust-lang/rust.vim'
Plugin 'racer-rust/vim-racer'
call vundle#end()

" filetype func on
filetype plugin indent on
28 changes: 17 additions & 11 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -xe
ROOT=$(pwd)/$(dirname "${BASH_SOURCE}")
echo $ROOT
## Global VAR
pkgs="wget curl vim tmux git gcc g++ make automake autoconf patch libtool ntpdate ack-grep tcpdump python3 openssh-server unzip python3-pip jq locales cmake colordiff zsh ripgrep"
pkgs="wget curl vim tmux git gcc g++ make automake autoconf patch libtool ntpdate ack-grep tcpdump python python3 openssh-server unzip python3-pip jq locales cmake colordiff zsh ripgrep"

export DEBIAN_FRONTEND=noninteractive
export TZ=Etc/UTC
Expand All @@ -26,6 +26,9 @@ echo "nameserver 223.5.5.5" > /etc/resolv.conf
export LANGUAGE=en_US.UTF-8; export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; locale-gen en_US.UTF-8
dpkg-reconfigure locales

### Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

### Config it
if [ ! -f $HOME/.bashrc.user ]; then
echo ". $HOME/.bashrc.user" >> $HOME/.bashrc \
Expand Down Expand Up @@ -59,10 +62,6 @@ mkdir -p $HOME/golang/3rdpkg \
export GOROOT=$HOME/golang/go
export GOROOT_BOOTSTRAP=$HOME/golang/go-1.4

## https://github.com/moovweb/gvm/issues/286
# apt install -y gcc-7
# CC="gcc-7 -Wimplicit-fallthrough=0 -Wno-error=shift-negative-value -Wno-shift-negative-value -Wno-stringop-truncation"

ln -s $HOME/golang/go-1.4 $GOROOT
cd $GOROOT && git checkout go1.4.3 && cd src && CGO_ENABLED=0 ./make.bash
unlink $GOROOT
Expand All @@ -73,16 +72,23 @@ cd $GOROOT && git checkout go1.17.7 && cd src && ./make.bash
. $HOME/.bashrc.user

### Install Vim Plugins
mkdir -p $HOME/.vim/bundle && git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim \
&& vim -u $HOME/.vimrc.vundle +PluginInstall +qall
mkdir -p $HOME/.vim/bundle && git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
if [[ -t 0 ]]; then
vim -u $HOME/.vimrc.vundle +'PluginInstall' +qall
else
### non-interactive https://github.com/VundleVim/Vundle.vim/issues/511#issuecomment-134251209
echo | vim -u $HOME/.vimrc.vundle +'PluginInstall' +qall &>/dev/null
fi
$HOME/.vim/bundle/fzf/install --all

### Install Docker
### Install Docker TODO

### Install upx
go install github.com/upyun/[email protected]
GOPROXY="https://goproxy.cn,direct" go install github.com/upyun/[email protected]

### Install https://github.com/wg/wrk
cd /tmp && git clone https://github.com/wg/wrk && cd wrk && make && mv wrk /usr/bin

### Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
### Rust TODO: config
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh && sh /tmp/rustup.sh -y
source $HOME/.cargo/env

0 comments on commit 951e375

Please sign in to comment.