mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-19 21:57:54 +00:00
Add build util to automatically detect arch from uname
This will help running `test:env` and `test:compose` in environments other than `amd64`.
This commit is contained in:
parent
819e184095
commit
a1e432f4fa
33
build-utils/detect-arch.sh
Executable file
33
build-utils/detect-arch.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# detect-arch.sh
|
||||
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
echo "amd64"
|
||||
;;
|
||||
aarch64)
|
||||
:
|
||||
echo "aarch64"
|
||||
;;
|
||||
arm64)
|
||||
echo "aarch64"
|
||||
;;
|
||||
armv7l)
|
||||
echo "armv7hf"
|
||||
;;
|
||||
armv6l)
|
||||
echo "rpi"
|
||||
;;
|
||||
i686)
|
||||
:
|
||||
echo "i386"
|
||||
;;
|
||||
i386)
|
||||
:
|
||||
echo "i386"
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Unknown architecture $(uname -m)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
@ -17,8 +17,8 @@
|
||||
"test:integration:single": "find test/integration -name *.spec.ts | xargs mocha --config test/integration/.mocharc.js",
|
||||
"test:legacy": "mocha --config test/legacy/.mocharc.js",
|
||||
"test:node": "npm run test:unit && npm run test:integration && npm run test:legacy",
|
||||
"test:env": "docker-compose -f docker-compose.test.yml -f docker-compose.dev.yml up --build; npm run compose:down",
|
||||
"test:compose": "docker-compose -f docker-compose.yml -f docker-compose.test.yml up --build --remove-orphans --exit-code-from=sut ; npm run compose:down",
|
||||
"test:env": "ARCH=$(./build-utils/detect-arch.sh) docker-compose -f docker-compose.test.yml -f docker-compose.dev.yml up --build; npm run compose:down",
|
||||
"test:compose": "ARCH=$(./build-utils/detect-arch.sh) docker-compose -f docker-compose.yml -f docker-compose.test.yml up --build --remove-orphans --exit-code-from=sut ; npm run compose:down",
|
||||
"test": "npm run lint && npm run test:build && npm run test:unit && npm run test:legacy",
|
||||
"compose:down": "docker-compose -f docker-compose.test.yml down",
|
||||
"prettify": "balena-lint -e ts -e js --fix src/ test/ typings/ build-utils/ webpack.config.js",
|
||||
|
Loading…
Reference in New Issue
Block a user