Skip to content

Commit 6887804

Browse files
mclasmeierMoritz Clasmeier
andauthored
Fix broken install Makefile target, update README (#214)
Co-authored-by: Moritz Clasmeier <mclasmeier@redhat.com>
1 parent 348e326 commit 6887804

2 files changed

Lines changed: 53 additions & 25 deletions

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# Go configuration
77
GOCMD := go
8+
GOPATH ?= $(shell $(GOCMD) env GOPATH)
89
GOBUILD := $(GOCMD) build
910
GOTEST := $(GOCMD) test
1011
GOVET := $(GOCMD) vet
@@ -16,6 +17,7 @@ PKG_LIST := $(shell $(GOCMD) list ./... | grep -v /vendor/)
1617
# Build output
1718
BUILD_DIR := .
1819
BINARY := $(BUILD_DIR)/$(BINARY_NAME)
20+
INSTALLED_BINARY := $(GOPATH)/bin/$(BINARY_NAME)
1921

2022
# Convention is that the git tags are of the form
2123
# v<major>.<minor>.<patch>-<build-number>-<commit-hash>[-dirty]
@@ -70,7 +72,10 @@ build-all: fmt vet build ## Format, vet, and build
7072
.PHONY: install
7173
install: ## Install roxie to $GOPATH/bin
7274
@echo "📦 Installing roxie..."
73-
$(GOCMD) install -ldflags "$(LDFLAGS)" $(CMD_PATH)
75+
# We cannot use 'go install', because the installed binary would be named 'cmd', given the
76+
# current source tree layout.
77+
mkdir -p $$(dirname $(INSTALLED_BINARY))
78+
$(GOBUILD) -ldflags "$(LDFLAGS)" -o $(INSTALLED_BINARY) ./cmd
7479

7580
# Development targets
7681
.PHONY: fmt

README.md

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,50 @@ roxie has been authored with significant AI contributions.
2424

2525
## Installation
2626

27-
### Download from GitHub releases
27+
Look up the latest release from https://github.com/stackrox/roxie/releases.
28+
29+
### Install from GitHub releases into local dev environment
30+
31+
For example, installing into `$HOME/bin`:
32+
```bash
33+
curl -fsSL -o "${HOME}/bin/roxie" \
34+
https://github.com/stackrox/roxie/releases/download/v0.4.0/roxie-linux-amd64
35+
chmod +x "${HOME}/bin/roxie"
36+
```
37+
38+
On macOS you likely also need
39+
```bash
40+
xattr -d com.apple.quarantine "${HOME}/bin/roxie"
41+
```
42+
43+
### Installing from source into local dev environment
44+
45+
Built using:
46+
```bash
47+
git clone git@github.com:stackrox/roxie.git
48+
cd roxie
49+
make install
50+
```
51+
52+
This will install `roxie` into `${GOPATH}/bin`. If that is not desired you can also
53+
build and copy manually:
54+
```bash
55+
make build
56+
cp roxie /your/custom/bin
57+
```
58+
59+
### Install from GitHub releases as part of CI workflow
2860

2961
```bash
3062
curl -fsSL --retry 5 --retry-all-errors -o /usr/local/bin/roxie \
3163
https://github.com/stackrox/roxie/releases/download/v0.4.0/roxie-linux-amd64
3264
chmod +x /usr/local/bin/roxie
3365
```
3466

35-
### Copy from container image in a Dockerfile
67+
### Install in container image
68+
69+
roxie can also be installed by extracting from a published roxie container image, for example
70+
during container building:
3671

3772
```dockerfile
3873
ARG ROXIE_VERSION=0.4.0
@@ -61,47 +96,35 @@ Example for deploying Central and SecuredCluster to an Infra OpenShift 4 cluster
6196
```bash
6297
podman run --rm -it --privileged \
6398
-v $KUBECONFIG:/kubeconfig:U \
64-
-e MAIN_IMAGE_TAG=4.9.2 \
65-
quay.io/rhacs-eng/roxie:latest deploy --resources=auto
99+
quay.io/rhacs-eng/roxie:latest deploy -t 4.11.0 --resources=auto
66100
```
67-
Specify the `MAIN_IMAGE_TAG` as desired.
101+
Specify the main image tag (`--tag` or `-t`) as desired.
68102

69103
Deploying to a GKE cluster requires passing of some more arguments:
70104
```
71105
podman run --rm -it --privileged \
72106
-v ~/.config/gcloud:/.config/gcloud:U \
73107
-v $KUBECONFIG:/kubeconfig:U \
74-
-e MAIN_IMAGE_TAG=4.9.2 \
75108
-e REGISTRY_USERNAME=$REGISTRY_USERNAME \
76109
-e REGISTRY_PASSWORD=$REGISTRY_PASSWORD \
77-
quay.io/rhacs-eng/roxie:latest deploy --resources=auto
110+
quay.io/rhacs-eng/roxie:latest deploy -t 4.11.0 --resources=auto
78111
```
79112
Note that in this case we also need to pass the gcloud configuration for the authentication towards
80113
the cluster to succeed.
81114

82-
### Option 2: Deploying using local build
115+
### Option 2: Deploying using native executable
83116

84117
Prerequisites:
85118
- `kubectl` configured to point at your target cluster
86-
- The `roxctl` CLI
87-
- The `roxie` branch forked and cloned to your local machine
88-
89-
Built using:
90-
```bash
91-
make build
92-
```
93-
94-
Get help:
95-
```bash
96-
./roxie --help
97-
```
119+
- `roxctl` CLI is installed
120+
- `roxie` CLI is installed
98121

99122
Deploy using:
100123
```bash
101-
MAIN_IMAGE_TAG=4.9.2 ./roxie deploy [ <component> ]
124+
./roxie deploy -t 4.11.0 [ <component> ]
102125
```
103126
where `component` can be `central` or `sensor`. If not specified, both components will be deployed.
104-
Specify the `MAIN_IMAGE_TAG` as desired.
127+
Specify the tag to deploy as desired.
105128

106129
Similarly, the deployment(s) can be torn down using:
107130
```bash
@@ -114,7 +137,7 @@ roxie supports hub + spoke architectures where Central and SecuredCluster run on
114137

115138
1. Deploy Central on the hub cluster:
116139
```bash
117-
./roxie deploy central -t 4.9.2
140+
./roxie deploy central -t 4.11.0
118141
```
119142

120143
2. Create a config file for the spoke cluster, pointing at the Central endpoint (printed during step 1):
@@ -129,7 +152,7 @@ securedCluster:
129152
```bash
130153
ROX_ADMIN_PASSWORD=<admin-password> \
131154
ROX_CA_CERT_FILE=<path-to-ca-cert> \
132-
./roxie deploy secured-cluster -t 4.9.2 -c spoke-config.yaml
155+
./roxie deploy secured-cluster -t 4.11.0 -c spoke-config.yaml
133156
```
134157

135158
> **Tip:** If deploying from the roxie subshell, `ROX_ADMIN_PASSWORD` and `ROX_CA_CERT_FILE` are

0 commit comments

Comments
 (0)