HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/agentcloud/airbyte/tools/lib/lib.sh
error() {
  echo -e "$@"
  exit 1
}

assert_root() {
  [ -f .root ] || error "Must run from root"
}

_script_directory() {
  local base; base=$(dirname $0)

  [ -z "$base" ] && base="."
  (cd "$base" && pwd)
}

_get_docker_label() {
  local dockerfile; dockerfile=$1
  local label; label=$2

  < "$dockerfile" grep "$label" | cut -d = -f2
}

_get_docker_image_version() {
  local is_pre_release; is_pre_release=$2
  local version; version=$(_get_docker_label $1 io.airbyte.version)

  # append the -dev.[git sha] if we're trying to publish a pre-release version
  if [ "$is_pre_release" = "true" ]; then
    echo "$version-dev.$(git rev-parse --short HEAD)"
  else
    echo "$version"
  fi
}

_get_docker_image_name() {
  _get_docker_label $1 io.airbyte.name
}

_to_gradle_path() {
  local path=$1
  local task=$2

  echo ":$(echo "$path" | tr -s / :):${task}"
}

full_path_to_gradle_path() {
  # converts any Airbyte repo path to gradle job
  local path="$1/$2"
  python -c "print(':airbyte-' + ':'.join(p for p in '${path}'.split('airbyte-')[-1].replace('/', ':').split(':') if p))"
}

get_connector_path_from_name() {
  # get the path to a connector from its name
  # e.g connectors/source-postgres -> airbyte-integrations/connectors/source-postgres
  local connector_name=$1
  local connector_dir="airbyte-integrations"

  echo "$connector_dir/$connector_name"
}

get_connector_version() {
  # get the version of a connector from its name
  # e.g source-postgres -> 0.1.1
  local connector_name=$1
  local connector_path=$(get_connector_path_from_name "$connector_name")
  local dockerfile="$connector_path/Dockerfile"
  _get_docker_image_version "$dockerfile"
}

VERSION=$(cat .env | grep "^VERSION=" | cut -d = -f 2); export VERSION
SCRIPT_DIRECTORY=$(_script_directory); export SCRIPT_DIRECTORY