fix: update build scripts for mac (#7104)
parent
f26e1fa21b
commit
ebc0a8c772
|
@ -11,14 +11,11 @@ ARCH=$2
|
|||
HELM_VERSION=$3
|
||||
HELM_DIST="helm-$HELM_VERSION-$PLATFORM-$ARCH"
|
||||
|
||||
if [[ ${PLATFORM} == "linux" ]]; then
|
||||
|
||||
if [[ ${PLATFORM} == "windows" ]]; then
|
||||
wget -O tmp.zip "https://get.helm.sh/${HELM_DIST}.zip" && unzip -o -j tmp.zip "${PLATFORM}-${ARCH}/helm.exe" -d dist && rm -f tmp.zip
|
||||
else
|
||||
wget -qO- "https://get.helm.sh/${HELM_DIST}.tar.gz" | tar -x -z --strip-components 1 "${PLATFORM}-${ARCH}/helm"
|
||||
mv "helm" "dist/helm"
|
||||
chmod +x "dist/helm"
|
||||
elif [[ ${PLATFORM} == "darwin" ]]; then
|
||||
wget -qO- "https://get.helm.sh/helm-canary-darwin-amd64.tar.gz" | tar -x -z --strip-components 1 "darwin-amd64/helm"
|
||||
mv "helm" "dist/helm"
|
||||
chmod +x "dist/helm"
|
||||
elif [[ ${PLATFORM} == "windows" ]]; then
|
||||
wget -O tmp.zip "https://get.helm.sh/${HELM_DIST}.zip" && unzip -o -j tmp.zip "${PLATFORM}-${ARCH}/helm.exe" -d dist && rm -f tmp.zip
|
||||
fi
|
||||
|
|
|
@ -14,6 +14,10 @@ KOMPOSE_VERSION=$3
|
|||
if [[ ${PLATFORM} == "windows" ]]; then
|
||||
wget -O "dist/kompose.exe" "https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-windows-amd64.exe"
|
||||
chmod +x "dist/kompose.exe"
|
||||
elif [[ ${PLATFORM} == "darwin" ]]; then
|
||||
# kompose 1.22 doesn't have arm support yet, we could merge darwin and linux scripts after upgrading kompose to >= 1.26.0
|
||||
wget -O "dist/kompose" "https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-${PLATFORM}-amd64"
|
||||
chmod +x "dist/kompose"
|
||||
else
|
||||
wget -O "dist/kompose" "https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-${PLATFORM}-${ARCH}"
|
||||
chmod +x "dist/kompose"
|
||||
|
|
16
gruntfile.js
16
gruntfile.js
|
@ -8,6 +8,14 @@ let arch = os.arch();
|
|||
if (arch === 'x64') {
|
||||
arch = 'amd64';
|
||||
}
|
||||
let platform = os.platform();
|
||||
switch (platform) {
|
||||
case 'windows':
|
||||
case 'darwin':
|
||||
break;
|
||||
default:
|
||||
platform = 'linux';
|
||||
}
|
||||
|
||||
module.exports = function (grunt) {
|
||||
loadGruntTasks(grunt, {
|
||||
|
@ -32,15 +40,17 @@ module.exports = function (grunt) {
|
|||
|
||||
grunt.registerTask('lint', ['eslint']);
|
||||
|
||||
grunt.registerTask('build:server', [`shell:build_binary:linux:${arch}`, `download_binaries:linux:${arch}`]);
|
||||
grunt.task.registerTask('build:server', 'build:server:<platform>:<arch>', function (p = platform, a = arch) {
|
||||
grunt.task.run([`shell:build_binary:${p}:${a}`, `download_binaries:${p}:${a}`]);
|
||||
});
|
||||
|
||||
grunt.registerTask('build:client', ['webpack:dev']);
|
||||
|
||||
grunt.registerTask('build', ['build:server', 'build:client']);
|
||||
|
||||
grunt.registerTask('start:server', ['build:server', 'shell:run_container']);
|
||||
grunt.registerTask('start:server', ['build:server:linux', 'shell:run_container']);
|
||||
|
||||
grunt.registerTask('start:localserver', [`shell:build_binary:linux:${arch}`, 'shell:run_localserver']);
|
||||
grunt.registerTask('start:localserver', [`shell:build_binary:${platform}:${arch}`, 'shell:run_localserver']);
|
||||
|
||||
grunt.registerTask('start:client', ['shell:install_yarndeps', 'webpack:devWatch']);
|
||||
|
||||
|
|
Loading…
Reference in New Issue