kcl-lang.io/kpm@v0.8.7-0.20240520061008-9fc4c5efc8c7/scripts/push_pkg.sh (about)

     1  
     2  #!/usr/bin/env bash
     3  
     4  # Check kpm version
     5  
     6  version=$(./bin/kpm --version)
     7  if ! echo "$version" | grep -q "kpm version test_version"; then
     8    echo "Incorrect version: '$version'."
     9    exit 1
    10  fi
    11  
    12  export KPM_REG="localhost:5001"
    13  export KPM_REPO="test"
    14  export OCI_REG_PLAIN_HTTP=on
    15  
    16  # Prepare the package on the registry
    17  current_dir=$(pwd)
    18  echo $current_dir
    19  
    20  $current_dir/bin/kpm login -u test -p 1234 localhost:5001
    21  
    22  # Push the package k8s/1.14 to the registry
    23  cd ./scripts/pkg_in_reg/ghcr.io/kcl-lang/k8s/1.14
    24  $current_dir/bin/kpm push
    25  
    26  cd "$current_dir"
    27  
    28  # Push the package k8s/1.17 to the registry
    29  cd ./scripts/pkg_in_reg/ghcr.io/kcl-lang/k8s/1.27
    30  $current_dir/bin/kpm push
    31  
    32  cd "$current_dir"
    33  
    34  # Push the package helloworld/1.17 to the registry
    35  cd ./scripts/pkg_in_reg/ghcr.io/kcl-lang/helloworld/0.1.1
    36  $current_dir/bin/kpm push
    37  
    38  cd "$current_dir"
    39  
    40  # Push the package 'kcl1' depends on 'k8s' to the registry
    41  cd ./scripts/pkg_in_reg/kcl1
    42  $current_dir/bin/kpm push
    43  
    44  cd "$current_dir"
    45  
    46  # Push the package 'kcl2' depends on 'k8s' to the registry
    47  cd ./scripts/pkg_in_reg/kcl2
    48  $current_dir/bin/kpm push