# install ohmyzsh
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 安装homebrew
$ xcode-select --install
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$ brew update
# 安装依赖 https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/v0.2.10/doc/advanced.md#macos
$ git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git
$ cd gitlab-development-kit
$ git checkout v0.2.10
$ brew bundle
$ brew link pkg-config
$ brew pin libffi icu4c readline re2
$ if [ ${ZSH_VERSION} ]; then shell_file="${HOME}/.zshrc"; else shell_file="${HOME}/.bash_profile"; fi
$ echo 'export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ${shell_file}
$ source ${shell_file}
$ brew install chromedriver --cask
$ rm Gemfile.lock
$ make bootstrap
# gdk install gitlab_repo= 依赖ruby 3.0.5 所以直接clone
# gdk install gitlab_repo=git@gitlab.com:gitlab-org/gitlab-foss.git
$ git clone git@gitlab.com:gitlab-org/gitlab-foss.git gitlab
$ cd gitlab; git checkout v13.7.0; cd -
$ make install
$ echo '127.0.0.1 gdk.test' | sudo tee -a /etc/hosts
$ brew install nginx
# vim gdk.yml
hostname: gdk.test
port: 3443
https:
enabled: true
nginx:
enabled: true
http2:
enabled: true
ssl:
certificate: gdk.test.pem
key: gdk.test-key.pem
$ gdk reconfigure
$ gdk restart
# HTTP: http://gdk.test:8080
# HTTPS: https://gdk.test:3443
$ git clone https://gitlab.com/firelizzard/super-simple-proxy
$ cd super-simple-proxy;
$ go run . -netrc -secure gdk.test:443 -key /path/to/gdk.test-key.pem -cert /path/to/gdk.test.pem -insecure gdk.test:80 -forward gdk.test,gdk.test:3443
# https://gdk.test (port 443 is default for HTTPS).
# entirely disable downloading checksums for all Go modules
export GOSUMDB=off
# disable checksum downloads for all projects
export GONOSUMDB=gdk.test
# disable checksum downloads for projects within a namespace
export GONOSUMDB=gdk.test/namespace
# disable checksum downloads for a specific project
export GONOSUMDB=gdk.test/namepsace/project
# vim ~/.zshrc 修改openssl@3 -> openssl@1.1
# Added by GDK bootstrap
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl@1.1 --with-readline-dir=/usr/local/opt/readline"
# gem install thrift -v '0.16.0' -- --with-cppflags="-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value"
$ gem install thrift -v 0.16.0 -- --with-cppflags="-Wno-compound-token-split-by-macro"
$ go env -w GOPROXY=https://goproxy.cn,direct
# vim Makefile
export GOPROXY ?= https://goproxy.cn
$ sudo rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
# https://github.com/bytedeco/javacpp-presets/issues/150
$ rm -rf jaeger*
# vim lib/gdk/config.rb
$ require 'uri'
# vim lib/gdk.rb 从gem/bin/gdk 复制
def self.remember!(directory)
File.open("#{directory}/#{ROOT_CHECK_FILE}", 'w') do |f|
f.puts File.realpath(directory)
end
true
rescue StandardError => e
warn e
false
end