Andreas Kleiber

personal blog

Youtrack GitHub Integration

The challenge

You can link your YouTrack projects to GitHub projects. When you have setup the VCS integration successful you can edit Youtrack issues via GIT commits. When I tried it some time ago with my personal account it just worked out of the box. But when I started using an organization account things stopped working. After overcoming all obstacles I got it working. My frustration level reached a maximum when I tried to monitor only the master branch. It just again did not work as described in JetBrains documentation. I am so glad YouTrack’s support team is fast as hell, as far as I can tell.

So in order to make your life easier I will show you the neccessary steps to setup GitHub integration in YouTrack using an organization account and monitoring specific branches.

The way

We assume you have setup YouTrack and GitHub accounts.

Setup VCS integration in your YouTrack Project

  1. Navigate to your YouTrack project project - edit project - VCS
  2. Add a new GitHub VCS integration
  3. Create an auth token (just press the link)
  4. Repository owner = your organization account name

  1. Choose the desired repository
  2. To only log commits from the master, use +:refs/heads/(master) for “Monitor Branches”
  3. When you are finished, YouTrack changes the VCS Login from your organization’s name to the account name that owns the OAuth token

Edit YouTrack issues via GIT commits

You can put every command that you can use via the YouTrack command dialog (ctrl + option + J on OSX) in your GIT commits. Just make sure your commit email matches your YouTrack account email.

Mount Any OS X Host Dir in a Docker Container

… or how to access your local git repositories in a Docker container with docker-machine?

What Docker does by default

When using Docker on OS X you have to run Docker in a VirtualBox. A convenient tool to achieve this is Docker Toolbox. It comes with boot2docker to run your Docker containers.

The default installation will only share your /Users directory with the VirtualBox VM.

But you probably don’t store all your projects within your user’s home directory, are you? And on top of that you may not want to share all your little secrets of your /Users dir with Docker.

What to do to override this default

In order to mount directories from your host machine outside of the /Users dir you have to add a shared folder to VirtualBox and let boot2docker mount that folder on start.

Adding a shared folder can be done via console with VBoxManage. To make your docker-machine VM mount your data folder on startup you can either edit /var/lib/boot2docker/profile or /var/lib/boot2docker/ The profile file is mentioned in boot2docker’s readme on GitHub but what’s missing there is, when you regenerate your VM’s certificates your profile file will be overwritten with the defaults. So you have to use the latter file


Assuming your Docker VM is named default.

Add a shared folder to you VM - replace the /path/to/git/repositories/

docker-machine stop default
VBoxManage sharedfolder add "default" --name "data" --hostpath "/path/to/git/repositories/" --automount
VBoxManage setextradata "default" VBoxInternal2/SharedFoldersEnableSymlinksCreate/data 1
docker-machine start default

Mount folder in VM on startup

docker-machine ssh default \
"echo -e '\
mkdir -p /home/docker/data\n\
mount -t vboxsf -o uid=1000,gid=50 data /home/docker/data\
' | sudo tee -a /var/lib/boot2docker/"

Run a Docker container and mount a volume

docker run -d -v /home/docker/data/your-project:/opt/www/your-project -it --name nginx nginx

Et voilĂ  you have access to your project folder

/path/to/git/repositories/> ll
total 0
-rw-r--r--  1 user  group     0B 18 Dez 00:34 index.html

/path/to/git/repositories/> docker exec -it nginx bash
root@710706efa911:/# ls -lah /opt/www/your-project/
total 4.0K
drwxr-xr-x 1 1000 staff  102 Dec 17 23:34 .
drwxr-xr-x 3 root root  4.0K Dec 17 23:33 ..
-rw-r--r-- 1 1000 staff    0 Dec 17 23:34 index.html