Code Monkey home page Code Monkey logo

get.keptn.sh's Introduction

get.keptn.sh repository

Keptn V1 has reached end of life on December 22nd, 2023 and has been replaced.

This repo is part of the Keptn Project and provides the following two files:

  • version.json - contains information about the available Keptn versions, published to https://get.keptn.sh/version.json
  • get.sh - auto installation script for the keptn CLI which is published on https://get.keptn.sh (e.g., run curl -sL https://get.keptn.sh | bash)

Process Details

If a new Keptn GA release is published on GitHub we will create a Pull Request in this repo with the the updated version of version.json. Once this is merged, the changes will be automatically uploaded to https://get.keptn.sh.

get.sh params

Currently, the following parameters are available:

  • KEPTN_VERSION - Optional; points to a GitHub Release of keptn/keptn, e.g., 0.7.0; default: latest release
  • TARGET_ARCH - specifies the target CPU architecture, e.g., amd64; default: amd64
  • INSTALL_DIRECTORY - specifies the installation directory (default for Linux/MacOS: /usr/local/bin); if unset, keptn cli binary will stay in current working directory

Examples

  1. Install the latest stable version for the current operating system and CPU architecture
    curl -sL https://get.keptn.sh | bash
  2. Install an alpha version
    curl -sL https://get.keptn.sh | KEPTN_VERSION=0.8.0-alpha bash
  3. Install the latest stable version for amd64
    curl -sL https://get.keptn.sh | TARGET_ARCH=amd64 bash

version.json

The file version.json contains information about the latest versions available and upgradepaths.

License

Please see LICENSE.

get.keptn.sh's People

Contributors

aabedraba avatar adriangonciarz avatar agrimmer avatar bacherfl avatar bcdady avatar christian-kreuzberger-dtx avatar ermin-muratovic avatar johannes-b avatar kirdock avatar laneli avatar mowies avatar realanna avatar robertjahn avatar thisthat avatar warber avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get.keptn.sh's Issues

Improve get.sh script with similar features like istio quickstart has

Source: https://raw.githubusercontent.com/istio/istio/master/release/downloadIstioCandidate.sh

Examples:

Automatically determine version based on latest gh release

# Determine the latest Istio version by version number ignoring alpha, beta, and rc versions.
if [ "x${ISTIO_VERSION}" = "x" ] ; then
  ISTIO_VERSION="$(curl -sL https://github.com/istio/istio/releases | \
                  grep -o 'releases/[0-9]*.[0-9]*.[0-9]*/' | sort --version-sort | \
                  tail -1 | awk -F'/' '{ print $2}')"
  ISTIO_VERSION="${ISTIO_VERSION##*/}"
fi

if [ "x${ISTIO_VERSION}" = "x" ] ; then
  printf "Unable to get latest Istio version. Set ISTIO_VERSION env var and re-run. For example: export ISTIO_VERSION=1.0.4"
  exit;
fi

Print some helpful information on how to continue

printf ""
printf "\nIstio %s Download Complete!\n" "$ISTIO_VERSION"
printf "\n"
printf "Istio has been successfully downloaded into the %s folder on your system.\n" "$NAME"
printf "\n"
BINDIR="$(cd "$NAME/bin" && pwd)"
printf "Next Steps:\n"
printf "See https://istio.io/latest/docs/setup/install/ to add Istio to your Kubernetes cluster.\n"
printf "\n"
printf "To configure the istioctl client tool for your workstation,\n"
printf "add the %s directory to your environment path variable with:\n" "$BINDIR"
printf "\t export PATH=\"\$PATH:%s\"\n" "$BINDIR"
printf "\n"
printf "Begin the Istio pre-installation check by running:\n"
printf "\t istioctl x precheck \n"
printf "\n"
printf "Need more information? Visit https://istio.io/latest/docs/setup/install/ \n"

Error while installing with versions > `0.9`

When trying to install keptn CLI version 0.10.0-next.1, I get the following error:

curl -sL https://get.keptn.sh | KEPTN_VERSION=0.10.0-next.1 bash
We'll install specified Keptn version 0.10.0-next.1
Determined target architecture x86_64
Downloading keptn 0.10.0-next.1 for OS macOS with architecture amd64 from GitHub: https://github.com/keptn/keptn/releases/download/0.10.0-next.1/0.10.0-next.1_keptn-macOS.tar
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
An error occured while trying to download keptn from GitHub. Please manually download a release from https://github.com/keptn/keptn/releases.

I did some digging and found the faulty code to be here.
This version check only works with versions <= 0.9

get.keptn.sh not working for 0.8 on MacOs

When executing curl -sL https://get.keptn.sh | KEPTN_VERSION=0.8.0-rc1 bash on MacOS it doesn't work as the script tries to pull the CLI with the name "macOS" in it, which doesn't exist. The actual file contains the name "darwin" instead of "macOS".

Error log:

 ~ % curl -sL https://get.keptn.sh | KEPTN_VERSION=0.8.0-rc1 bash

We'll install specified Keptn version 0.8.0-rc1
Determined target architecture x86_64
Downloading keptn 0.8.0-rc1 for OS macOS with architecture amd64 from GitHub: https://github.com/keptn/keptn/releases/download/0.8.0-rc1/keptn-0.8.0-rc1-macOS-amd64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
An error occured while trying to download keptn from GitHub. Please manually download a release from https://github.com/keptn/keptn/releases.

Potential fix:

  • Either update the get.keptn.sh file or the script that creates the CLI tarball for macOS.

Support Windows (e.g., git-bash, WSL) in get.keptn.sh script

Right now the get.keptn.sh script only supports Linux and MacOS:

get.keptn.sh/src/get.sh

Lines 7 to 16 in ae84dc6

if [[ "$OSTYPE" == "linux-gnu" ]]; then
DISTR="linux"
elif [[ "$UNAME" == "Linux" ]]; then
DISTR="linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
DISTR="macOS"
else
echo "Unknown OS type $OSTYPE"
exit 1
fi

We should also add the possibility to support windows (e.g., git bash or similar).

get.keptn.sh not working for m1 mac

jjena@MacBook-Air ~ % curl -sL https://get.keptn.sh | bash
The newest version of Keptn is 1.2.0 and will be used automatically
Determined target architecture arm64
Downloading keptn 1.2.0 for OS darwin with architecture arm64 from GitHub: https://github.com/keptn/keptn/releases/download/1.2.0/keptn-1.2.0-darwin-arm64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 9 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
An error occured while trying to download keptn from GitHub. Please manually download a release from https://github.com/keptn/keptn/releases.

awk regex fails: Add support for alpine

The regexes don't work when trying to run get.keptn.sh from within alpine because awk on alpine doesn't use that flavour of regex.

curl --silent "https://api.github.com/repos/keptn/keptn/releases/latest" | grep tag_name | awk 'match($0, /[0-9]+.[0-9]+.[0-9]+[.\-A-Za-z0-9]*/) { print substr( $0, RSTART, RLENGTH )}'

Fix typos in CLI download script

There are some typos or unclear instructions in the CLI download script that need to be fixed.

    printf "\n"
    printf "Installation is successfully completed!"
    printf "\n"
    printf "You can check Keptn installation by running:"
    printf "\n"
    printf "\n"
    printf "${TARGET_DIR}keptn --help"
    printf "\n"
    printf "\n"
x    printf "Next step you might be interested in is the installation on your cluster. "
x    printf "You can follow the docmentation under https://keptn.sh/docs/ "
x    printf "or simply start off by installing Keptn Control Plane via:"
    printf "\n"
    printf "\n"
    printf "${TARGET_DIR}keptn install"
    printf "\n"
    printf "\n"
    printf "Also, you can find many helpful tutorials in https://tutorials.keptn.sh/"
    printf "\n"
x    printf "Good luck!"
    printf "\n"

I suggest to clarify like:

Keptn CLI installation completed successfully
...
To install Keptn in your cluser, please follow the documentation https://keptn.sh/docs/ or execute
keptn install
...
Learn more on how to use Keptn in our tutorials https://tutorials.keptn.sh/

Welcome aboard!

Failed to install using curl get.keptn.sh due to GitHub API Ratelimit

I just tried to install using the suggested method in quickstart (curl get.keptn.sh | bash). It failed due to an API Rate Limit hit on GitHub:

$ curl -sL https://get.keptn.sh | bash
The newest version of Keptn is  and will be used automatically
Determined target architecture x86_64
Downloading keptn  for OS linux with architecture amd64 from GitHub: https://github.com/keptn/keptn/releases/download//_keptn-linux.tar
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 
An error occured while trying to download keptn from GitHub. Please manually download a release from https://github.com/keptn/keptn/releases.

Within our get.keptn.sh script, we are trying to query the latest as well as all releases of Keptn, e.g.:

curl --silent "https://api.github.com/repos/keptn/keptn/releases"

When executing this command, we get a response with the rate limit showing up:

{"message":"API rate limit exceeded for AB.CD.EF.GH. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

edit: This also affects our nightly tests using MacOS: https://github.com/keptn/get.keptn.sh/actions/runs/1776225287

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.