Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Codefresh Support Package",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"onCreateCommand": "curl -fsSL https://deno.land/install.sh | sh -s -- -y",
"image": "mcr.microsoft.com/devcontainers/go:1",
"customizations": {
"vscode": {
"settings": {
"deno.enable": true,
"deno.lint": true
},
"extensions": [
"denoland.vscode-deno",
"davidanson.vscode-markdownlint",
"redhat.vscode-yaml"
"redhat.vscode-yaml",
"golang.go"
]
}
}
Expand Down
51 changes: 16 additions & 35 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,28 @@ name: Release
on:
push:
tags:
- 'v*' # Triggers the workflow on new tags that start with 'v'
- 'v*' # Trigger only on tags starting with "v" (e.g., v1.0.0)

jobs:
build:
release:
runs-on: ubuntu-latest

permissions:
contents: write # Needed to create GitHub releases

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Deno
uses: denoland/setup-deno@v2
- name: Set up Go
uses: actions/setup-go@v5
with:
deno-version: vx.x.x

- name: Compile binaries
run: |
sed -i "s/__APP_VERSION__/$TAG_NAME/g" main.js
deno task compile
env:
TAG_NAME: ${{ github.ref_name }}
go-version: '1.24' # Use the version of Go your project requires

- name: Package binaries
run: |
zip ./bin/cf-support_windows_x86_64.zip ./bin/cf-support_windows_x86_64.exe
tar -czvf ./bin/cf-support_darwin_x86_64.tar.gz ./bin/cf-support_darwin_x86_64
tar -czvf ./bin/cf-support_darwin_arm64.tar.gz ./bin/cf-support_darwin_arm64
tar -czvf ./bin/cf-support_linux_x86_64.tar.gz ./bin/cf-support_linux_x86_64

- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
artifacts: |
./bin/cf-support_windows_x86_64.zip
./bin/cf-support_darwin_x86_64.tar.gz
./bin/cf-support_darwin_arm64.tar.gz
./bin/cf-support_linux_x86_64.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
version: latest # Or pin a specific version
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154 changes: 25 additions & 129 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,132 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
#macos files
.DS_Store
bin
28 changes: 28 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
project_name: cf-support
builds:
- id: default
main: ./main.go
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ldflags:
- "-s -w -X github.com/codefresh-support/codefresh-support-package/cmd.Version={{.Version}}"

archives:
- format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip # Use zip format for Windows builds

checksum:
name_template: "checksums.txt"

release:
github:
owner: codefresh-support
name: codefresh-support-package
12 changes: 6 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2024 Codefresh Support
Copyright © 2025 Codefresh Support <support@codefresh.io>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codefresh Support Package

This project is designed to gather data from Hybrid Runtimes for Codefresh SaaS platform, and Hybrid Runtimes and OnPrem isntallation on the OnPrem Platform. It collects information about various Kubernetes resources such as Pods, Nodes, Configmaps, Services, and Events. For Classic and OnPrem we gather some informtion from the platform itself.
This project is designed to gather data from Codefresh Hybrid Runtimes OnPrem isntallation, and Open Source ArgoCD. It collects information about various Kubernetes resources such as Pods, Nodes, Configmaps, Services, and Events. For Pipelines and OnPrem we gather some informtion from the platform itself.

## Prereqs

Expand All @@ -11,7 +11,7 @@ This project is designed to gather data from Hybrid Runtimes for Codefresh SaaS
- Or the following ENV vars set.
- `CF_API_KEY`: Codefresh API Token
- `CF_URL`: URL of the platform (ex: `https://g.codefresh.io`)
- Need an Account Admin Token for Claasic Hybrid Runtime.
- Need an Account Admin Token for Pipelines Hybrid Runtime.
- Need a System Admin Token for the OnPrem Installation.
- JQ
- Used only to get the latest version of the binary for *nix systems.
Expand All @@ -34,14 +34,14 @@ chmod +x cf-support
./cf-support
```

### macOS - x86_64
### macOS - amd64

```shell
# get the latest version or change to a specific version
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-support/codefresh-support-package/releases/latest" | jq -r ".tag_name")

# download and extract the binary
curl -L --output - https://github.com/codefresh-support/codefresh-support-package/releases/download/$VERSION/cf-support_darwin_x86_64.tar.gz | tar zx -O > cf-support
curl -L --output - https://github.com/codefresh-support/codefresh-support-package/releases/download/$VERSION/cf-support_darwin_amd64.tar.gz | tar zx -O > cf-support

# set execution to binary
chmod +x cf-support
Expand All @@ -50,14 +50,14 @@ chmod +x cf-support
./cf-support
```

### linux - x86_64
### linux - arm64

```shell
# get the latest version or change to a specific version
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-support/codefresh-support-package/releases/latest" | jq -r ".tag_name")

# download and extract the binary
curl -L --output - https://github.com/codefresh-support/codefresh-support-package/releases/download/$VERSION/cf-support_linux_x86_64.tar.gz | tar zx -O > cf-support
curl -L --output - https://github.com/codefresh-support/codefresh-support-package/releases/download/$VERSION/cf-support_linux_arm64.tar.gz | tar zx -O > cf-support

# set execution to binary
chmod +x cf-support
Expand All @@ -66,10 +66,26 @@ chmod +x cf-support
./cf-support
```

### Windows - x86_64
### linux - amd64

```shell
# get the latest version or change to a specific version
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-support/codefresh-support-package/releases/latest" | jq -r ".tag_name")

# download and extract the binary
curl -L --output - https://github.com/codefresh-support/codefresh-support-package/releases/download/$VERSION/cf-support_linux_amd64.tar.gz | tar zx -O > cf-support

# set execution to binary
chmod +x cf-support

# run application
./cf-support
```

### Windows - arm64/amd6

1. Go the the [Latest](https://github.com/codefresh-support/codefresh-support-package/releases/latest) release.
1. Download the cf-support_windows_x86_64.zip file
1. Download the cf-support_windows_arm64.zip / cf-support_windows_amd64.zip file
1. Run the `.exe` file via CMD or PowerShell

## How to Release a New Version
Expand Down
Loading