Skip to content

Instantly share code, notes, and snippets.

@xywei
Created May 24, 2017 02:56
Show Gist options
  • Save xywei/75a9a0581792dee02851c4656e93c5a2 to your computer and use it in GitHub Desktop.
Save xywei/75a9a0581792dee02851c4656e93c5a2 to your computer and use it in GitHub Desktop.
Setup symlinks for Gitlab
#!/bin/sh
# Make symlinks to allow Gitlab to pickup data here.
# This is a useful one-liner which will give you the full directory name of
# the script no matter where it is being called from.
GDATA_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
GLINK_DIR=~/.gitlab
if [ -d "$GLINK_DIR" ]; then
echo "$GLINK_DIR already exists! exiting .."
exit;
fi
mkdir -p "$GLINK_DIR"
ln -s "$GDATA_DIR"/gitlab/config ~/.gitlab/config
ln -s "$GDATA_DIR"/gitlab/logs ~/.gitlab/logs
ln -s "$GDATA_DIR"/gitlab/data ~/.gitlab/data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment