2015-03-16 05:19:07 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-03-16 05:23:40 -04:00
|
|
|
# Initialize ccache if needed
|
|
|
|
if [ ! -f /srv/ccache/CACHEDIR.TAG ]; then
|
2015-03-15 12:30:34 -04:00
|
|
|
echo "Initializing ccache in /srv/ccache..."
|
2015-03-16 05:23:40 -04:00
|
|
|
CCACHE_DIR=/srv/ccache ccache -M 50G
|
|
|
|
fi
|
|
|
|
|
2015-03-16 05:49:02 -04:00
|
|
|
# Fix permissions. This is needed temporarily to migrate old projects which were still checked out as root.
|
|
|
|
# It can be removed at some point in the future.
|
|
|
|
# For performance reasons, only search on the first level.
|
|
|
|
for i in "/home/cmbuild/android" "/srv/ccache"; do
|
|
|
|
if [ $(find $i -maxdepth 1 -user root | wc -l) -gt 0 ]; then
|
2015-03-15 12:30:34 -04:00
|
|
|
echo "Fixing permissions on $i..."
|
2015-03-16 05:49:02 -04:00
|
|
|
chown -R cmbuild:cmbuild $i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2015-03-16 05:19:07 -04:00
|
|
|
# Fix console permissions as long as https://github.com/docker/docker/issues/9806 is not fixed
|
|
|
|
usermod --groups tty --append cmbuild
|
|
|
|
chgrp tty /dev/console
|
|
|
|
chmod g+rw /dev/console
|
|
|
|
|
|
|
|
su -c "cd /home/cmbuild/android; screen -s /bin/bash" cmbuild
|