This commit is contained in:
adithyasunil26
2021-03-17 15:14:15 +04:00
committed by AJ ONeal
parent 29d0b6075e
commit 4bc553e6ba
4 changed files with 125 additions and 0 deletions

20
kind/README.md Normal file
View File

@@ -0,0 +1,20 @@
---
title: kind
homepage: https://github.com/kubernetes-sigs/kind
tagline: |
kind: tool for running local Kubernetes clusters using Docker container "nodes".
---
To update or switch versions, run `webi kind@stable` (or `@v2`, `@beta`,etc).
## Cheat Sheet
To create a cluster
```bash
kind create cluster
```
To delete a cluster
```bash
kind delete cluster
```

46
kind/install.ps1 Normal file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env pwsh
##################
# Install kind #
##################
$pkg_cmd_name = "kind"
$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\kind.exe"
$pkg_dst = "$pkg_dst_cmd"
$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\kind-v$Env:WEBI_VERSION\bin\kind.exe"
$pkg_src_bin = "$Env:USERPROFILE\.local\opt\kind-v$Env:WEBI_VERSION\bin"
$pkg_src_dir = "$Env:USERPROFILE\.local\opt\kind-v$Env:WEBI_VERSION"
$pkg_src = "$pkg_src_cmd"
$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"))
{
echo "Downloading kind from $Env:WEBI_PKG_URL to $pkg_download"
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
& move "$pkg_download.part" "$pkg_download"
}
IF (!(Test-Path -Path "$pkg_src_cmd"))
{
echo "Installing kind"
pushd .local\tmp
Remove-Item -Path ".\kind-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\kind.exe" -Recurse -ErrorAction Ignore
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
echo "Install Location: $pkg_src_cmd"
New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path ".\kind-*\kind.exe" -Destination "$pkg_src_bin"
popd
}
echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse

31
kind/install.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
function __init_kind() {
set -e
set -u
##################
# Install kind #
##################
pkg_cmd_name="kind"
pkg_dst_cmd="$HOME/.local/bin/kind"
pkg_dst="$pkg_dst_cmd"
pkg_src_cmd="$HOME/.local/opt/kind-v$WEBI_VERSION/bin/kind"
pkg_src_dir="$HOME/.local/opt/kind-v$WEBI_VERSION"
pkg_src="$pkg_src_cmd"
pkg_install() {
mkdir -p "$(dirname $pkg_src_cmd)"
mv ./kind-*/kind "$pkg_src_cmd"
}
pkg_get_current_version() {
echo $(kind --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
}
}
__init_kind

28
kind/releases.js Normal file
View File

@@ -0,0 +1,28 @@
'use strict';
var github = require('../_common/github.js');
var owner = 'kubernetes-sigs';
var repo = 'kind';
/******************************************************************************/
/** Note: Delete this Comment! **/
/** **/
/** Need a an example that filters out miscellaneous release files? **/
/** See `deno`, `gitea`, or `caddy` **/
/** **/
/******************************************************************************/
module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
return all;
});
};
if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
console.info(JSON.stringify(all, null, 2));
});
}