On Thu, Jun 23, 2016 at 9:14 PM praveen <jogi.praveenkuma...@gmail.com> wrote:
> Yes. We can install a tool on a Jenkins slave as part of the job. I wanted > to install the tool on slave before connect it as slave to the master so > then there is no need to install the tool on slave. Regarding the script, > I'll change the script accordingly as you specified. Thank you so much for > comments. > > I am interested why you prefer to install the tool as part of provisioning the slave when Jenkins will do it for you automatically. When Jenkins installs it automatically, it allows you to manage multiple versions of the same tool, and you can control which installer is used by the labels assigned to the slave. That seems easier, more capable, and more reliable (to me) than writing your own scripts to install and manage tools needed by your build. I could see choosing not to have Jenkins manage a tool if it is provided by the operating system (git, for example, is a common part of many Linux operating systems). In that case, you might use the operating system package management system to install the tool rather than having Jenkins install it for you. Mark Waite > Regards, > Praveen > > On Thursday, June 23, 2016 at 3:14:20 PM UTC-7, praveen wrote: >> >> Configured automatic slaves for couple jobs on Jenkins using ec2 plugin >> <https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin>. I need >> to override couple of environment variables for the slave before connecting >> to master. Here is the init script that used to run before it connect as >> slave. What am I doing wrong. Can someone please help me? >> >> >> PROBLEM: I'm able to launch a slave,But unable to set environment >> variables for that slave. >> >> >> GOAL: Install maven-3.2.5 (set home directory to >> /opt/apache-maven-3.2.5), >> >> Environment variables: (name: DISPLAY, value: :1), (name: >> PATH, value: $PATH:/usr/local/bin) >> >> >> >> #!/bin/sh >> >> sudo mkdir /opt/apache-maven-3.2.5 >> if [ -d /opt/apache-maven-3.2.5 ]; then >> if [ ! -f /tmp/apache-maven-3.2.5-bin.tar.gz ]; then >> wget -nd -O /tmp/apache-maven-3.2.5-bin.tar.gz >> https://archive.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz >> fi >> tar -xvf /tmp/apache-maven-3.2.5-bin.tar.gz >> sudo mv apache-maven-3.2.5 /opt/ >> sudo chown -R jenkins:jenkins /opt/apache-maven-3.2.5 >> fi >> PATH=$PATH:/usr/local/bin >> DISPLAY=:1 >> MAVEN_HOME=/opt/apache-maven-3.2.5 >> >> >> Jenkins version:1.656 >> Amazon EC2 plugin:1.31 >> >> -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to jenkinsci-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/b6bf71fd-8c27-4378-81b2-ce32add1598f%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/b6bf71fd-8c27-4378-81b2-ce32add1598f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGzxekjapZQ8%2BHFu02hL9GgvRdprtk67Ct554Hp8RYM8g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.