Skip to content

Commit c86b84c

Browse files
authored
Support Package Refresh 2025-02 (#23)
- converted to golang - added support for flags - added support for OSS ArgoCD
1 parent e07137b commit c86b84c

34 files changed

+1302
-869
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
// For format details, see https://aka.ms/devcontainer.json.
22
{
33
"name": "Codefresh Support Package",
4-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
5-
"onCreateCommand": "curl -fsSL https://deno.land/install.sh | sh -s -- -y",
4+
"image": "mcr.microsoft.com/devcontainers/go:1",
65
"customizations": {
76
"vscode": {
8-
"settings": {
9-
"deno.enable": true,
10-
"deno.lint": true
11-
},
127
"extensions": [
13-
"denoland.vscode-deno",
148
"davidanson.vscode-markdownlint",
15-
"redhat.vscode-yaml"
9+
"redhat.vscode-yaml",
10+
"golang.go"
1611
]
1712
}
1813
}

.github/workflows/release.yaml

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,28 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*' # Triggers the workflow on new tags that start with 'v'
6+
- 'v*' # Trigger only on tags starting with "v" (e.g., v1.0.0)
77

88
jobs:
9-
build:
9+
release:
1010
runs-on: ubuntu-latest
1111

12+
permissions:
13+
contents: write # Needed to create GitHub releases
14+
1215
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v2
16+
- name: Checkout code
17+
uses: actions/checkout@v4
1518

16-
- name: Set up Deno
17-
uses: denoland/setup-deno@v2
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
1821
with:
19-
deno-version: vx.x.x
20-
21-
- name: Compile binaries
22-
run: |
23-
sed -i "s/__APP_VERSION__/$TAG_NAME/g" main.js
24-
deno task compile
25-
env:
26-
TAG_NAME: ${{ github.ref_name }}
22+
go-version: '1.24' # Use the version of Go your project requires
2723

28-
- name: Package binaries
29-
run: |
30-
zip ./bin/cf-support_windows_x86_64.zip ./bin/cf-support_windows_x86_64.exe
31-
tar -czvf ./bin/cf-support_darwin_x86_64.tar.gz ./bin/cf-support_darwin_x86_64
32-
tar -czvf ./bin/cf-support_darwin_arm64.tar.gz ./bin/cf-support_darwin_arm64
33-
tar -czvf ./bin/cf-support_linux_x86_64.tar.gz ./bin/cf-support_linux_x86_64
34-
35-
- name: Create GitHub Release
36-
id: create_release
37-
uses: ncipollo/release-action@v1
24+
- name: Install GoReleaser
25+
uses: goreleaser/goreleaser-action@v6
3826
with:
39-
artifacts: |
40-
./bin/cf-support_windows_x86_64.zip
41-
./bin/cf-support_darwin_x86_64.tar.gz
42-
./bin/cf-support_darwin_arm64.tar.gz
43-
./bin/cf-support_linux_x86_64.tar.gz
44-
token: ${{ secrets.GITHUB_TOKEN }}
45-
tag: ${{ github.ref_name }}
46-
name: ${{ github.ref_name }}
47-
body: ${{ github.event.head_commit.message }}
48-
draft: false
49-
prerelease: false
27+
version: latest # Or pin a specific version
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 25 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,28 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
.pnpm-debug.log*
9-
10-
# Diagnostic reports (https://nodejs.org/api/report.html)
11-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12-
13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
*.pid.lock
18-
19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
*.lcov
25-
26-
# nyc test coverage
27-
.nyc_output
28-
29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
38-
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
40-
41-
# Dependency directories
42-
node_modules/
43-
jspm_packages/
44-
45-
# Snowpack dependency directory (https://snowpack.dev/)
46-
web_modules/
47-
48-
# TypeScript cache
49-
*.tsbuildinfo
50-
51-
# Optional npm cache directory
52-
.npm
53-
54-
# Optional eslint cache
55-
.eslintcache
56-
57-
# Optional stylelint cache
58-
.stylelintcache
59-
60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
66-
# Optional REPL history
67-
.node_repl_history
68-
69-
# Output of 'npm pack'
70-
*.tgz
71-
72-
# Yarn Integrity file
73-
.yarn-integrity
74-
75-
# dotenv environment variable files
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Dependency directories (remove the comment below to include it)
18+
# vendor/
19+
20+
# Go workspace file
21+
go.work
22+
go.work.sum
23+
24+
# env file
7625
.env
77-
.env.development.local
78-
.env.test.local
79-
.env.production.local
80-
.env.local
81-
82-
# parcel-bundler cache (https://parceljs.org/)
83-
.cache
84-
.parcel-cache
85-
86-
# Next.js build output
87-
.next
88-
out
89-
90-
# Nuxt.js build / generate output
91-
.nuxt
92-
dist
93-
94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
100-
# vuepress build output
101-
.vuepress/dist
102-
103-
# vuepress v2.x temp and cache directory
104-
.temp
105-
.cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# TernJS port file
120-
.tern-port
121-
122-
# Stores VSCode versions used for testing VSCode extensions
123-
.vscode-test
12426

125-
# yarn v2
126-
.yarn/cache
127-
.yarn/unplugged
128-
.yarn/build-state.yml
129-
.yarn/install-state.gz
130-
.pnp.*
27+
#macos files
13128
.DS_Store
132-
bin

.goreleaser.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
project_name: cf-support
2+
builds:
3+
- id: default
4+
main: ./main.go
5+
goos:
6+
- linux
7+
- windows
8+
- darwin
9+
goarch:
10+
- amd64
11+
- arm64
12+
ldflags:
13+
- "-s -w -X github.com/codefresh-support/codefresh-support-package/cmd.Version={{.Version}}"
14+
15+
archives:
16+
- format: tar.gz
17+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
18+
format_overrides:
19+
- goos: windows
20+
format: zip # Use zip format for Windows builds
21+
22+
checksum:
23+
name_template: "checksums.txt"
24+
25+
release:
26+
github:
27+
owner: codefresh-support
28+
name: codefresh-support-package

LICENSE

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2024 Codefresh Support
3+
Copyright © 2025 Codefresh Support <[email protected]>
44

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

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

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Codefresh Support Package
22

3-
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.
3+
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.
44

55
## Prereqs
66

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

37-
### macOS - x86_64
37+
### macOS - amd64
3838

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

4343
# download and extract the binary
44-
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
44+
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
4545

4646
# set execution to binary
4747
chmod +x cf-support
@@ -50,14 +50,14 @@ chmod +x cf-support
5050
./cf-support
5151
```
5252

53-
### linux - x86_64
53+
### linux - arm64
5454

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

5959
# download and extract the binary
60-
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
60+
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
6161

6262
# set execution to binary
6363
chmod +x cf-support
@@ -66,10 +66,26 @@ chmod +x cf-support
6666
./cf-support
6767
```
6868

69-
### Windows - x86_64
69+
### linux - amd64
70+
71+
```shell
72+
# get the latest version or change to a specific version
73+
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-support/codefresh-support-package/releases/latest" | jq -r ".tag_name")
74+
75+
# download and extract the binary
76+
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
77+
78+
# set execution to binary
79+
chmod +x cf-support
80+
81+
# run application
82+
./cf-support
83+
```
84+
85+
### Windows - arm64/amd6
7086

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

7591
## How to Release a New Version

0 commit comments

Comments
 (0)