Various fixes in software.yml

This commit is contained in:
Brian Zalewski 2023-12-05 07:59:05 +00:00
parent ce8fb94a45
commit 05ec829eea
3 changed files with 22 additions and 19 deletions

View file

@ -1739,7 +1739,7 @@ softwarePlugins:
- if ! helm plugin list | grep "Query at a given interval a Prometheus, ElasticSearch or Sentry instance." > /dev/null; then helm plugin install https://github.com/ContainerSolutions/helm-monitor; fi
- if ! helm plugin list | grep "This plugin provides secrets values encryption for Helm charts secure storing" > /dev/null; then helm plugin install https://github.com/jkroepke/helm-secrets; fi
krew:
cmd: bash -c 'if ! kubectl krew list | grep "^{PLUGIN}$" > /dev/null; then if ! kubectl krew search "{PLUGIN}" | grep ' unavailable on ' > /dev/null; then kubectl krew install "{PLUGIN}"; else echo "UNSUPPORTED PLATFORM - {PLUGIN} is not supported on the current platform"; fi; fi'
cmd: bash -c 'if ! kubectl krew list | grep "^{PLUGIN}$" > /dev/null; then if ! kubectl krew search "{PLUGIN}" | grep " unavailable on " > /dev/null; then kubectl krew install "{PLUGIN}"; else echo "UNSUPPORTED PLATFORM - {PLUGIN} is not supported on the current platform"; fi; fi'
plugins:
- access-matrix
- cert-manager

View file

@ -772,7 +772,7 @@ async function beforeInstall(packageManager) {
log('error', 'Homebrew', 'Failed running brew update / upgrade')
log('info', 'Homebrew', 'Running brew tap --repair and trying again')
try {
runCommand('Repairing taps and retrying brew update / upgrade', 'sudo rm -rf $(brew --cache) && brew tap --repair && brew update && brew upgrade --cask --greedy && brew upgrade --force --greedy')
runCommand('Repairing taps and retrying brew update / upgrade', 'export HOMEBREW_TEMP=/tmp && sudo rm -rf $(brew --cache) && brew tap --repair && brew update && brew upgrade --cask --greedy && brew upgrade --force --greedy')
} catch (e) {
console.log(e)
log('error', 'Homebrew', 'Failed both attempts to run brew update / upgrade')
@ -1789,30 +1789,31 @@ async function pruneInstallOrders(installOrders) {
async function installPlugins(pluginData) {
if (pluginData.cmd && pluginData.plugins && pluginData.plugins.length) {
for (const plugin of pluginData.plugins) {
try {
const pluginCmd = pluginData.cmd.replace(/{PLUGIN}/g, plugin)
const pluginWhen = pluginData.when
const pluginWhen = pluginData.when
try {
runCommand(`Checking when condition for ${pluginData.package} plugin - ${plugin}`, pluginWhen)
for (const plugin of pluginData.plugins) {
try {
if (pluginWhen) {
runCommand(`Checking when condition for ${pluginData.package} plugin - ${plugin}`, pluginWhen)
}
const pluginCmd = pluginData.cmd.replace(/{PLUGIN}/g, plugin)
try {
runCommand(`Installing ${pluginData.package} plugin - ${plugin}`, pluginCmd)
log('success', 'Plugin', `Successfully installed ${pluginData.package} plugin - ${plugin}`)
try {
runCommand(`Installing ${pluginData.package} plugin - ${plugin}`, pluginCmd)
log('success', 'Plugin', `Successfully installed ${pluginData.package} plugin - ${plugin}`)
} catch (e) {
log('info', 'Plugin', `Failed to install ${pluginData.package} plugin - ${plugin}`)
console.error(e)
}
} catch (e) {
log('info', 'Plugin', `Failed to install ${pluginData.package} plugin - ${plugin}`)
console.error(e)
log('info', 'Plugin', `Skipping ${pluginData.package} plugin installs due to failed when condition - ${pluginWhen}`)
break
}
} catch (e) {
log('info', 'Plugin', `Skipping ${pluginData.package} plugin installs due to failed when condition - ${pluginWhen}`)
break
log('error', 'Plugin', `Failed to install ${pluginData.package} plugin due to an unknown reason - ${plugin}`)
console.error(e)
}
} catch (e) {
log('error', 'Plugin', `Failed to install ${pluginData.package} plugin due to an unknown reason - ${plugin}`)
console.error(e)
}
} catch (e) {
log('info', 'Plugin', 'Failed to pass when condition')
}
}
if (pluginData.update) {

View file

@ -1294,6 +1294,7 @@ softwarePackages:
brew-pkg:
_github: https://github.com/timsutton/brew-pkg
_name: Homebrew Pkg
_when:brew:darwin: '! brew list brew-pkg'
brew:darwin: timsutton/formulae/brew-pkg
xpanes:
_bin: xpanes
@ -10235,6 +10236,7 @@ softwarePackages:
_bin: github-classroom-assistant
_github: https://github.com/education/classroom-assistant
_name: GitHub Classroom Assistant
_app: Classroom Assistant.app
apt: https://github.com/education/classroom-assistant/releases/download/v2.0.4/classroom-assistant_2.0.4_amd64.deb
dnf: https://github.com/education/classroom-assistant/releases/download/v2.0.4/classroom-assistant-2.0.4-1.x86_64.rpm
cask: classroom-assistant