diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/add-code-formatters | 18 | ||||
-rwxr-xr-x | scripts/gitaly-test-build | 16 | ||||
-rw-r--r-- | scripts/pre-commit | 18 | ||||
-rw-r--r-- | scripts/prepare_build.sh | 2 | ||||
-rwxr-xr-x | scripts/static-analysis | 5 |
5 files changed, 17 insertions, 42 deletions
diff --git a/scripts/add-code-formatters b/scripts/add-code-formatters deleted file mode 100755 index 56bb8754d80..00000000000 --- a/scripts/add-code-formatters +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check if file exists with -f. Check if in in the gdk rook directory. -if [ ! -f ../GDK_ROOT ]; then - echo "Please run script from gitlab (e.g. gitlab-development-kit/gitlab) root directory." - exit 1 -fi - -PRECOMMIT=$(git rev-parse --git-dir)/hooks/pre-commit - -# Check if symlink exists with -L. Check if script was already installed. -if [ -L $PRECOMMIT ]; then - echo "Pre-commit script already installed." - exit 1 -fi - -ln -s ./pre-commit $PRECOMMIT -echo "Pre-commit script installed successfully" diff --git a/scripts/gitaly-test-build b/scripts/gitaly-test-build index 95d9fe0f176..b42ae2a2595 100755 --- a/scripts/gitaly-test-build +++ b/scripts/gitaly-test-build @@ -9,11 +9,21 @@ require 'fileutils' # called 'bundle install' using a different Gemfile, as happens with # gitlab-ce and gitaly. -dir = 'tmp/tests/gitaly' +tmp_tests_gitaly_dir = File.expand_path('../tmp/tests/gitaly', __dir__) -abort 'gitaly build failed' unless system('make', chdir: dir) +# Use the top-level bundle vendor folder so that we don't reinstall gems twice +bundle_vendor_path = File.expand_path('../vendor', __dir__) + +env = { + # This ensure the `clean` config set in `scripts/prepare_build.sh` isn't taken into account + 'BUNDLE_IGNORE_CONFIG' => 'true', + 'BUNDLE_GEMFILE' => File.join(tmp_tests_gitaly_dir, 'ruby', 'Gemfile'), + 'BUNDLE_FLAGS' => "--jobs=4 --path=#{bundle_vendor_path} --retry=3" +} + +abort 'gitaly build failed' unless system(env, 'make', chdir: tmp_tests_gitaly_dir) # Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'. # Without this a gitaly executable created in the setup-test-env job # will look stale compared to GITALY_SERVER_VERSION. -FileUtils.touch(File.join(dir, 'gitaly'), mtime: Time.now + (1 << 24)) +FileUtils.touch(File.join(tmp_tests_gitaly_dir, 'gitaly'), mtime: Time.now + (1 << 24)) diff --git a/scripts/pre-commit b/scripts/pre-commit deleted file mode 100644 index 48935e90a87..00000000000 --- a/scripts/pre-commit +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check if file exists with -f. Check if in in the gdk rook directory. -if [ ! -f ../GDK_ROOT ]; then - echo "Please run pre-commit from gitlab (e.g. gitlab-development-kit/gitlab) root directory." - exit 1 -fi - -jsfiles=$(git diff --cached --name-only --diff-filter=ACM "*.js" | tr '\n' ' ') -[ -z "$jsfiles" ] && exit 0 - -# Prettify all staged .js files -echo "$jsfiles" | xargs ./node_modules/.bin/prettier --write - -# Add back the modified/prettified files to staging -echo "$jsfiles" | xargs git add - -exit 0 diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh index ea406aadf39..206d62dbc78 100644 --- a/scripts/prepare_build.sh +++ b/scripts/prepare_build.sh @@ -3,7 +3,7 @@ export SETUP_DB=${SETUP_DB:-true} export CREATE_DB_USER=${CREATE_DB_USER:-$SETUP_DB} export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true} -export BUNDLE_INSTALL_FLAGS="--without production --jobs $(nproc) --path vendor --retry 3 --quiet" +export BUNDLE_INSTALL_FLAGS="--without=production --jobs=$(nproc) --path=vendor --retry=3 --quiet" if [ "$USE_BUNDLE_INSTALL" != "false" ]; then bundle install --clean $BUNDLE_INSTALL_FLAGS && bundle check diff --git a/scripts/static-analysis b/scripts/static-analysis index 2a2bc67800d..9690b42c788 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -10,9 +10,10 @@ tasks = [ %w[bundle exec license_finder], %w[yarn run eslint], %w[bundle exec rubocop --parallel], - %w[scripts/lint-conflicts.sh], %w[bundle exec rake gettext:lint], - %w[scripts/lint-changelog-yaml] + %w[bundle exec rake lint:static_verification], + %w[scripts/lint-changelog-yaml], + %w[scripts/lint-conflicts.sh] ] failed_tasks = tasks.reduce({}) do |failures, task| |