Skip to content

Commit b67d589

Browse files
authored
Merge pull request #16519 from wolfi-dev/nv-manager
feat(packages): Add NeuVector Manager and CLI
2 parents 939ad6e + 4886d5c commit b67d589

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

neuvector-manager-5.3.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
package:
2+
name: neuvector-manager-5.3
3+
version: 5.3.2
4+
epoch: 0
5+
description: NeuVector Security Center Admin Console.
6+
copyright:
7+
- license: Apache-2.0
8+
dependencies:
9+
provides:
10+
- neuvector-manager=${{package.full-version}}
11+
runtime:
12+
- openjdk-11-default-jvm
13+
14+
environment:
15+
environment:
16+
JAVA_OPTS: "-Xms2g -Xmx3g"
17+
contents:
18+
packages:
19+
- busybox
20+
- openjdk-11
21+
- openjdk-11-default-jvm
22+
- py3-pip
23+
- python3
24+
- sbt
25+
- wget
26+
- zip
27+
28+
pipeline:
29+
- uses: git-checkout
30+
with:
31+
expected-commit: 67402fe784d6e6ec362cd04116b0d5929d247767
32+
repository: https://github.com/neuvector/manager
33+
tag: v${{package.version}}
34+
35+
- runs: |
36+
# Build and compress JAR
37+
sbt admin/assembly
38+
zip -d admin/target/scala-2.11/admin-assembly-1.0.jar rest-management-private-classpath\*
39+
40+
# Unfortunately, a lot of things are hardcoded to /usr/local/...
41+
mkdir -p ${{targets.contextdir}}/usr/local/bin
42+
install -Dm755 admin/target/scala-2.11/admin-assembly-1.0.jar ${{targets.contextdir}}/usr/local/bin/
43+
install -Dm755 scripts/* ${{targets.contextdir}}/usr/local/bin/
44+
45+
# Retrieve certs
46+
mkdir -p ${{targets.contextdir}}/etc/neuvector/certs
47+
wget https://raw.githubusercontent.com/neuvector/manifests/main/build/share/etc/neuvector/certs/ssl-cert.key -P ${{targets.contextdir}}/etc/neuvector/certs/
48+
wget https://raw.githubusercontent.com/neuvector/manifests/main/build/share/etc/neuvector/certs/ssl-cert.pem -P ${{targets.contextdir}}/etc/neuvector/certs/
49+
50+
- uses: strip
51+
52+
subpackages:
53+
- name: ${{package.name}}-cli
54+
description: NeuVector Manager CLI
55+
dependencies:
56+
provides:
57+
- neuvector-manager-cli=${{package.full-version}}
58+
runtime:
59+
- py3-click
60+
- py3-requests
61+
- py3-six
62+
- py3-urllib3
63+
- python-3.12-base
64+
- supervisor
65+
pipeline:
66+
- runs: |
67+
# Setup virtual environment
68+
python3 -m venv .venv --system-site-packages
69+
.venv/bin/pip install -I cmd2 prettytable --no-compile
70+
71+
# Remove pip from venv
72+
.venv/bin/pip uninstall --yes pip
73+
74+
# Upstream places this at /. Let's put it in /usr/share/...
75+
mkdir -p ${{targets.contextdir}}/usr/share/neuvector-manager-cli
76+
mv .venv ${{targets.contextdir}}/usr/share/neuvector-manager-cli/
77+
78+
# Install CLI
79+
mkdir -p ${{targets.contextdir}}/usr/local/bin
80+
install -Dm755 cli/cli.py ${{targets.contextdir}}/usr/share/neuvector-manager-cli/.venv/bin/cli
81+
ln -sf /usr/share/neuvector-manager-cli/.venv/bin/cli ${{targets.contextdir}}/usr/local/bin/cli
82+
mv cli/prog ${{targets.contextdir}}/usr/share/neuvector-manager-cli/.venv/bin/
83+
84+
# Use Python provided by venv
85+
sed -i "s|bin/python3|share/neuvector-manager-cli/.venv/bin/python3|g" ${{targets.contextdir}}/usr/share/neuvector-manager-cli/.venv/bin/cli
86+
test:
87+
pipeline:
88+
- runs: |
89+
cli -h
90+
91+
test:
92+
pipeline:
93+
- runs: |
94+
java -jar /usr/local/bin/admin-assembly-1.0.jar & sleep 2; kill $!
95+
96+
update:
97+
enabled: true
98+
github:
99+
identifier: neuvector/manager
100+
strip-prefix: v
101+
tag-filter: v5.3.
102+
use-tag: true

0 commit comments

Comments
 (0)