diff --git a/.gitignore b/.gitignore index a40dd005c004091f4ad4a61ebb6f846ed7cd3c85..15b0976bb46d0f2084bfabfa829d0646a7ec2e49 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ /.gitlab-shell-bundle /.gitlab-bundle /.gitlab-npm +/.gitlab-yarn /gem/*.gem /gitlab-runner-config.toml /.gdk-install-root diff --git a/Makefile b/Makefile index b80d1200808a74b50f9c9109b15b48eefdda25ca..3d35592738556f38fba559fc7efef35b463bf0b2 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ all: gitlab-setup gitlab-shell-setup gitlab-workhorse-setup support-setup gitaly # Set up the GitLab Rails app -gitlab-setup: gitlab/.git gitlab-config bundler .gitlab-bundle .gitlab-npm +gitlab-setup: gitlab/.git gitlab-config bundler .gitlab-bundle yarn .gitlab-yarn gitlab/.git: git clone ${gitlab_repo} gitlab @@ -51,14 +51,22 @@ gitlab/public/uploads: cd ${gitlab_development_root}/gitlab && bundle install --without mysql production --jobs 4 touch $@ -.gitlab-npm: - cd ${gitlab_development_root}/gitlab && npm install +.gitlab-yarn: + cd ${gitlab_development_root}/gitlab && yarn install --pure-lockfile touch $@ .PHONY: bundler bundler: command -v $@ > /dev/null || gem install $@ +.PHONY: yarn +yarn: + @command -v $@ > /dev/null || {\ + echo "Error: Yarn executable was not detected in the system.";\ + echo "Download Yarn at https://yarnpkg.com/en/docs/install";\ + exit 1;\ + } + # Set up gitlab-shell gitlab-shell-setup: symlink-gitlab-shell ${gitlab_shell_clone_dir}/.git gitlab-shell/config.yml bundler .gitlab-shell-bundle gitlab-shell/.gitlab_shell_secret @@ -109,7 +117,6 @@ gitlab-update: gitlab/.git/pull gitlab-setup @echo "" cd ${gitlab_development_root}/gitlab && \ bundle exec rake db:migrate db:test:prepare - cd ${gitlab_development_root}/gitlab && npm prune gitlab-shell-update: gitlab-shell/.git/pull gitlab-shell-setup @@ -312,6 +319,7 @@ clean-config: nginx/conf/nginx.conf \ unlock-dependency-installers: - rm -f .gitlab-npm \ + rm -f \ .gitlab-bundle \ .gitlab-shell-bundle \ + .gitlab-yarn diff --git a/Procfile.example b/Procfile.example index 76bb1a157af8def5c9c5d89096521af62ee4e1c4..f63ebb10f47e7103b0b7d92a6036ae644b12706c 100644 --- a/Procfile.example +++ b/Procfile.example @@ -15,4 +15,4 @@ rails-background-jobs: exec /usr/bin/env SIDEKIQ_LOG_ARGUMENTS=1 RAILS_ENV=devel #sshd: exec /usr/sbin/sshd -e -D -f /home/git/openssh/sshd_config #nginx: exec nginx -p /home/git/nginx -c conf/nginx.conf gitaly: exec gitaly/bin/gitaly /home/git/gitaly/config.toml -webpack: exec /usr/bin/env NODE_ENV=development DEV_SERVER_PORT=3808 support/exec-cd gitlab npm run dev-server +webpack: exec /usr/bin/env NODE_ENV=development DEV_SERVER_PORT=3808 support/exec-cd gitlab yarn dev-server diff --git a/doc/prepare.md b/doc/prepare.md index 52a0f44952113db8e6215601f524961af62994c6..233936d9acfc9425ab516630251afbd589b8a30d 100644 --- a/doc/prepare.md +++ b/doc/prepare.md @@ -14,9 +14,14 @@ during installation. system Ruby 1. Bundler, which you can install with `gem install bundler` 1. Git version of 2.7.X or higher +1. Node 4.3 or newer and Yarn 0.17 or newer. If your package manage does not + have up-to-date versions of node or yarn available, visit the official + websites for [node] and [yarn] for installation instructions. [rbenv]: https://github.com/rbenv/rbenv [chruby]: https://github.com/postmodern/chruby +[node]: https://nodejs.org/en/download/package-manager/ +[yarn]: https://yarnpkg.com/en/docs/install/ ### OS X 10.9 (Mavericks), 10.10 (Yosemite), 10.11 (El Capitan), macOS 10.12 (Sierra) @@ -27,7 +32,7 @@ Please read [the prerequisites for all platforms](#prerequisites-for-all-platfor ``` brew tap homebrew/dupes brew tap homebrew/versions -brew install git redis postgresql libiconv icu4c pkg-config cmake nodejs go openssl node npm coreutils +brew install git redis postgresql libiconv icu4c pkg-config cmake nodejs go openssl node npm yarn coreutils bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include sudo npm install phantomjs-prebuilt@2.1.12 -g ``` @@ -37,7 +42,7 @@ sudo npm install phantomjs-prebuilt@2.1.12 -g We are using PostgreSQL-9.5 in the following example. If you want to use another version, please adjust paths accordingly. ``` -sudo port install git redis libiconv postgresql95-server icu pkgconfig cmake nodejs4 go openssl npm2 coreutils +sudo port install git redis libiconv postgresql95-server icu pkgconfig cmake nodejs4 go openssl npm2 yarn coreutils bundle config build.eventmachine --with-cppflags=-I/opt/local/include/openssl sudo npm install phantomjs-prebuilt@2.1.12 -g echo 'export PATH=/opt/local/lib/postgresql95/bin/:$PATH' >> ~/.profile