Open cmoulliard opened 9 years ago
Concerning this point, I think that the best idea is still to pass as ENV VAR an accounts list when the gerrit docker / pod is created as I could easily adapt the existing plugin to perform what is done here : https://gist.github.com/cmoulliard/be7192152523b85dd852 So we can imagine to have a GERRIT_ACCOUNTS en var where we pass a list of ACCOUNTS.
Example : "user","fullname","email_address","http_password","ssh-key","group1 ... groupN"
"jenkins","jenkins fabric8 cd","jenkins@fabric8.io","secret","fg5ty=='565656 ....","Non-Interactive Users"
REMARK : If we pass such ENV VAR (= env.properties file of the gerrit kube app), that means that we are aware that gerrit will be deployed in combination with jenkins, gogs, ...
What is the best format (json, csv, ...) ? There is still the question about the ssh keys (generated & mounted by kubernetes under a volume, autogenerated - https://gist.github.com/cmoulliard/be7192152523b85dd852#file-accountcreator-java-L57-L60, ... ?
I will start from your shell script (https://github.com/christian-posta/ceposta-devops-ose/blob/master/gerrit-docker/conf-jenkins-user.sh) and see what we could do to create a jenkins user with Gerrit (https://github.com/christian-posta/ceposta-devops-ose/blob/master/gerrit-docker/conf-jenkins-user.sh#L56).
As discussed yesterday, we could use REST - create account (but I'm still struggling to change the Admin permissions to allow a Non-Interactive user to perform that operation without using ssh - https://groups.google.com/forum/#!topic/repo-discuss/v4zuchvRmUo) OR ssh but the key has to be imported in that case