-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run crystal-lang autoformatter on rest of the repo
- Do other formatting operations as breaking long lines etc - Update according to changes in Helm module Signed-off-by: Rafal Lal <[email protected]>
- Loading branch information
Showing
8 changed files
with
93 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,33 @@ | ||
on: | ||
push: | ||
paths: | ||
- '**' | ||
- '!**.md' | ||
- "**" | ||
- "!**.md" | ||
pull_request: | ||
paths: | ||
- '**' | ||
- '!**.md' | ||
- "**" | ||
- "!**.md" | ||
branches: [master] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Crystal | ||
uses: crystal-lang/install-crystal@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
|
||
- name: Global Helm Binary | ||
uses: azure/setup-helm@v3 | ||
|
||
- name: Run tests | ||
run: | | ||
shards install | ||
crystal spec | ||
crystal spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require "spec" | ||
require "colorize" | ||
|
||
ENV["CRYSTAL_ENV"] = "TEST" | ||
ENV["CRYSTAL_ENV"] = "TEST" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Helm | ||
DEFAULT_ARCH = "linux-amd64" | ||
DEFAULT_LOCAL_BINARY_PATH = "tools/helm" | ||
BASE_CONFIG = "./config.yml" | ||
end | ||
DEFAULT_ARCH = "linux-amd64" | ||
DEFAULT_LOCAL_BINARY_PATH = "tools/helm" | ||
BASE_CONFIG = "./config.yml" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,42 @@ | ||
require "./utils.cr" | ||
require "./system_information.cr" | ||
|
||
class BinaryReference | ||
class BinaryReference | ||
@helm : String? | ||
|
||
|
||
def global_helm_installed? | ||
Helm::SystemInfo.global_helm_installed? | ||
end | ||
|
||
def helm_global_response(verbose=false) | ||
Process.run("helm version", shell: true, output: stdout = IO::Memory.new, error: stderr = IO::Memory.new) | ||
stdout.to_s | ||
end | ||
|
||
def helm_v3_version(helm_response) | ||
# version.BuildInfo{Version:"v3.1.1", GitCommit:"afe70585407b420d0097d07b21c47dc511525ac8", GitTreeState:"clean", GoVersion:"go1.13.8"} | ||
helm_v3 = helm_response.match /BuildInfo{Version:\"(v([0-9]{1,3}[\.]){1,2}[0-9]{1,3}).+"/ | ||
helm_v3 && helm_v3.not_nil![1] | ||
end | ||
|
||
def global_helm | ||
"helm" | ||
end | ||
|
||
def local_helm_installed? | ||
Helm::SystemInfo.local_helm_installed? | ||
end | ||
|
||
|
||
def installation_found? | ||
global_helm_installed? || local_helm_installed? | ||
end | ||
|
||
def local_helm | ||
local_helm_full_path | ||
end | ||
|
||
# Get helm directory | ||
def helm | ||
@helm ||= global_helm_installed? ? global_helm : local_helm | ||
end | ||
end | ||
def global_helm_installed? | ||
Helm::SystemInfo.global_helm_installed? | ||
end | ||
|
||
def helm_global_response(verbose = false) | ||
Process.run("helm version", shell: true, output: stdout = IO::Memory.new, error: stderr = IO::Memory.new) | ||
stdout.to_s | ||
end | ||
|
||
def helm_v3_version(helm_response) | ||
# version.BuildInfo{Version:"v3.1.1", GitCommit:"afe70585407b420d0097d07b21c47dc511525ac8", GitTreeState:"clean", GoVersion:"go1.13.8"} | ||
helm_v3 = helm_response.match /BuildInfo{Version:\"(v([0-9]{1,3}[\.]){1,2}[0-9]{1,3}).+"/ | ||
helm_v3 && helm_v3.not_nil![1] | ||
end | ||
|
||
def global_helm | ||
"helm" | ||
end | ||
|
||
def local_helm_installed? | ||
Helm::SystemInfo.local_helm_installed? | ||
end | ||
|
||
def installation_found? | ||
global_helm_installed? || local_helm_installed? | ||
end | ||
|
||
def local_helm | ||
local_helm_full_path | ||
end | ||
|
||
# Get helm directory | ||
def helm | ||
@helm ||= global_helm_installed? ? global_helm : local_helm | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters