diff options
author | Evan Read <eread@gitlab.com> | 2022-05-11 20:23:57 +0300 |
---|---|---|
committer | Sarah German <sgerman@gitlab.com> | 2022-05-11 20:23:57 +0300 |
commit | d28edc1a4c767239e8662d78b14c49544a57ce7f (patch) | |
tree | 93d728b97949375001056d719e25c0361c29bc41 | |
parent | 4227f3090cfa7c0dc2397bef6941165227937d6c (diff) |
Add Lefthook to project
-rw-r--r-- | .gitlab-ci.yml | 3 | ||||
-rw-r--r-- | .gitpod.Dockerfile | 8 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | lefthook.yml | 5 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | yarn.lock | 5 |
6 files changed, 17 insertions, 7 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fade1cbe..f2a4cf87 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -421,8 +421,7 @@ lint_dockerfiles: before_script: [] dependencies: [] script: - - for file in *.Dockerfile; do hadolint $file; done - - for file in dockerfiles/*.Dockerfile; do hadolint $file; done + - hadolint latest.Dockerfile .gitpod.Dockerfile **/*.Dockerfile ############################################### # Review Apps # diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index d452c459..2427a362 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,10 +1,10 @@ -FROM gitpod/workspace-full +FROM gitpod/workspace-full:2022-05-08-14-31-53 USER gitpod # Install Ruby version 2.7.5 and set it as default. # Required when the base Gitpod Docker image doesn't provide the version of Ruby we want. # For more information, see: https://www.gitpod.io/docs/languages/ruby. -RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc -RUN bash -lc "rvm install ruby-2.7.5 && rvm use ruby-2.7.5 --default" -RUN echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc +RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc \ + && bash -lc "rvm install ruby-2.7.5 && rvm use ruby-2.7.5 --default" \ + && echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc @@ -15,4 +15,4 @@ clean: @rm -rf tmp public test: setup - @bundle exec rspec && yarn test && yarn eslint && yarn prettier + @bundle exec rspec && yarn test && yarn eslint && yarn prettier && hadolint latest.Dockerfile .gitpod.Dockerfile **/*.Dockerfile diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 00000000..3a543eb0 --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,5 @@ +--- +pre-push: + commands: + tests: + run: make test diff --git a/package.json b/package.json index 20c2807a..cb439629 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "prettier:fix": "prettier --write '**/*.{js,vue}'" }, "devDependencies": { + "@arkweid/lefthook": "^0.7.7", "@babel/core": "^7.17.10", "@babel/eslint-parser": "^7.17.0", "@babel/preset-env": "^7.17.10", @@ -118,6 +118,11 @@ dependencies: "@jridgewell/trace-mapping" "^0.3.0" +"@arkweid/lefthook@^0.7.7": + version "0.7.7" + resolved "https://registry.yarnpkg.com/@arkweid/lefthook/-/lefthook-0.7.7.tgz#12951b09b955d8054885ffe929aa07a49f39027c" + integrity sha512-Eq30OXKmjxIAIsTtbX2fcF3SNZIXS8yry1u8yty7PQFYRctx04rVlhOJCEB2UmfTh8T2vrOMC9IHHUvvo5zbaQ== + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" |