Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install delete-project plugin in gerrit?

I want to install delete-project plugin to my gerrit server. As per the latest version, I should clone it from google source and use buck build.

I cloned it and my buck is also ready.

What are the steps to be followed to build the delete project plugin and add it to my gerrit server.

I tried

buck build .

in the cloned source of delete-project. But, I am getting the following error

Traceback (most recent call last):
  File "/home/gerrit/buck/src/com/facebook/buck/parser/buck.py", line 872, in <module>
    main()
  File "/home/gerrit/buck/src/com/facebook/buck/parser/buck.py", line 867, in main
    buildFileProcessor.process(build_file.rstrip())
  File "/home/gerrit/buck/src/com/facebook/buck/parser/buck.py", line 800, in process
    build_env['BUILD_FILE_SYMBOL_TABLE'])
  File "/home/gerrit/delete-project/././BUCK", line 1, in <module>
    gerrit_plugin(
NameError: name 'gerrit_plugin' is not defined
BUILD FAILED: Parse error for BUCK file ././BUCK: End of input at line 1 column 1

Please help

like image 415
Virtual Avatar asked Jan 21 '14 09:01

Virtual


People also ask

How do I install Gerrit plugins?

Plugin installation is as easy as dropping the plugin jar into the $site_path/plugins/ folder. It may take a few minutes until the server picks up new and updated plugins. Due to caching, you might need to flush your browser cache after installing a plugin. Users will usually see the result within several minutes.


4 Answers

I managed to install delete-project plugin after following this thread:

https://groups.google.com/forum/#!topic/repo-discuss/hbBc2TUhl7s

and then install according to:

https://gerrit-review.googlesource.com/Documentation/cmd-plugin-install.html

P.S. I build the jar following the below steps:

  1. git clone --recursive https://gerrit.googlesource.com/gerrit
  2. cd gerrit
  3. git clone --recursive https://gerrit.googlesource.com/plugins/delete-project
  4. buck build delete-project:delete-project

You should then find the delete-project.jar in buck-out/gen/delete-project/delete-project.jar

like image 162
chubao Avatar answered Oct 05 '22 02:10

chubao


  1. Download the delete-project.jar from the build that matches your Gerrit version on https://gerrit-ci.gerritforge.com
  2. Copy it to gerrit/plugins directory.
  3. Restart Gerrit.
like image 22
fracz Avatar answered Oct 05 '22 02:10

fracz


I managed to successfully build delete-project plugin with a slight modification on @DavidCheung answer:

  1. git clone https://gerrit.googlesource.com/gerrit
  2. cd gerrit/plugins
  3. git clone https://gerrit.googlesource.com/plugins/delete-project
  4. buck build delete-project:delete-project

You should then find the delete-project.jar in ../buck-out/gen/delete-project/delete-project.jar

like image 43
Miguel A. Baldi Hörlle Avatar answered Oct 05 '22 02:10

Miguel A. Baldi Hörlle


I struggled with the answers above, maybe due to having a new version of Gerrit (2.11.2). The steps in this document all worked for me, with one addition - you need to add the --recursive flag when you clone the Gerrit source code so that it includes the source for the standard plugins:

git clone --recursive https://gerrit.googlesource.com/gerrit

Also, make sure to check out the correct Git branch for your Gerrit version,e.g.

git fetch origin stable-2.11:stable-2.11
git checkout stable-2.11
like image 39
gareth_bowles Avatar answered Oct 05 '22 02:10

gareth_bowles