ontometrics / slack-youtrack

Integration of slack and you track.
49 stars 14 forks source link

install for youtrack 6.x? #1

Closed dszabo closed 9 years ago

dszabo commented 9 years ago

Hello, I really would like to use this plugin. I can successfully compile as a .war, but I don't understand where to copy this. My system is ubuntu linux, youtrack runs as .jar, and as I understand, no .war distribution for external tomcat appserver is possible any more. Is this right? How do I install this then? I am new to youtrack, something seems to be created at /home/youtrack/.youtrack during startup, but this seems to be regenerated on restart. thanks!

codeslubber commented 9 years ago

Right you cannot run this out of the same instance. We are running it out of tomcat. Kind of a drag, but even apps from the same vendors don't share containers: YouTrack and TeamCity run out of their own VMs.

dszabo commented 9 years ago

thanks! could you provide more info, what is your setup? you have youtrack run on its own, and you installed a standalone tomcat server with this .war?

codeslubber commented 9 years ago

Yes. But unlike the Jetbrains stuff, we do have other things running in that tomcat instance. Needless to say this will take very little processor time and memory.

dszabo commented 9 years ago

thank you, I try this.

codeslubber commented 9 years ago

Let me know how you make out. Will update the readme file.

dszabo commented 9 years ago

Okay, works great. Here is a doc for it, your install steps misses some steps and java properties (for example, the slack channel mapper is very important). Thanks for this code, it is very useful for me.

quick & dirty ubuntu linux install instructions

install jdk

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

install tomcat using a private instance for testing

$ sudo apt-get install tomcat7-user
$ cd /home/youtrack
$ cd ~ && tomcat7-instance-create yt2slack

compile the .war using the followin shell script

# install java devenv, you already have jdk
$ sudo apt-get install ant maven

# now get the code, and put this shell script into the root to compile:
#!/bin/bash
mvn -DYOUTRACK_USERNAME=$(youtrack_uid) \ 
    -DYOUTRACK_PASSWORD=$(youtrack_pwd) \
    -DSLACK_AUTH_TOKEN=$(slack_auth_token) \  # get this from api.slack.com
    -DAPP_DATA_DIR=/home/youtrack/yt2slack/data \ # this is the tomcat webapp instance you created earlier
    -DYOUTRACK_HOST=${http://youtrack_hostname} \
    -DYOUTRACK_PORT=${youtrack_port} \
    -DDEFAULT_SLACK_CHANNEL=${general_channel_name} \ # must exist on slack. I guess this is used if project->channel mapping is missing/incomplete 
    -DISSUE_HISTORY_WINDOW=60 \
    -DYOUTRACK_TO_SLACK_CHANNELS="YOUTRACK_PRJ1->slack_channel1;YOUTRACK_PRJ2->slack_channel2;YOUTRACK_PRJ3->slack_channel3" \ #
    -Dmaven.test.skip=true \ # don't run test to have faster build time
    package

deploy war

$ cp target/slack-youtrack-1.0-SNAPSHOT.war /home/youtrack/yt2slack/webapps/slack.war

run tomcat instance

cd /home/youtrack/yt2slack/bin && ./startup.sh

check the logs in tomcat instance* tail the logs to see any initialization errors (in yt2slack/logs)

consult tomcat documentation for a system wide setup and auto starting This is left for you and google.