-
Notifications
You must be signed in to change notification settings - Fork 0
IDE Setup
- IDE tool setup
- Springsource Tool Suite
Transcribed from original Robert Krombholz [post](http://groups.google.com/group/rundeck-discuss/browse_thread/thread/9071ce0af87e2733)
Hi,
I’d like to write something down about getting a development environment
for rundeck using Springsource Tool Suite (STS)
for others to not expecience all the pitfalls as I did.
The same might be valid for eclipse also but there seems to be no direct
Grails plugin for Eclipse.
Anyway using Eclipse + Groovy plugin might give you the similar comfort.
- Setup steps (core):
1. For the dtolabs/rundeck on the github site
2. Clone you forked project, add the upstream project, fetch all
branches, create a tracking branch from the upstreak and create a topic
branch for your dev work.
git clone g…@github.com:/rundeck.git
cd rundeck
git remote add upstream git://github.com/dtolabs/rundeck.git
git fetch upstream
git branch -t development upstream/development
git branch development
git checkout
3. Install at least Springsource Tool Suite 2.5.2 + Grails Support + Groovy Eclipse
(http://grails.org/STS+Integration)
4. Go to rundeck/core/ and execute the gradlew/gradlew.bat
5. To resolve build path issues – from the rundeck directory/core :
mkdir -p target/tools/lib
cp -p build/libs/rundeck-core-1.1.0.jar target/
cp -p build/tools/lib/* target/tools/lib/
(when you change code and want the grails application to make use of it
you need to repeat the above steps)
Please note that the current .classpath file for eclipse still references version 1.0 of the rundeck jar. I will make a pull request in order to fix this.
6. Import the core project into eclipse:
File > Import > General > Existing Projects into Workspace
Browse to the location where youre rundeck/core directory is and click OK
- Setup steps (grails application “rundeckapp”):
Currently there is no .project file for the grails application which makes it a bit tricky to get it into eclipse. Anyway I have build one that works for me and I will make a pull request to include that into the codebase. This description assumes that this is already done.
If you can’t wait – please find the file attached.
1. Make that you have Grails 1.2.0 & Groovy installed on your machine
(as Groovy is backwards compatible you can use the latest. I did my test with 1.7.2)
2. Configure STS to use Grails 1.2.0 as the default Grails version (or enable project specific setting later on).
3. From your rundeck directory:
cp -p core/target/rundeck-core-1.1.0.jar rundeckapp/lib
(rememer to rebuild the jar when you did change core code and want to make use of it inside the grails code)
4. Inside STS: File > Import >//General > Existing Projects into Workspace
Browse to the location of the rundeckapp directory and click on OK
During the Import STS is faultly changing something in the following files:
application.properties
web-app/WEB-INF/tld/c.tld
web-app/WEB-INF/tld/fmt.tld
Please roll those changes back by just checking out the files from your branch again.
Changes to the rundeckapp/target, .project & .settings files can be ignores (maybe we should include them into the .gitignore file)
5. Info: Now you still got a low of warnings in the “Markers” tab inside STS. You can ignore those. I assume it is because the Grails support is anyway not 100% perfect inside STS and it can not correctly resolve the GRAILS_HOME even if you have setted it. Don’t worry the application will run anyway.
6. In order to run the application you need to create a directory that
will act as the RDECK_BASE & RDECK_HOME directory.
In this case I just used /tmp/rundeck. From you codebase rundeck directory run the following:
mkdir /tmp/rundeck
cp rundeckapp/etc/templates/config/rundeck-config.properties.template /tmp/rundeck/rundeck-config.properties
7. Adjust the rundeck-config.properties that you have just copied. There are 3 placeholders that you need to replace with real values.
grails.serverURL=http://localhost:9090
reportservice.log4j.port=9090
dataSource.url=jdbc:hsqldb:file:/tmp/rundeck/data;shutdown=true
9. Now you can run from the commandline like that:
grails run-app -XX:MaxPermSize=256m -Djava.security.auth.login.config=web-app/WEB-INF/jaas.conf -Xmx512m -Xms256m -server -Drdeck.base=/tmp/rundeck -Drdeck.home=/tmp/rundeck -Dserver.port=9090
or adjust the existing run.sh to your needs.
Note: At the first time of running – Grails might ask you to uninstall the tomcat plugin. Please hit y to uninstall it.
Finally you got you rundeck server running on http://localhost:9090/rundeck and the code within the IDE.
It should also be possible to run the app from the STS Grails command prompt (Ctrl+Alt+Shift+G) but I had some problems with that.
I will send an update when I got this resolved.
Happy Coding
Please feel free to give me your feedback if something didn’t work for you.
- Springsource Tool Suite (alternative)
There is an other option on setting up STS 2.6.0 (tried on Mac OS X 10.6.4)
1. Install MacPorts and make
2. Install STS 2.6.0 with Grails and Groovy support
3. Checkout the source
4. Build from Terminal with make (should complete successfully)
4.1. Please note, that if behind a proxy you should use $RUNDECK_CHECKOUT/build/local/grails-1.2.0/bin/grails set-proxy (or add-proxy) to configure the proxy – otherwise it may not compile.
5. Start STS, import “core”, “rundeck-app” (Import existing projects into workspace, with copy into workspace option)
6. rundeck-app: remove all GRAILS_HOME dependencies from Java build path under “Preferences/Java build path”
7. rundeck-app: configure GRAILS 1.2.0 under “Preferences/Grails”
8. rundeck-app: Groovy → Add Groovy libraries to classpath
9. rundeck-app: Grails Tools → Enable dependency management
10. rundeck-app: Grails Tools → Refresh dependencies
11. rundeck-app: Run → Grails-Command (run-app)
12. Ignore exceptions, stop execution.
13. Go to “Run Configurations…”, replace Grails Command from “run-app” to “-Drdeck.base=<rundeck_installation_dir, e.g. ~/rundeck-installation> -Djava.security.auth.login.config=<path_to_jaas.conf, e.g. ~/rundeck-installation/server/exp/webapp/WEB-INF/jaas.conf> run-app”
14. Run – now runback is available under http://localhost:8080/rundeck. Login using admin/admin account.