Skip to content

Commit

Permalink
Merge pull request #214 from nicolasnoble/backport
Browse files Browse the repository at this point in the history
Backport of #212
  • Loading branch information
nicolasnoble authored Mar 13, 2018
2 parents 0225689 + fcf472e commit 190a72e
Show file tree
Hide file tree
Showing 20 changed files with 221 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

source ~/.nvm/nvm.sh

nvm install 8
set -ex

cd $(dirname $0)
Expand All @@ -24,6 +21,7 @@ cd $tool_dir/../../..
base_dir=$(pwd)

export ARTIFACTS_OUT=$base_dir/artifacts
export JOBS=8

rm -rf build || true

Expand All @@ -35,4 +33,4 @@ $tool_dir/build_artifact_node.sh

$tool_dir/build_artifact_node_arm.sh

docker run -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact bash -c /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine
docker run -e JOBS=8 -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0

set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm

set JOBS=8

del /f /q BUILD || rmdir build /s /q

call npm update || goto :error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

NODE_ALPINE_BUILD=false

set -ex

arch_list=( ia32 x64 )
node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 9.0.0 )
electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 )

while true ; do
case $1 in
--with-alpine)
NODE_ALPINE_BUILD=true
arch_list=( x64 )
electron_versions=( )
;;
"")
;;
Expand All @@ -30,8 +36,6 @@ while true ; do
shift || break
done

NODE_ALPINE_BUILD=$1

umask 022

cd $(dirname $0)/../../..
Expand All @@ -42,17 +46,11 @@ mkdir -p "${ARTIFACTS_OUT}"

npm update

arch_list=( ia32 x64 )

node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 9.0.0 )

electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 )

for arch in ${arch_list[@]}
do
for version in ${node_versions[@]}
do
./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$arch --grpc_alpine=$NODE_ALPINE_BUILD
./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$arch
cp -r build/stage/* "${ARTIFACTS_OUT}"/
done

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

source ~/.nvm/nvm.sh

nvm use 8
set -ex

cd $(dirname $0)/../../..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

source ~/.nvm/nvm.sh

nvm use 8
set -ex

cd $(dirname $0)/../../..
Expand Down
1 change: 1 addition & 0 deletions run-tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PowerShell -Command .\install-nvm-windows.ps1
SET NVM_HOME=%ROOT%nvm
SET NVM_SYMLINK=%ROOT%nvm\nodejs
SET PATH=%NVM_HOME%;%NVM_SYMLINK%;%PATH%
SET JOBS=8

nvm version

Expand Down
1 change: 1 addition & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set -ex
npm install --unsafe-perm

mkdir -p reports
export JOBS=8

# TODO(mlumish): Add electron tests

Expand Down
1 change: 1 addition & 0 deletions kokoro.bat → test/kokoro.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@echo "Starting Windows test"

cd /d %~dp0
cd ..

git submodule update --init
git submodule foreach --recursive git submodule update --init
Expand Down
4 changes: 3 additions & 1 deletion kokoro.sh → test/kokoro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
# limitations under the License.

set -e
cd $(dirname $0)
cd $(dirname $0)/..

# Install gRPC and its submodules.
git submodule update --init
git submodule foreach --recursive git submodule update --init

./packages/grpc-native-core/tools/buildgen/generate_projects.sh

./run-tests.sh
19 changes: 19 additions & 0 deletions test/kokoro/linux-build.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/tools/release/kokoro.sh"
timeout_mins: 60
2 changes: 1 addition & 1 deletion test/kokoro/linux.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/kokoro.sh"
build_file: "grpc-node/test/kokoro.sh"
timeout_mins: 60
action {
define_artifacts {
Expand Down
19 changes: 19 additions & 0 deletions test/kokoro/macos-build.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/tools/release/kokoro.sh"
timeout_mins: 60
2 changes: 1 addition & 1 deletion test/kokoro/macos.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/kokoro.sh"
build_file: "grpc-node/test/kokoro.sh"
timeout_mins: 60
action {
define_artifacts {
Expand Down
19 changes: 19 additions & 0 deletions test/kokoro/windows-build.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/tools/release/kokoro.bat"
timeout_mins: 60
2 changes: 1 addition & 1 deletion test/kokoro/windows.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/kokoro.bat"
build_file: "grpc-node/test/kokoro.bat"
timeout_mins: 60
28 changes: 28 additions & 0 deletions tools/release/kokoro.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@rem Copyright 2018 gRPC authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.

@echo "Starting Windows build"

cd /d %~dp0
cd ..\..

git submodule update --init
git submodule foreach --recursive git submodule update --init

set ARTIFACTS_OUT=artifacts
cd packages\grpc-native-core
call tools\run_tests\artifacts\build_artifact_node.bat
cd ..\..

move packages\grpc-native-core\artifacts .
39 changes: 39 additions & 0 deletions tools/release/kokoro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -ex
cd $(dirname $0)/../..
base_dir=$(pwd)

# Install gRPC and its submodules.
git submodule update --init
git submodule foreach --recursive git submodule update --init

pip install mako
./packages/grpc-native-core/tools/buildgen/generate_projects.sh

OS=`uname`

case $OS in
Linux)
sudo apt-get update
sudo apt-get install -y linux-libc-dev:i386 g++-aarch64-linux-gnu g++-arm-linux-gnueabihf
./packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh
mv packages/grpc-native-core/artifacts .
;;
Darwin)
JOBS=8 ARTIFACTS_OUT=$base_dir/artifacts ./packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh
;;
esac
25 changes: 25 additions & 0 deletions tools/release/kokoro/linux.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/tools/release/kokoro.sh"
timeout_mins: 180
action {
define_artifacts {
regex: "github/grpc-node/artifacts/**",
strip_prefix: "github/grpc-node/artifacts"
}
}
25 changes: 25 additions & 0 deletions tools/release/kokoro/macos.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/tools/release/kokoro.sh"
timeout_mins: 120
action {
define_artifacts {
regex: "github/grpc-node/artifacts/**",
strip_prefix: "github/grpc-node/artifacts"
}
}
25 changes: 25 additions & 0 deletions tools/release/kokoro/windows.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Config file for Kokoro (in protobuf text format)

# Location of the continuous shell script in repository.
build_file: "grpc-node/tools/release/kokoro.bat"
timeout_mins: 120
action {
define_artifacts {
regex: "github/grpc-node/artifacts/**",
strip_prefix: "github/grpc-node/artifacts"
}
}

0 comments on commit 190a72e

Please sign in to comment.