Skip to content

Commit 6ab0000

Browse files
committed
Add support for generation of prebuilds images
1 parent 686c4ed commit 6ab0000

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ node_modules/
55

66
build/
77
npm-debug.log
8+
prebuilds/

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"minimist": "^1.2.0",
2626
"nodeos-cross-toolchain": "^1.0.0-RC3.0",
2727
"nodeos-nodejs": "NodeOS/nodejs",
28+
"prebuild": "^6.0.0",
2829
"qemu": "^2.8.0",
2930
"suppose": "^0.6.1"
3031
},

scripts/BigRedButton

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,12 @@ TEST="npm test"
1313
eval MACHINE=pc BITS=32 $BUILD && $TEST || exit 1
1414
eval MACHINE=pc BITS=64 $BUILD && $TEST || exit 2
1515
eval MACHINE=raspi2 $BUILD || exit 3
16+
17+
18+
#
19+
# Upload release to GitHub
20+
#
21+
22+
if [ "$GITHUB_TOKEN" ]; then
23+
prebuild --upload-all $GITHUB_TOKEN || exit 10
24+
fi

scripts/build

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@ SRC_LINUX=`pwd`/deps/linux
4646
# Define steps paths
4747
#
4848

49+
NODE_PLATFORM=linux
50+
4951
OBJ_INIT=$OBJECTS/init
5052
OBJ_NODE=$OBJECTS/node
5153
OBJ_RELEASE=$OBJECTS/os-release
5254
OBJ_CPIO_TXT=$OBJECTS/cpio.txt
5355
OBJ_GEN_INIT_CPIO=$OBJECTS/gen_init_cpio
5456
OBJ_LINUX=$OBJECTS/linux
5557
OUT_DIR=`pwd`/out/$CPU
58+
PREBUILD=prebuilds/$NODE_PLATFORM-$NODE_ARCH.tar.gz
5659

5760

5861
#
@@ -163,7 +166,7 @@ STEP_DIR=$OBJ_GEN_INIT_CPIO
163166

164167
if [[ ! -f $STEP_DIR ]]; then
165168
# Delete previous initramfs and kernel
166-
rm -rf $OUT_DIR
169+
rmStep $OUT_DIR $PREBUILD
167170

168171
(
169172
cd $SRC_DIR/usr &&
@@ -285,3 +288,15 @@ esac
285288
ln -sfn $CPU out/latest || err 90
286289

287290
echo -e "${GRN}Successfully built 'barebones'${CLR}"
291+
292+
293+
#
294+
# Pack Node.js in a node-gyp compatible way
295+
#
296+
297+
# TODO use Node.js arch instead of explicit CPUs and move to BigRedButton
298+
299+
STEP_DIR=$PREBUILD
300+
301+
mkdir -p `dirname $STEP_DIR` &&
302+
tar -cf - out/$CPU | gzip > $STEP_DIR || err 100

scripts/unbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
22

3-
rm -rf .vagga/ build/ out/ || exit $?
3+
rm -rf .vagga/ build/ out/ prebuilds/ || exit $?

0 commit comments

Comments
 (0)