Skip to content

Commit

Permalink
Merge pull request #4 from container-tools/issue/3/fix-camel-k-2.x
Browse files Browse the repository at this point in the history
fix(#3): Fix action with Camel K 2.x
  • Loading branch information
christophd authored Aug 17, 2023
2 parents af14881 + 2f1ec68 commit cd9aaae
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Test

on:
workflow_dispatch:
pull_request:
push:
branches:
Expand Down Expand Up @@ -54,8 +55,9 @@ jobs:
- macos-latest
- windows-latest
version:
- v1.5.0
- v1.4.1
- v1.10.4
- v1.12.1
- v2.0.0
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand Down
28 changes: 25 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ EOF
main() {
local version="$DEFAULT_VERSION"
local github_token=

parse_command_line "$@"

install_camel_k
Expand Down Expand Up @@ -93,7 +93,20 @@ install_camel_k() {

echo "Installing Camel K CLI version $version$info on $os..."

curl -L --silent https://github.com/apache/camel-k/releases/download/$install_version/camel-k-client-$binary_version-$os-64bit.tar.gz -o kamel.tar.gz
arch=$(get_arch)
if [[ $binary_version == 1.* ]]
then
arch="64bit"

if [[ "$os" = "darwin" ]]
then
os="mac"
fi
fi

echo "Loading camel-k/releases/download/$install_version/camel-k-client-$binary_version-$os-$arch.tar.gz"

curl -L --silent https://github.com/apache/camel-k/releases/download/$install_version/camel-k-client-$binary_version-$os-$arch.tar.gz -o kamel.tar.gz
mkdir -p _kamel
tar -zxf kamel.tar.gz --directory ./_kamel

Expand Down Expand Up @@ -125,7 +138,7 @@ get_os() {
osline="$(uname -s)"
case "${osline}" in
Linux*) os=linux;;
Darwin*) os=mac;;
Darwin*) os=darwin;;
CYGWIN*) os=windows;;
MINGW*) os=windows;;
Windows*) os=windows;;
Expand All @@ -134,4 +147,13 @@ get_os() {
echo ${os}
}

get_arch() {
archline="$(uname -m)"
case "${archline}" in
x86_64*) arch="amd64";;
*) arch="${archline}"
esac
echo ${arch}
}

main "$@"

0 comments on commit cd9aaae

Please # to comment.