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)
|
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||||
GITVERSION:=$(shell git rev-parse HEAD)
|
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
|
DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
|
||||||
|
|
||||||
DESTDIR=
|
DESTDIR=
|
||||||
|
|
||||||
all: target/release/api-test-server
|
all:
|
||||||
|
cargo build
|
||||||
target/release/api-test-server:
|
|
||||||
cargo build --release
|
|
||||||
|
|
||||||
.PHONY: deb
|
.PHONY: deb
|
||||||
deb ${DEB}:
|
deb ${DEB}:
|
||||||
|
@ -28,6 +29,7 @@ deb ${DEB}:
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
make -C www clean
|
||||||
cargo clean
|
cargo clean
|
||||||
rm -rf *.deb *.buildinfo *.changes build
|
rm -rf *.deb *.buildinfo *.changes build
|
||||||
find . -name '*~' -exec rm {} ';'
|
find . -name '*~' -exec rm {} ';'
|
||||||
|
|
|
@ -7,6 +7,3 @@
|
||||||
%:
|
%:
|
||||||
dh $@ --with=systemd
|
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))
|
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> {
|
fn get_version(param: Value, _info: &ApiMethod) -> Result<Value, Error> {
|
||||||
|
|
||||||
|
|
||||||
Ok(json!({
|
Ok(json!({
|
||||||
"version": "1.0",
|
"version": PROXMOX_PKG_VERSION,
|
||||||
"release": "1",
|
"release": PROXMOX_PKG_RELEASE,
|
||||||
"repoid": "AAAA"
|
"repoid": PROXMOX_PKG_REPOID
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn router() -> Router {
|
pub fn router() -> Router {
|
||||||
|
|
||||||
let route4 = Router::new()
|
let route4 = Router::new()
|
||||||
|
|
|
@ -14,5 +14,5 @@ proxmox-backup-gui.js: ${JSSRC}
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
find . -name '*~' -exec rm {} ';'
|
find . -name '*~' -exec rm {} ';'
|
||||||
rm -r proxmox-backup-gui.js
|
rm -f proxmox-backup-gui.js
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue