Maven and Jenkins and GitHub and FTP

Discussion in 'Plugin Development' started by Daniel Heppner, Jun 2, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Daniel Heppner

    I have two questions regarding the things in the title.
    1. How do I integrate these in the best way? I've already got them set up, but I'd like to have Jenkins automatically build the source code from NetBeans, then I'd like Jenkins to automatically upload the source to GitHub, and finally I'd like Jenkins to upload to FTP whenever I promote an RB. I've kind of got this set up, but it's definitely not ideal, so what would you suggest I do?

    2. How do I tell which build of Bukkit that Maven has downloaded? I'm not sure what version I'm using in NetBeans and it's annoying that I don't know what I'm developing against. Basically, I really need to know what I should do to control the build I have downloaded and how to see what build I have downloaded.
     
  2. Offline

    Tagette

    I would like to know also. :)
     
    Daniel Heppner likes this.
  3. Offline

    Daniel Heppner

    Yo. Anyone?

    It's frustrating me, as I don't want to code for an old build and I don't know if I even have an old build
     
  4. Offline

    TAT

    1. The way I'm doing it is by commit from Eclipse to GitHub. GitHub sends an message to Jenkins that there have been committed and Jenkins get the source from GitHub and compile. I guess that you can make an promotion that makes the server upload the artifact to a server but I haven't tried.
    2. Have you tried looking in the console log for the build?
      I rename all Bukkit builds to 0.0.1-Build# (example 0.0.1-953).
     
  5. Offline

    greatman

    I use those in my maven file:

    Code:
    <repository>
                <id>bukkit-repo</id>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <url> http://repo.bukkit.org/artifactory/repo/</url>
            </repository>
    and
    Code:
    <dependency>
                <!-- Grabs from Bukkit Artifactory -->
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
    I think it grabs the latest bukkit version everytime as it probably read the http://repo.bukkit.org/artifactory/repo/org/bukkit/bukkit/0.0.1-SNAPSHOT/maven-metadata.xml file
     
  6. Offline

    Daniel Heppner

    Sorry, I'm new to Maven. Very new. How do I get Jenkins to receive this message? A plugin?
    Second, how do I rename all the Bukkit builds? Where are these files? Thanks a lot, btw.
     
  7. Offline

    TAT

    GitHub sends this message to Jenkins, where a plugin set it to build.
    Here's a list of my Jenkins plugins:
    Code:
    Jenkins GIT plugin
    Emotional Hudson plugin
    GitHub plugin
    Maven Integration plugin
    Hudson MySQL Plugin
    Jenkins instant-messaging plugin
    Jenkins IRC Plugin
    Promoted Builds Plugin
    Hudson Redmine plugin
    I'm also open for developers to use my Jenkins for their projects.

    I simply rename craftbukkit-0.0.1-SNAPSHOT.jar and bukkit-0.0.1-SNAPSHOT.jar to craftbukkit-0.0.1-{Build}.jar and bukkit-0.0.1-{Build}.jar.
    So for build 953 it would become craftbukkit-0.0.1-953.jar and bukkit-0.0.1-953.jar.
     
  8. Offline

    Daniel Heppner

    Okay, thank you so much. Some more questions:

    Where do you host your Jenkins? I have a 256 (it's actually 128, but I'll be upgrading as soon as the 256 one comes available.) MB Xen VPS that I can use for whatever I want, but do you suppose that's enough ram?

    I can't rename these Bukkit jars because I don't know where they are. Maven downloads it automatically when I first build the project, but it won't do it again (to get the new version.) Is there a way I could download the jar manually and tell Maven to use it? TAT, you should write a tutorial. :)
     
  9. Offline

    TAT

    I use a 512 MB VPS Server for Jenkins. It also runs a webserver, mailserver, ftpserver and MySQL server (which take the most RAM).
    The only moment, when Jenkins needs a lot of RAM, is when it's building.
    In this moment of writing my server says it have 8.26 MB RAM free (Documentation: http://earthgame.dk/info/), but still it only takes 1-2 minutes to get source from GitHub, get new jar files (Bukkit and so on), compile the source to a .jar file, archive it to .tar.gz2 and .zip files (with exstra files) and artifact them.
    I run my own dependency. I have simply done it via my file server, and properly not in the correct way, but who cares, it works :p
    It also asks for a POM file (and sometimes also a MD5 or SHA1 hash), so for them I have created a script that does for me. (I just must remember to run it when updating the dependency ;) )
    You can see it here: http://www.earthgame.dk/artifact/
    And to all people that sees that link, please ask if you want to use it :D (I pay the broadband xD)

    Perhaps I will make a tutorial for it ;)
     
  10. Offline

    Daniel Heppner

    I don't really know how to do most of the things mentioned in
    My webserver is lighttpd because I have so little ram. I've also done some other optimization like replacing OpenSSH, Bash, and some other things with alternatives that use less ram. It's hosted by http://ethelitehosting.com/
    Anyway, you really should make a tutorial so that I might get some idea of what you're doing. It'll also help the community a lot, because there's no other tutorial out there.

    As a final question: Why not use repo.bukkit.org? Don't they have everything set up right?
     
  11. Offline

    TAT

    I think you'll end out having a lot RAM free :p
    Bah, I also uses other plugins (example: Permissions and SignUpdater) so I thinks it's easier if I just have them in one place ;)
    It also looks like you can't see which build the files on http://repo.bukkit.org is.
     
  12. Offline

    Daniel Heppner

    I just started a new plugin... and I set it up on Ant. Btw, I'm using NetBeans but I'm planning on switching to Eclipse as soon as the download finishes.

    Is it okay if I use your artifact repo? Or should I make my own (with your help xD)? Or are you getting tired of me and want me to go away?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  13. Offline

    TAT

    Yeah, you have permission to use my artifact repo :D
    Never, I want to help you :D
     
  14. Offline

    Daniel Heppner

    OMG. I think I got it working. I downloaded Eclipse, set up the Bukkit.org repo in pom.xml and I'll be using Bukkit's built in permission system, so I don't need a permissions repo and if I need a repo with some other plugin in it, I'll make my own, which I think I've figured out how to do now (sk89q's repo has some useful things in it too). Now here's what I need help with: setting Jenkins up. Followup for that in the next post. xD

    thanks so much.

    @TAT
    Nevermind, I got Jenkins working. But I was stupid and I locked myself out. I'm trying to follow the guide here: https://wiki.jenkins-ci.org/display/JENKINS/Disable security, but $JENKINS_HOME points to /root/ (I'm using root user because I'm not a wimp XD. JK, I'm just lazy.) Where can I find the config.xml file? If I can find that and unlock Jenkins, it'll be smooth sailing from there as I've already played around with Jenkins on my laptop. Btw, I'm using Debian and I installed it with aptitude.

    You can see my install here:
    http://dheppner.org.org:8080/
    If anyone else knows about this, please do post. Ahem, @BigPluginDevelopersWhoUseJenkins
    EDIT:
    Got it working with the help of someone on Aardvark!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
Thread Status:
Not open for further replies.

Share This Page