summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPatrick Bajao <ebajao@gitlab.com>2019-07-29 14:33:01 +0800
committerPatrick Bajao <ebajao@gitlab.com>2019-07-29 14:58:32 +0800
commitaab85f3600caf04b491d6ca4fc3f0f004d9e3fc0 (patch)
treeda3f6ab04de4e0c1ba5b79a281c6ca91852e0aa1 /Makefile
parented0460374a5ca13d9ea17c6a9c21151319b7fd53 (diff)
downloadgitlab-shell-aab85f3600caf04b491d6ca4fc3f0f004d9e3fc0.tar.gz
Support falling back to ruby version of checkers
Rename the ruby scripts to have `-ruby` suffix and add a symlink for both to `./gitlab-shell`. The executable name will be used to determine how args will be parsed. For now, we only parse the arguments for gitlab-shell commands. If the executable is `gitlab-shell-authorized-keys-check` or `gitlab-shell-authorized-principals-check`, it'll always fallback to the ruby version. Ruby specs test the ruby script, the fallback from go to ruby and go implementation of both (still pending).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 84cba6b..aaa3098 100644
--- a/Makefile
+++ b/Makefile
@@ -16,8 +16,14 @@ test_ruby:
# bin/gitlab-shell must exist and needs to be the Ruby version for
# rspec to be able to test.
cp bin/gitlab-shell-ruby bin/gitlab-shell
+ # bin/gitlab-shell-authorized-keys-check and bin/gitlab-shell-authorized-principals-check
+ # should link to ruby scripts for rspec to be able to test.
+ ln -sf ./gitlab-shell-authorized-keys-check-ruby bin/gitlab-shell-authorized-keys-check
+ ln -sf ./gitlab-shell-authorized-principals-check-ruby bin/gitlab-shell-authorized-principals-check
bundle exec rspec --color --tag '~go' --format d spec
rm -f bin/gitlab-shell
+ ln -sf ./gitlab-shell bin/gitlab-shell-authorized-keys-check
+ ln -sf ./gitlab-shell bin/gitlab-shell-authorized-principals-check
test_golang:
support/go-test