Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SUDO_USER sometimes already set in Jenkins environments #222

@sgoings

Description

@sgoings

The change introduced in #221 broke a set of commands I had built that were running in a Jenkins instance. SUDO_USER is injected into the environment thanks to the https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin.

Might I suggest that you prefix SUDO_USER with something rerun specific so that this line doesn't see the Jenkins-injected env var and bail on rerun startup (sudo password prompts and jenkins jobs don't get along too well 😄)

More details on our Jenkins slaves:

  1. We create an Ubuntu VM which comes along with the admin user: "ubuntu"
  2. We create a "jenkins" user
  3. When we start the slave we:
    • ssh to the Ubuntu VM, run sudo su - jenkins
    • run a start script which connects the jenkins slave to the jenkins master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions