Skip to content

Commit

Permalink
Merge pull request #5 from ninech/packages
Browse files Browse the repository at this point in the history
Add macOS/linux packages
  • Loading branch information
ctrox authored Mar 23, 2023
2 parents 05bf113 + dd4cf87 commit e0b653b
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v3
with:
Expand Down
56 changes: 56 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,60 @@ changelog:
- '^docs:'
- '^test:'

brews:
- name: nctl

# GOARM to specify which 32-bit arm version to use if there are multiple
# versions from the build section. Brew formulas support only one 32-bit
# version.
# Default is 6 for all artifacts or each id if there are multiple versions.
goarm: 6

# GOAMD64 to specify which amd64 version to use if there are multiple
# versions from the build section.
# Default is v1.
goamd64: v1

tap:
owner: ninech
name: homebrew-taps
branch: main
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"

url_template: "https://github.com/ninech/nctl/releases/download/{{ .Tag }}/{{ .ArtifactName }}"

commit_author:
name: nine.ch Bot
email: ninech-bot@users.noreply.github.com

commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://github.com/ninech/nctl"
description: "Interact with Nine API resources."
license: "Apache 2.0"

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist folder only,
# leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the homebrew tap
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: false

nfpms:
- id: packages
license: Apache 2.0
formats:
- deb
- rpm
package_name: nctl
file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
maintainer: 'Nine Platform Team <platform@nine.ch>'

publishers:
- name: fury.io
ids:
- packages
dir: "{{ dir .ArtifactPath }}"
cmd: curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/ninedev/

# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
61 changes: 25 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,34 @@ Usage: nctl <command>

Interact with Nine API resources.

Flags:
-h, --help Show context-sensitive help.
-n, --namespace=STRING Limit commands to a namespace.
--api-cluster="nineapis.ch" Context name of the API cluster.
--version Print version information and quit.

Commands:
get clusters
Get Kubernetes Clusters.

get apiserviceaccounts (asa)
Get API Service Accounts

auth login <organization>
Login to nineapis.ch.

auth cluster <name>
Authenticate with Kubernetes Cluster.

completions
Print shell completions.

create vcluster [<name>]
Create a new vcluster.

create apiserviceaccount (asa) [<name>]
Create a new API Service Account.

delete vcluster <name>
Delete a vcluster.
Run "nctl <command> --help" for more information on a command.
```

delete apiserviceaccount (asa) <name>
Delete a new API Service Account.
## Setup

Run "nctl <command> --help" for more information on a command.
```bash
# If you have go already installed
go install github.com/ninech/nctl@latest

# Homebrew
brew install ninech/taps/nctl

# Debian/Ubuntu
echo "deb [trusted=yes] https://repo.nine.ch/deb/ /" > /etc/apt/sources.list.d/repo.nine.ch.list
apt install nctl

# Fedora/RHEL
cat <<EOF > /etc/yum.repos.d/repo.nine.ch.repo
[repo.nine.ch]
name=Nine Repo
baseurl=https://repo.nine.ch/yum/
enabled=1
gpgcheck=0
EOF
dnf install nctl
```

## Getting started

* download the binary from the latest release or if you have go installed `go install github.com/ninech/nctl@latest`
* add `nctl` to your PATH
* login to the API using `nctl auth login <organization>`
* login to the API using `nctl auth login <cockpit account name>`
* run `nctl --help` to get a list of all available commands
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -791,12 +791,6 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/ninech/apis v0.0.0-20230309090302-9ed639d8fe58 h1:e8PRpyhxlk7e6HSj2oiqtEfCPoUp5qUmsUz2fOD3KKU=
github.com/ninech/apis v0.0.0-20230309090302-9ed639d8fe58/go.mod h1:pxBEpOWISbspDHCfzDddkv9CC8X11pbHMnKfQ782t2w=
github.com/ninech/apis v0.0.0-20230309144709-d1d14d316770 h1:Yi6HMecGyMKT4PCqT9EyxJBKeZwFi+liN7QgLArmg9A=
github.com/ninech/apis v0.0.0-20230309144709-d1d14d316770/go.mod h1:pxBEpOWISbspDHCfzDddkv9CC8X11pbHMnKfQ782t2w=
github.com/ninech/apis v0.0.0-20230320134722-cddcd41f19e5 h1:815LwARwMbPHL6akqNaToh5aEnFCAPJrBbYEi1ImyQ0=
github.com/ninech/apis v0.0.0-20230320134722-cddcd41f19e5/go.mod h1:pxBEpOWISbspDHCfzDddkv9CC8X11pbHMnKfQ782t2w=
github.com/ninech/apis v0.0.0-20230321122757-56502c35f76e h1:Xi1L2hg1hCnjv+j8SpP6wl306kIiiG3WTwLpitbNd0M=
github.com/ninech/apis v0.0.0-20230321122757-56502c35f76e/go.mod h1:pxBEpOWISbspDHCfzDddkv9CC8X11pbHMnKfQ782t2w=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down

0 comments on commit e0b653b

Please sign in to comment.