extract version from environment
This commit is contained in:
parent
95b492add8
commit
4b26195c6a
10
Makefile
10
Makefile
|
@ -5,15 +5,16 @@ PKGREL=1
|
|||
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
GITVERSION:=$(shell git rev-parse HEAD)
|
||||
|
||||
export PROXMOX_PKG_VERSION=${PKGVER}
|
||||
export PROXMOX_PKG_RELEASE=${PKGREL}
|
||||
export PROXMOX_PKG_REPOID=${GITVERSION}
|
||||
|
||||
DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
|
||||
|
||||
DESTDIR=
|
||||
|
||||
all: target/release/api-test-server
|
||||
|
||||
target/release/api-test-server:
|
||||
cargo build --release
|
||||
all:
|
||||
cargo build
|
||||
|
||||
.PHONY: deb
|
||||
deb ${DEB}:
|
||||
|
@ -28,6 +29,7 @@ deb ${DEB}:
|
|||
distclean: clean
|
||||
|
||||
clean:
|
||||
make -C www clean
|
||||
cargo clean
|
||||
rm -rf *.deb *.buildinfo *.changes build
|
||||
find . -name '*~' -exec rm {} ';'
|
||||
|
|
|
@ -7,6 +7,3 @@
|
|||
%:
|
||||
dh $@ --with=systemd
|
||||
|
||||
|
||||
override_dh_auto_build:
|
||||
cargo build --release
|
||||
|
|
13
src/api3.rs
13
src/api3.rs
|
@ -24,16 +24,21 @@ fn test_sync_api_handler(param: Value, _info: &ApiMethod) -> Result<Value, Error
|
|||
Ok(json!(null))
|
||||
}
|
||||
|
||||
const PROXMOX_PKG_VERSION: &'static str = env!("PROXMOX_PKG_VERSION");
|
||||
const PROXMOX_PKG_RELEASE: &'static str = env!("PROXMOX_PKG_RELEASE");
|
||||
const PROXMOX_PKG_REPOID: &'static str = env!("PROXMOX_PKG_REPOID");
|
||||
|
||||
|
||||
fn get_version(param: Value, _info: &ApiMethod) -> Result<Value, Error> {
|
||||
|
||||
|
||||
Ok(json!({
|
||||
"version": "1.0",
|
||||
"release": "1",
|
||||
"repoid": "AAAA"
|
||||
"version": PROXMOX_PKG_VERSION,
|
||||
"release": PROXMOX_PKG_RELEASE,
|
||||
"repoid": PROXMOX_PKG_REPOID
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
pub fn router() -> Router {
|
||||
|
||||
let route4 = Router::new()
|
||||
|
|
|
@ -14,5 +14,5 @@ proxmox-backup-gui.js: ${JSSRC}
|
|||
.PHONY: clean
|
||||
clean:
|
||||
find . -name '*~' -exec rm {} ';'
|
||||
rm -r proxmox-backup-gui.js
|
||||
rm -f proxmox-backup-gui.js
|
||||
|
||||
|
|
Loading…
Reference in New Issue