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
54 changes: 54 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: metal-stack component release
on:
pull_request:
branches:
- main
release:
types:
- published
push:
branches:
- main

jobs:
draft:
uses: metal-stack/actions-common/.github/workflows/release-drafter.yaml@v1

spell-check:
uses: metal-stack/actions-common/.github/workflows/spell-check.yaml@v1

go-build:
uses: metal-stack/actions-common/.github/workflows/go-build-multiarch.yaml@v1
secrets: inherit
with:
platforms: |
[
{"platform": "linux/amd64", "goos": "linux", "goarch": "amd64", "runner": "ubuntu-latest"},
{"platform": "linux/arm64", "goos": "linux", "goarch": "arm64", "runner": "ubuntu-26.04-arm"},
{"platform": "linux/arm/v7", "goos": "linux", "goarch": "arm", "runner": "ubuntu-26.04-arm"},
{"build_only": true, "goos": "windows", "goarch": "amd64", "runner": "ubuntu-latest"},
{"build_only": true, "goos": "darwin", "goarch": "amd64", "runner": "ubuntu-latest"},
{"build_only": true, "goos": "darwin", "goarch": "arm64", "runner": "ubuntu-26.04-arm"}
]
build-command: make cli
artifact-files: |
bin/metal*

release-assets:
uses: metal-stack/actions-common/.github/workflows/release-assets.yaml@v1
needs:
- go-build
with:
artifact-ids: ${{ needs.go-build.outputs.go-build-artifacts }}
files: |
./bin/*

gcp-bucket-push:
uses: metal-stack/actions-common/.github/workflows/gcp-bucket-push.yaml@v1
secrets: inherit
needs:
- go-build
with:
artifact-ids: ${{ needs.go-build.outputs.go-build-artifacts }}
bucket: images.metal-pod.io
113 changes: 0 additions & 113 deletions .github/workflows/docker.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM alpine:3.24
ARG TARGETARCH
LABEL maintainer="metal-stack authors <info@metal-stack.io>"
COPY bin/metalctlv2-linux-amd64 /metalctl
COPY --chmod=0755 metalctlv2-linux-${TARGETARCH} /metalctl
ENTRYPOINT ["/metalctl"]
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GOOS := linux
GOARCH := amd64
GOOS ?= linux
GOARCH ?= amd64
BINARY := metalctlv2-$(GOOS)-$(GOARCH)
TAGS := -tags 'netgo'
SHA := $(shell git rev-parse --short=8 HEAD)
Expand All @@ -9,7 +9,7 @@ BUILDDATE := $(shell date --iso-8601=seconds)
VERSION := $(or ${VERSION},$(shell git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD))

ifeq ($(GOOS),linux)
LINKMODE := -linkmode external -extldflags '-static -s -w'
LINKMODE := -s -w
TAGS := -tags 'osusergo netgo static_build'
endif

Expand All @@ -23,7 +23,7 @@ all: test cli markdown

.PHONY: cli
cli:
go build \
CGO_ENABLED=0 go build \
$(TAGS) \
-ldflags \
"$(LINKMODE)" \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This is the official V2 CLI for accessing the API of [metal-stack.io](https://me
Download locations:

- [metalctlv2-linux-amd64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-linux-amd64)
- [metalctlv2-linux-arm64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-linux-arm64)
- [metalctlv2-linux-arm](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-linux-arm) (32-bit ARM, armv7)
- [metalctlv2-darwin-amd64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-darwin-amd64)
- [metalctlv2-darwin-arm64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-darwin-arm64)
- [metalctlv2-windows-amd64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-windows-amd64)
Expand All @@ -25,6 +27,8 @@ chmod +x metalctlv2-linux-amd64
sudo mv metalctlv2-linux-amd64 /usr/local/bin/metalctlv2
```

Choose according to your processor architecture: For ARM systems use `metalctlv2-linux-arm64`, for ARM V7 systems (e.g. Raspberry Pi) use `metalctlv2-linux-arm` instead of `metalctlv2-linux-amd64`.

### Installation on MacOS

For x86 based Macs:
Expand Down
7 changes: 7 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[files]
extend-exclude = ["go.mod", "go.sum"]

[default.extend-words]
leafs = "leafs"
PN = "PN"
HPE = "HPE"
2 changes: 1 addition & 1 deletion cmd/tableprinters/switch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func TestTablePrinter_SwitchTable(t *testing.T) {
{"r02leaf01", "partition-a", "rack02", apiv2.SwitchOSVendor_SWITCH_OS_VENDOR_UNSPECIFIED.String(), "", color.RedString(dot), "1h ago"}, // status red because last error came later than last sync
{"r02leaf02", "partition-a", "rack02", "", "", color.RedString(dot), "10m ago"}, // status red because last sync is too long ago
{"r03leaf01", "partition-a", "rack03", "", "", color.YellowString(dot), "0s ago"}, // status yellow because last sync duration was too long
{"r03leaf02", "partition-a", "rack03", "", "", color.YellowString(dot), ""}, // status yellow because not all connceted ports are up
{"r03leaf02", "partition-a", "rack03", "", "", color.YellowString(dot), ""}, // status yellow because not all connected ports are up
},
},
{
Expand Down
Loading