openfrontier / docker-gerrit

Build a Docker image with the Gerrit code review system
Apache License 2.0
196 stars 118 forks source link

Can't install plugin by env GERRIT_INIT_ARGS #114

Open 9Cube-dpustula opened 5 years ago

9Cube-dpustula commented 5 years ago

Hi im trying to install plugin as you describe in readme, but when im run container i stuck on this:

gerrit_1      |
gerrit_1      | /gerrit-entrypoint.sh: ignoring /docker-entrypoint-init.d/*
gerrit_1      |
gerrit_1      | Waiting for database connection postgres:5432 ...
gerrit_1      | Upgrading gerrit...
gerrit_1      | fatal: No argument is allowed: '--install-plugin=download-commands'

My gerrit service in docker-compose :

version: '3'

services:
  gerrit:
    image: openfrontier/gerrit
    ports:
      - "29418:29418"
      - "8080:8080"
    links:
      - postgres
      - ldap
    depends_on:
      - postgres
      - ldap
    environment:
    - WEBURL=http://localhost:8080
    - DATABASE_TYPE=postgresql
    - DATABASE_HOSTNAME=postgres
    - DATABASE_PORT=5432
    - DATABASE_DATABASE=reviewdb
    - DATABASE_USERNAME=gerrit
    - DATABASE_PASSWORD=secret
    - AUTH_TYPE=LDAP
    - LDAP_SERVER=ldap://ldap
    - LDAP_USERNAME=cn=admin,dc=example,dc=org
    - LDAP_PASSWORD=secret
    - LDAP_ACCOUNTBASE=dc=example,dc=org
    - LDAP_ACCOUNTPATTERN=(&(objectClass=person)(uid=$${username}))
    - LDAP_ACCOUNTFULLNAME=displayName
    - LDAP_ACCOUNTEMAILADDRESS=mail
    - DOWNLOAD_SCHEMES=http ssh
    - GERRIT_INIT_ARGS='--install-plugin=download-commands'
thinkernel commented 5 years ago

@9Cube-dpustula

"fatal: No argument is allowed: '--install-all-plugins'

GERRIT_INIT_ARGS is the only place to add this however there's - GERRIT_INIT_ARGS='--install-plugin=download-commands' in your compose file. I wonder where is the '--install-all-plugins' comes from.

9Cube-dpustula commented 5 years ago

Sorry i paste wrong log, at now i checked error again and update my issue with proper log. Mistake was from testing is it problem with this particular plugin or whatever else.

thinkernel commented 5 years ago

@9Cube-dpustula I just deployed a fresh new gerrit with almost the same environment variables like yours. I got nothing wrong. However I deployed it on k8s instead of using docker compose. Would you please remove - DOWNLOAD_SCHEMES=http ssh and try again? I've never used docker compose before. I wonder if it's the space between http and ssh cause this.

9Cube-dpustula commented 5 years ago

I removed others env and leave only that one (--install-plugin=download-commands) and still same problem.

Before test I remove container (docker-compose down) and run fresh container.

thinkernel commented 5 years ago

How about removing single quotes around --install-plugin=download-commands?

baosong818 commented 5 years ago

try environment: