generated from saic-oss/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/github-actions-integration
- Loading branch information
Showing
37 changed files
with
426 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
# Check DNF for an update to the given package | ||
# Inputs: package to check for an update, e.g. "container.io" | ||
# Return: 0 if an update is availabe; non-0 if no update is available | ||
checkForDnfUpdate() { | ||
dnf list updates 2>&1 | grep "^$*" > /dev/null | ||
} | ||
|
||
# Gets latest release from DNF | ||
# Inputs: package to check for an update, e.g. "skopeo.x86_64" | ||
# Return: String containing the latest release version, e.g. "0.1.2" | ||
getLatestVersionFromDnf() { | ||
dnf list updates 2> /dev/null | grep "$*" 2> /dev/null | awk '{print $2}' 2> /dev/null | ||
} | ||
|
||
# Get the latest release from a GitHub project | ||
# Inputs: owner and repo of the GitHub project to check, e.g. "docker/compose" | ||
# Output: String containing the latest release version, e.g. "0.1.2" | ||
getLatestGitHubRelease() { | ||
curl -H "Accept: application/vnd.github.v3+json" \ | ||
"https://api.github.com/repos/"$*"/releases" 2> /dev/null | \ | ||
jq '.[0].name' 2> /dev/null | ||
} | ||
|
||
# Get the latest tag from a GitHub project | ||
# Inputs: owner and repo of the GitHub project to check, e.g. "docker/compose" | ||
# Output: String containing the latest tag version, e.g. "0.1.2" | ||
getLatestGitHubTag() { | ||
curl -H "Accept: application/vnd.github.v3+json" \ | ||
"https://api.github.com/repos/"$*"/tags" 2> /dev/null | \ | ||
jq '.[0].name' 2> /dev/null | ||
} | ||
|
||
# Check pip for an update to the given package | ||
# Inputs: package to check for an update, e.g. "awscli" | ||
# Return: 0 if an update is availabe; non-0 if no update is available | ||
checkForPipUpdate() { | ||
pip list --outdated 2> /dev/null | grep "^$*" > /dev/null | ||
} | ||
|
||
# Get latest version of an update from Pip | ||
# Inputs: package to check for an update, e.g. "pipenv" | ||
# Return: String containing the latest version, e.g. "0.1.2" | ||
getLatestVersionFromPip() { | ||
pip list --outdated 2> /dev/null | grep "$*" 2> /dev/null | awk '{print $3}' 2> /dev/null | ||
} | ||
|
||
# Get the latest version from asdf | ||
# Input: name of the package, e.g. "terraform" | ||
# Return: String containing the latest version, e.g. "0.1.2" | ||
getLatestVersionFromAsdf() { | ||
asdf latest $* 2> /dev/null | ||
} | ||
|
||
# Get the latest version from asdf list | ||
# Some packages are not supported with asdf latest | ||
# Input: name of the package, e.g. "java" | ||
# Return: String containing the latest version, e.g. "0.1.2" | ||
getLatestVersionFromAsdfList() { | ||
asdf list $* 2> /dev/null | ||
} | ||
|
||
# Get the latest version from npm | ||
# Inputs: name of the package, e.g. "serverless" | ||
# Return: String containing the latest version, e.g. "0.1.2" | ||
getLatestVersionFromNpm() { | ||
npm show $* version 2> /dev/null | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for an asdf update" | ||
Include ./lib_updates | ||
It "validates asdf is up-to-date via GitHub" | ||
When call getLatestGitHubTag asdf-vm/asdf | ||
The output should include "${ASDF_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a AWS CLI update" | ||
Include ./lib_updates | ||
It "validates AWS CLI is up-to-date via pip" | ||
When call getLatestVersionFromPip awscli | ||
The output should include "${AWS_CLI_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Helm Chart Releaser update" | ||
Include ./lib_updates | ||
It "validates Helm Chart Releaser is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf helm-cr | ||
The output should include "${CHART_RELEASER_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Docker Compose update" | ||
Include ./lib_updates | ||
It "validates Docker Compose is up-to-date via GitHub" | ||
When call getLatestGitHubTag docker/compose | ||
The output should include "${DOCKER_COMPOSE_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Docker update" | ||
Include ./lib_updates | ||
It "checks DNF update list for Docker" | ||
When call checkForDnfUpdate docker-ce.x86_64 | ||
The status should not eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Fossa update" | ||
Include ./lib_updates | ||
It "validates Fossa is up-to-date via GitHub" | ||
When call getLatestGitHubRelease fossas/fossa-cli | ||
The output should include "${FOSSA_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Go update" | ||
Include ./lib_updates | ||
It "validates Go is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf golang | ||
The output should include "${GO_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Go-Task update" | ||
Include ./lib_updates | ||
It "validates Go-Task is up-to-date via GitHub" | ||
When call getLatestGitHubTag go-task/task | ||
The output should include "${GO_TASK_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for GolangCI Lint update" | ||
Include ./lib_updates | ||
It "validates GolangCI Lint is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf golangci-lint | ||
The output should include "${GOLANGCI_LINT_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Gomplate update" | ||
Include ./lib_updates | ||
It "validates Gomplate is up-to-date via GitHub" | ||
When call getLatestGitHubTag hairyhenderson/gomplate | ||
The output should include "${GOMPLATE_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Go Releaser update" | ||
Include ./lib_updates | ||
It "validates Go Releaser is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf goreleaser | ||
The output should include "${GORELEASER_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Hadolint update" | ||
Include ./lib_updates | ||
It "validates Hadolint is up-to-date via GitHub" | ||
When call getLatestGitHubTag hadolint/hadolint | ||
The output should include "${HADOLINT_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Helm Diff update" | ||
Include ./lib_updates | ||
It "validates Helm Diff is up-to-date via GitHub" | ||
When call getLatestGitHubTag databus23/helm-diff | ||
The output should include "${HELM_DIFF_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Helm Git update" | ||
Include ./lib_updates | ||
It "validates Helm Git is up-to-date via GitHub" | ||
When call getLatestGitHubTag aslafy-z/helm-git | ||
The output should include "${HELM_GIT_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Helm S3 update" | ||
Include ./lib_updates | ||
It "validates Helm S3 is up-to-date via GitHub" | ||
When call getLatestGitHubTag hypnoglow/helm-s3 | ||
The output should include "${HELM_S3_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Helm update" | ||
Include ./lib_updates | ||
It "validates Helm is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf helm | ||
The output should include "${HELM_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Helmfile update" | ||
Include ./lib_updates | ||
It "validates Helmfile is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf helmfile | ||
The output should include "${HELMFILE_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Java update" | ||
Include ./lib_updates | ||
It "validates Java is up-to-date via asdf" | ||
When call getLatestVersionFromAsdfList java | ||
The output should include "${JAVA_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Klar update" | ||
Include ./lib_updates | ||
It "validates Klar is up-to-date via GitHub" | ||
When call getLatestGitHubRelease optiopay/klar | ||
The output should include "${KLAR_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Kubectl update" | ||
Include ./lib_updates | ||
It "validates Kubectl is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf kubectl | ||
The output should include "${KUBECTL_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Maven update" | ||
Include ./lib_updates | ||
It "validates Maven is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf maven | ||
The output should include "${MAVEN_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Node update" | ||
Include ./lib_updates | ||
It "validates Node is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf nodejs | ||
The output should include "${NODEJS_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Pipenv update" | ||
Include ./lib_updates | ||
It "validates Pipenv is up-to-date via pip" | ||
When call getLatestVersionFromPip pipenv | ||
The output should include "${PIPENV_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Podman update" | ||
Include ./lib_updates | ||
It "gets the latest version of Podman" | ||
When call checkForDnfUpdate podman.x86_64 | ||
The status should not eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Pre-commit update" | ||
Include ./lib_updates | ||
It "validates Pre-commit is up-to-date via pip" | ||
When call getLatestVersionFromPip pre-commit | ||
The output should include "${PRE_COMMIT_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Python update" | ||
Include ./lib_updates | ||
It "validates Python is up-to-date via asdf" | ||
When call getLatestVersionFromAsdf python | ||
The output should include "${PYTHON_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for Serverless update" | ||
Include ./lib_updates | ||
It "validates Serverless is up-to-date via npm" | ||
When call getLatestVersionFromNpm serverless | ||
The output should include "${SERVERLESS_VERSION}" | ||
The status should eq 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env shellspec | ||
|
||
Describe "Check for a Shellcheck update" | ||
Include ./lib_updates | ||
It "validates Shellcheck is up-to-date via GitHub" | ||
When call getLatestGitHubTag koalaman/shellcheck | ||
The output should include "${SHELLCHECK_VERSION}" | ||
The status should eq 0 | ||
End | ||
End |
Oops, something went wrong.