0

I am creating a Jenkins job.

This will build some artifacts and will deploy to one of our environments, i.e. qa, staging, production etc. (I am using a choice parameter for this purpose)

However we need to restrict access to environments to specific user, i.e. the QA team should only be able to deploy to the qa env and so on; hence, the choice parameter should display to each user, only the environments he/she can deploy to.

Is this feasible in Jenkins?

Is there any other tool that could someone use to create jobs that present a custom UI (hiding/revealing options/choices) to users based on permissions?

1

Have a look at the Role Strategy Plugin. It allows you to assign roles per project or node, so you can configure detailed permission as required.

There are other CI tools with extended permission-management as well, but I see no need for them: Jenkins is an open source, stable CI system which works well on all important platforms and became a de facto standard. It has many plugins to archive nearly anything. Even rare use-cases can be handled by writing custom plugins/batch scripts.

1

If you can't find a plugin to do what you want, there is a more manual solution.

Create multiple upstream jobs that control the parameters and pass them to the downstream deploy job. Then you can restrict each group to only see the relevant upstream job.

It will result in semi-duplicate upstream jobs, but will guarantee appropriate separation.

  • U mean have a job (with access control / displayed to specific users) call the main job (displayed to noone) ...doesn't sound bad...I assume Jenkins allows a job to call another job with parameters (?) – pkaramol Feb 23 '18 at 15:50
  • 1
    @pkaramol Exactly. It's extra easy with pipeline jobs - calling one from another is as simple as running a build job: step in your upstream job. – Alex Feb 23 '18 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.