anchor.diff:    ${DEST_DIR}/bin/gitlab-ci-rails \
   "
   symlink_command="ln -sf ${usr_bin_symlinks} /usr/bin/"
  -
  -# Try collecting fqdn if it is set correctly
  -fqdn=$(/bin/hostname -f)
  -if [ -n "${fqdn}" ]; then
  -  external_url="http://${fqdn}"
  -else
  -  external_url="http://gitlab.example.com"
  -fi
   
   error_exit()
   {
  
positive.code: {
    notify "Thank you for installing GitLab!"
    notify "Configure and start GitLab by running the following command:"
    notify
    notify "sudo gitlab-ctl reconfigure"
    notify
    notify "GitLab should be reachable at ${external_url}"
    notify "Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file"
    notify "And running reconfigure again."
    notify
  
negative.code:   notify
  }
  
  check_if_ec2()
  {
    if [ -f /sys/hypervisor/uuid ] && [ `head -c 3 /sys/hypervisor/uuid` == ec2 ]; then
      return 0
    else
      return 1
    fi
  }
  
  get_fqdn_from_hostname()
  {
    # Try collecting fqdn if it is set correctly
    fqdn=$(/bin/hostname -f)
    if [ -n "${fqdn}" ]; then
      EXTERNAL_URL="http://${fqdn}"
    fi
  }
  
  get_ec2_hostname()
  {
    # Try collecting fqdn if it is set correctly
    fqdn=$(/opt/gitlab/embedded/bin/curl -s http://169.254.169.254/latest/meta-data/public-hostname)
    if [ -n "${fqdn}" ]; then
      EXTERNAL_URL="http://${fqdn}"
    fi
  }
  
  if [ -n "${GITLAB_DEBUG}" ] ; then
    notify "debug: arguments: $@"
  fi
  
  check_if_ec2
  if [ $? -eq 0 ]  ; then
    get_ec2_hostname
  else
    get_fqdn_from_hostname
  fi
  
  create_symlinks
  