This repository was archived by the owner on May 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +96
-38
lines changed Expand file tree Collapse file tree 8 files changed +96
-38
lines changed Original file line number Diff line number Diff line change @@ -2,24 +2,22 @@ language: node_js
2
2
osx_image : xcode10.2
3
3
node_js :
4
4
- 10.15.1
5
+ services :
6
+ - docker
5
7
cache :
6
8
directories :
7
9
- /home/travis/.ccache/
10
+ - /home/travis/.centos-ccache/
11
+ - /home/travis/.alpine-ccache
8
12
before_install :
9
13
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi
10
14
- export PATH="/usr/local/opt/ccache/libexec:$PATH"
11
15
- eval "$(MATRIX_EVAL)"
12
16
matrix :
13
17
include :
14
18
- os : linux
15
- dist : xenial
16
- addons :
17
- apt :
18
- packages :
19
- - gcc-multilib
20
- - g++-multilib
21
19
- os : osx
22
- script : scripts/ci.sh && scripts/test.sh
20
+ script : scripts/ci.sh
23
21
deploy :
24
22
provider : gcs
25
23
access_key_id : GOOGZVNTORC5JOVTMMRVCXAM
Original file line number Diff line number Diff line change @@ -4,15 +4,10 @@ FROM node:10.15.1-alpine
4
4
5
5
RUN apk update
6
6
RUN apk add bash
7
-
8
7
RUN apk add gcc
9
8
RUN apk add g++
9
+ RUN apk add ccache
10
10
RUN apk add git
11
11
RUN apk add make
12
12
RUN apk add python
13
13
RUN apk add linux-headers
14
-
15
- RUN mkdir /nbin
16
- COPY . /nbin
17
-
18
- ENTRYPOINT [ "/bin/bash" ]
Original file line number Diff line number Diff line change
1
+ FROM centos:7
2
+
3
+ RUN yum install -y centos-release-scl
4
+ RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
5
+ RUN yum install -y devtoolset-6
6
+ RUN yum install -y gcc-c++
7
+ RUN rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ccache-3.3.4-1.el7.x86_64.rpm
8
+
9
+ RUN mkdir /root/node
10
+ RUN cd /root/node && curl https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz | tar xJ --strip-components=1 --
11
+ RUN ln -s /root/node/bin/node /usr/bin/node
12
+ ENV PATH "$PATH:/root/node/bin"
13
+ RUN npm install -g yarn
14
+
15
+ # VOLUME ~/.ccache /ccache
16
+ # RUN source /opt/rh/devtoolset-6/enable && scripts/node_build.sh
17
+ # RUN npm rebuild
18
+ # RUN npm
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- set -e
3
+ set -euox pipefail
4
4
5
5
cd " $( dirname " $0 " ) "
6
+ source ./vars.sh
7
+
6
8
./patch_apply.sh
7
9
./webpack_build.sh
8
- ./node_build.sh
10
+
11
+ cp ./node_build.sh ../lib/node/build.sh
12
+ mkdir -p ./build/$PACKAGE_VERSION
13
+
14
+ if [[ " $OSTYPE " == " darwin" * ]]; then
15
+ ./mac_build.sh
16
+ else
17
+ ./docker_build.sh
18
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -eoux pipefail
4
+
5
+ cd " $( dirname " $0 " ) "
6
+ source ./vars.sh
7
+
8
+ # Variables to be set:
9
+ # $CACHE_DIR
10
+ # $IMAGE
11
+ # $PREBUILD_COMMAND
12
+ # $BINARY_NAME
13
+ function docker_build() {
14
+ containerID=$( docker create -it -v $HOME /$CACHE_DIR :/ccache $IMAGE )
15
+ docker start $containerID
16
+ docker exec $containerID mkdir /src
17
+
18
+ function exec() {
19
+ docker exec -w /src $containerID bash -c " $@ "
20
+ }
21
+
22
+ docker cp ../. $containerID :/src
23
+ exec " $PREBUILD_COMMAND /src/lib/node/build.sh"
24
+ exec " npm rebuild"
25
+ exec " npm test"
26
+ docker cp $containerID :/src/lib/node/out/Release/node ../build/$PACKAGE_VERSION /$BINARY_NAME
27
+ }
28
+
29
+ CACHE_DIR=" .ccache-centos"
30
+ IMAGE=" codercom/nbin-centos"
31
+ PREBUILD_COMMAND=" source /opt/rh/devtoolset-6/enable &&"
32
+ BINARY_NAME=" node-${NODE_VERSION} -linux-x64"
33
+ docker_build
34
+
35
+ CACHE_DIR=" .ccache-alpine"
36
+ IMAGE=" codercom/nbin-alpine"
37
+ PREBUILD_COMMAND=" "
38
+ BINARY_NAME=" node-${NODE_VERSION} -alpine-x64"
39
+ docker_build
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cd " $( dirname " $0 " ) "
4
+ source ./vars.sh
5
+ cd ../lib/node
6
+
7
+ export CCACHE_DIR=" /ccache"
8
+ ./build.sh
9
+
10
+ ARCH=$( uname -m)
11
+ BINARY_NAME=" node-${NODE_VERSION} -darwin-x64"
12
+
13
+ cp ./out/Release/node ../../build/$PACKAGE_VERSION /$BINARY_NAME
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
cd " $( dirname " $0 " ) "
4
- source ./vars.sh
5
- cd ../lib/node
4
+ set -euxo pipefail
6
5
7
6
export CC=" ccache gcc"
8
- export CXX=' ccache g++'
9
- echo " Configuring with --dest-cpu=x64 "
7
+ export CXX=" ccache g++"
8
+ export CCACHE_DIR= " /ccache "
10
9
./configure --link-module ' ./nbin.js' --link-module ' ./lib/_third_party_main.js' --dest-cpu=x64 --openssl-no-asm
11
- make -j2 & > /dev/null &
10
+ cores=$( cat /proc/cpuinfo | awk ' /^processor/{print $3}' | wc -l)
11
+ make -j$cores & > /dev/null &
12
12
pid=$!
13
13
(
14
14
while true ; do
15
- echo still running
15
+ echo Compiling...
16
16
sleep 60
17
17
done
18
18
) &
19
+ subshell=$!
19
20
wait " $pid "
20
- cd ../../
21
-
22
- mkdir -p ./build/$PACKAGE_VERSION
23
-
24
- if [[ " $OSTYPE " == " linux-gnu" ]]; then
25
- OS=" linux"
26
- elif [[ " $OSTYPE " == " linux-musl" ]]; then
27
- OS=" alpine"
28
- elif [[ " $OSTYPE " == " darwin" * ]]; then
29
- OS=" darwin"
30
- fi
31
-
32
- ARCH=$( uname -m)
33
- BINARY_NAME=" node-${NODE_VERSION} -${OS} -${ARCH} "
34
-
35
- cp ./lib/node/out/Release/node ./build/$PACKAGE_VERSION /$BINARY_NAME
21
+ kill -9 $subshell
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- cd " $( dirname " $0 " ) "
4
3
NODE_VERSION=10.15.1
5
4
PACKAGE_VERSION=$( cat ../package.json \
6
5
| grep version \
You can’t perform that action at this time.
0 commit comments