Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
pvecli/Makefile at main · dev-toolings/pvecli · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
dev-toolings
pvecli
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
pvecli
/
Makefile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
139 lines (119 loc) · 6.51 KB
main
Breadcrumbs
pvecli
/
Makefile
Copy path
Top
File metadata and controls
Code
Blame
139 lines (119 loc) · 6.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
BINARY
:= pvecli
VERSION
?= dev
COMMIT
?=
$(
shell
git rev-parse --short HEAD 2>/dev/null || echo unknown)
LDFLAGS
:= -X main.version=
$(
VERSION
)
-X main.commit=
$(
COMMIT
)
#
Les paquets dont la couverture est un critère de recette, pas une statistique.
#
Ce sont les deux qui portent le contrat : le client de l'API et le pipeline de
#
mutation. `cmd` est volontairement hors du seuil — il est surtout fait d'aide
#
et de mise en forme, et le compter ferait monter la moyenne sans rien garantir
#
de plus.
COVER_PKGS
:= ./internal/pve ./internal/service
COVER_MIN
:= 70
#
Le nœud du lab (PVX-055). Surchargeable : make install-node NODE=…
NODE
?= 192.0.2.23
NODEUSER
?= root
NODEPATH
?= /usr/local/bin/
$(
BINARY
)
#
Installation sur le POSTE. `install-node`, juste au-dessus, vise le nœud PVE :
#
les deux ne sont pas la même cible et n'installent pas la même chose — le nœud
#
ne fait pas tourner Claude Code, il n'y reçoit donc pas l'agent.
#
#
~/.local et non /usr/local : le second exige sudo sur macOS, et une cible
#
d'installation qui réclame les droits root pour poser un binaire d'utilisateur
#
est une cible qu'on finit par lancer en sudo sans réfléchir.
#
make install PREFIX=/usr/local reste possible, avec sudo.
PREFIX
?=
$(
HOME
)
/.local
.PHONY
: build test lint fmt cover integration release schema-capture-node schema-capture-archive schema-diff install install-node uninstall clean capture help
build
:
#
# Compile le binaire avec la version injectée au build
go build -ldflags
"
$(
LDFLAGS
)
"
-o
$(
BINARY
)
.
test
:
#
# Lance les tests unitaires (le tag `integration` reste hors du défaut)
go
test
./...
lint
:
#
# go vet + golangci-lint s'il est installé
go vet ./...
@if
command
-v golangci-lint
>
/dev/null
2>&1
;
then
\
golangci-lint run
;
\
else
\
echo
"
golangci-lint absent — go vet seul (brew install golangci-lint)
"
;
\
fi
fmt
:
#
# Formate le code
go fmt ./...
cover
:
#
# Couverture, avec un seuil qui fait échouer la cible
@fail=0
;
\
for
pkg
in
$(
COVER_PKGS
)
;
do
\
out=
$$(
mktemp
)
;
\
go
test
-coverprofile=
$$
out
$$
pkg
>
/dev/null
||
exit
1
;
\
pct=
$$(
go tool cover -func=$$out | awk '/^total:/ {print substr($$3, 1, length($$3
)
-1)}
'
); \
rm -f
$$
out
;
\
if
awk
"
BEGIN {exit !(
$$
pct <
$(
COVER_MIN
)
)}
"
;
then
\
printf
'
%-24s %6s %% < %s %% ECHEC\n
'
$$
pkg
$$
pct
$(
COVER_MIN
)
;
fail=1
;
\
else
\
printf
'
%-24s %6s %% ok\n
'
$$
pkg
$$
pct
;
\
fi
;
\
done
;
\
if
[
$$
fail
-ne
0 ]
;
then
\
echo
;
\
echo
"
Couverture insuffisante. Ce seuil n'est pas une métrique de confort :
"
;
\
echo
"
internal/pve et internal/service sont les deux paquets où une
"
;
\
echo
"
régression se paie contre un vrai nœud, pas dans un test.
"
;
\
exit
1
;
\
fi
integration
:
#
# Tests d'intégration contre un VRAI nœud — VMID 900-999 uniquement
@test -n
"
$$
PVE_API_URL
"
||
{ \
echo
"
PVE_API_URL n'est pas défini — les tests d'intégration parlent à un vrai nœud.
"
;
\
echo
"
source ~/.config/pvecli/env
"
;
\
exit
2
;
}
go
test
-tags integration -count=1 -v ./...
release
:
#
# Binaires darwin/arm64 et linux/amd64, statiques, avec leurs sommes
@test
"
$(
VERSION
)
"
!
=
"
dev
"
||
{ \
echo
"
refus de publier une version « dev » — make release VERSION=v0.1.0
"
;
exit
2
;
}
@rm -rf dist
&&
mkdir -p dist
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64
\
go build -trimpath -ldflags
"
$(
LDFLAGS
)
"
-o dist/
$(
BINARY
)
_
$(
VERSION
)
_darwin_arm64
.
CGO_ENABLED=0 GOOS=linux GOARCH=amd64
\
go build -trimpath -ldflags
"
$(
LDFLAGS
)
"
-o dist/
$(
BINARY
)
_
$(
VERSION
)
_linux_amd64
.
@cd dist
&&
shasum -a 256
*
>
SHA256SUMS
&&
cat SHA256SUMS
#
PVX-104 — schéma d'API normalisé, capturé/diffé en dehors du binaire
#
distribué (outillage de dev, comme `capture`, pas une sous-commande
#
`pvecli`). Placées avant `install` : `install` peut échouer légitimement
#
sur `pvecli ai install` quand l'agent local a été personnalisé, et make
#
n'exécute que la cible demandée — mais toute cible ajoutée après `install`
#
dans ce fichier serait facile à manquer en le lisant de haut en bas.
schema-capture-node
:
#
# Capture le schéma du nœud live — make schema-capture-node VERSION=9.2.6
@test -n
"
$(
VERSION
)
"
||
{
echo
"
usage: make schema-capture-node VERSION=9.2.6
"
;
exit
2
;
}
@./scripts/schema-capture.sh node
"
$(
VERSION
)
"
schema-capture-archive
:
#
# Capture un schéma pve-docs archivé — make schema-capture-archive VERSION=9.0.4 [SUITE=trixie]
@test -n
"
$(
VERSION
)
"
||
{
echo
"
usage: make schema-capture-archive VERSION=9.0.4 [SUITE=trixie]
"
;
exit
2
;
}
@./scripts/schema-capture.sh archive
"
$(
VERSION
)
"
"
$(
SUITE
)
"
schema-diff
:
#
# Diff deux schémas normalisés — make schema-diff OLD=docs/schema-snapshots/9.0.4-archive.json NEW=docs/schema-snapshots/9.2.6-node.json
@test -n
"
$(
OLD
)
"
&&
test
-n
"
$(
NEW
)
"
||
{
echo
"
usage: make schema-diff OLD=... NEW=...
"
;
exit
2
;
}
@./scripts/schema-diff.sh
"
$(
OLD
)
"
"
$(
NEW
)
"
install-node
:
#
# Copie le binaire linux sur le nœud et vérifie qu'il s'exécute
@test -f dist/
$(
BINARY
)
_
$(
VERSION
)
_linux_amd64
||
{ \
echo
"
binaire absent — lance d'abord : make release VERSION=
$(
VERSION
)
"
;
exit
2
;
}
scp dist/
$(
BINARY
)
_
$(
VERSION
)
_linux_amd64
$(
NODEUSER
)
@
$(
NODE
)
:
$(
NODEPATH
)
.new
ssh
$(
NODEUSER
)
@
$(
NODE
)
'
chmod 0755 $(NODEPATH).new && mv $(NODEPATH).new $(NODEPATH)
'
@echo
"
--- vérification depuis le nœud ---
"
ssh
$(
NODEUSER
)
@
$(
NODE
)
'
$(NODEPATH) --version
'
install
: build
#
# Installe pvecli sur le POSTE, et avec lui l'agent IA dans ~/.claude
install -d
$(
PREFIX
)
/bin
install -m 0755
$(
BINARY
)
$(
PREFIX
)
/bin/
$(
BINARY
)
@echo
"
--- notification de mise à jour ---
"
@
$(
PREFIX
)
/bin/
$(
BINARY
)
update install-hook
||
\
echo
"
notification non câblée — « pvecli update install-hook » à la main
"
@echo
"
--- agent Claude Code ---
"
@
$(
PREFIX
)
/bin/
$(
BINARY
)
ai install
||
{ \
echo
"
l'agent n'a pas pu être installé — « pvecli ai install --force » après relecture
"
;
\
exit
1
;
}
@echo
"
--- vérification ---
"
$(
PREFIX
)
/bin/
$(
BINARY
)
--version
uninstall
:
#
# Retire le binaire du poste (l'agent reste : il a pu être personnalisé)
rm -f
$(
PREFIX
)
/bin/
$(
BINARY
)
@echo
"
agent conservé — supprime-le à la main si tu le veux :
"
@echo
"
rm -f ~/.claude/agents/proxmox-ops.md
"
clean
:
#
# Supprime le binaire et les artefacts de publication
rm -rf dist
$(
BINARY
)
capture
:
#
# Capture une réponse réelle dans testdata/ — make capture ENDPOINT=/nodes
@test -n
"
$(
ENDPOINT
)
"
||
{
echo
"
usage: make capture ENDPOINT=/nodes [NAME=nodes]
"
;
exit
2
;
}
@./scripts/capture.sh
"
$(
ENDPOINT
)
"
"
$(
NAME
)
"
help
:
#
# Liste les cibles
@grep -E
'
^[a-z-]+:.*?##
'
$(
MAKEFILE_LIST
)
\
|
awk
'
BEGIN {FS = ":.*?## "} {printf " %-14s %s\n", $$1, $$2}
'
You can’t perform that action at this time.