mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
chore: unify CI scripts (#1434)
Currently we have almost equal CI scripts implemented in bash (for Travis), and batch (for Appveyor). This commit takes advantage of MinGW bash to unify all the scripts as bash scripts. Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
parent
705e273400
commit
a12abc2a6c
15
.travis.yml
15
.travis.yml
@ -33,17 +33,24 @@ os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||
export HOST_OS="darwin";
|
||||
else
|
||||
export HOST_OS="$TRAVIS_OS_NAME";
|
||||
fi
|
||||
|
||||
install:
|
||||
- travis_wait ./scripts/ci/travis-install.sh
|
||||
- travis_wait ./scripts/ci/install.sh -o $HOST_OS -r $TARGET_ARCH
|
||||
|
||||
script:
|
||||
- ./scripts/ci/travis-test.sh
|
||||
- ./scripts/ci/travis-build-installers.sh
|
||||
- ./scripts/ci/test.sh -o $HOST_OS -r $TARGET_ARCH
|
||||
- ./scripts/ci/build-installers.sh -o $HOST_OS -r $TARGET_ARCH
|
||||
|
||||
deploy:
|
||||
provider: script
|
||||
skip_cleanup: true
|
||||
script: scripts/ci/travis-deploy.sh
|
||||
script: scripts/ci/deploy-aws-s3.sh -o $HOST_OS -r $TARGET_ARCH
|
||||
on:
|
||||
branch: master
|
||||
|
||||
|
@ -28,18 +28,18 @@ install:
|
||||
- set PATH=C:\Program Files (x86)\NSIS;%PATH%
|
||||
- set PATH=C:\MinGW\bin;%PATH%
|
||||
- set PATH=C:\MinGW\msys\1.0\bin;%PATH%
|
||||
- .\scripts\ci\appveyor-install.bat
|
||||
- bash .\scripts\ci\install.sh -o win32 -r %TARGET_ARCH%
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- node --version
|
||||
- npm --version
|
||||
- .\scripts\ci\appveyor-test.bat
|
||||
- .\scripts\ci\appveyor-build-installers.bat
|
||||
- bash .\scripts\ci\test.sh -o win32 -r %TARGET_ARCH%
|
||||
- bash .\scripts\ci\build-installers.sh -o win32 -r %TARGET_ARCH%
|
||||
|
||||
deploy_script:
|
||||
- .\scripts\ci\appveyor-deploy.bat
|
||||
- bash .\scripts\ci\deploy-aws-s3.sh -o win32 -r %TARGET_ARCH%
|
||||
|
||||
notifications:
|
||||
|
||||
|
@ -1,24 +0,0 @@
|
||||
@echo off
|
||||
|
||||
:: Copyright 2017 resin.io
|
||||
::
|
||||
:: 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.
|
||||
|
||||
IF "%APPVEYOR_REPO_BRANCH%"=="" (
|
||||
ECHO This script is only meant to run in Appveyor CI 1>&2
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
call make installers-all || ( EXIT /B 1 )
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
@ -1,26 +0,0 @@
|
||||
@echo off
|
||||
|
||||
:: Copyright 2017 resin.io
|
||||
::
|
||||
:: 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.
|
||||
|
||||
IF "%APPVEYOR_REPO_BRANCH%"=="" (
|
||||
ECHO This script is only meant to run in Appveyor CI 1>&2
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF %APPVEYOR_REPO_BRANCH%==master (
|
||||
call make publish-aws-s3 || ( EXIT /B 1 )
|
||||
)
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
@ -1,34 +0,0 @@
|
||||
@echo off
|
||||
|
||||
:: Copyright 2017 resin.io
|
||||
::
|
||||
:: 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.
|
||||
|
||||
IF "%APPVEYOR_REPO_BRANCH%"=="" (
|
||||
ECHO This script is only meant to run in Appveyor CI 1>&2
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
call npm config set spin=false || ( EXIT /B 1 )
|
||||
call npm install -g uglify-es@3.0.3 || ( EXIT /B 1 )
|
||||
|
||||
call choco install nsis -version 2.51 || ( EXIT /B 1 )
|
||||
call choco install jq || ( EXIT /B 1 )
|
||||
call choco install curl || ( EXIT /B 1 )
|
||||
|
||||
call pip install -r requirements.txt || ( EXIT /B 1 )
|
||||
|
||||
call make info || ( EXIT /B 1 )
|
||||
call make electron-develop || ( EXIT /B 1 )
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
@ -1,25 +0,0 @@
|
||||
@echo off
|
||||
|
||||
:: Copyright 2017 resin.io
|
||||
::
|
||||
:: 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.
|
||||
|
||||
IF "%APPVEYOR_REPO_BRANCH%"=="" (
|
||||
ECHO This script is only meant to run in Appveyor CI 1>&2
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
call make sanity-checks || ( EXIT /B 1 )
|
||||
call npm test || ( EXIT /B 1 )
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
@ -19,18 +19,37 @@
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ -z "$TRAVIS_OS_NAME" ]; then
|
||||
echo "This script is only meant to run in Travis CI" 1>&2
|
||||
function usage() {
|
||||
echo "Usage: $0"
|
||||
echo ""
|
||||
echo "Options"
|
||||
echo ""
|
||||
echo " -o <operating system>"
|
||||
echo " -r <architecture>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ARGV_OPERATING_SYSTEM=""
|
||||
ARGV_ARCHITECTURE=""
|
||||
|
||||
while getopts ":o:r:" option; do
|
||||
case $option in
|
||||
o) ARGV_OPERATING_SYSTEM=$OPTARG ;;
|
||||
r) ARGV_ARCHITECTURE=$OPTARG ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$ARGV_OPERATING_SYSTEM" ] || [ -z "$ARGV_ARCHITECTURE" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
./scripts/build/check-dependency.sh make
|
||||
|
||||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||
if [ "$ARGV_OPERATING_SYSTEM" == "linux" ]; then
|
||||
./scripts/build/docker/run-command.sh \
|
||||
-r "$TARGET_ARCH" \
|
||||
-s "$(pwd)" \
|
||||
-c 'make installers-all'
|
||||
else
|
||||
./scripts/build/check-dependency.sh make
|
||||
make installers-all
|
||||
fi
|
@ -19,18 +19,37 @@
|
||||
set -e
|
||||
set -u
|
||||
|
||||
./scripts/build/check-dependency.sh make
|
||||
|
||||
if [ -z "$TRAVIS_OS_NAME" ]; then
|
||||
echo "This script is only meant to run in Travis CI" 1>&2
|
||||
function usage() {
|
||||
echo "Usage: $0"
|
||||
echo ""
|
||||
echo "Options"
|
||||
echo ""
|
||||
echo " -o <operating system>"
|
||||
echo " -r <architecture>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ARGV_OPERATING_SYSTEM=""
|
||||
ARGV_ARCHITECTURE=""
|
||||
|
||||
while getopts ":o:r:" option; do
|
||||
case $option in
|
||||
o) ARGV_OPERATING_SYSTEM=$OPTARG ;;
|
||||
r) ARGV_ARCHITECTURE=$OPTARG ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$ARGV_OPERATING_SYSTEM" ] || [ -z "$ARGV_ARCHITECTURE" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
||||
if [ "$ARGV_OPERATING_SYSTEM" == "linux" ]; then
|
||||
./scripts/build/docker/run-command.sh \
|
||||
-r "$TARGET_ARCH" \
|
||||
-r "$ARGV_ARCHITECTURE" \
|
||||
-s "$(pwd)" \
|
||||
-c "make publish-aws-s3"
|
||||
else
|
||||
./scripts/build/check-dependency.sh make
|
||||
make publish-aws-s3
|
||||
fi
|
@ -19,26 +19,58 @@
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ -z "$TRAVIS_OS_NAME" ]; then
|
||||
echo "This script is only meant to run in Travis CI" 1>&2
|
||||
function usage() {
|
||||
echo "Usage: $0"
|
||||
echo ""
|
||||
echo "Options"
|
||||
echo ""
|
||||
echo " -o <operating system>"
|
||||
echo " -r <architecture>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ARGV_OPERATING_SYSTEM=""
|
||||
ARGV_ARCHITECTURE=""
|
||||
|
||||
while getopts ":o:r:" option; do
|
||||
case $option in
|
||||
o) ARGV_OPERATING_SYSTEM=$OPTARG ;;
|
||||
r) ARGV_ARCHITECTURE=$OPTARG ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$ARGV_OPERATING_SYSTEM" ] || [ -z "$ARGV_ARCHITECTURE" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||
if [ "$ARGV_OPERATING_SYSTEM" == "linux" ]; then
|
||||
./scripts/build/docker/run-command.sh \
|
||||
-r "$TARGET_ARCH" \
|
||||
-r "$ARGV_ARCHITECTURE" \
|
||||
-s "$(pwd)" \
|
||||
-c "make info && make electron-develop"
|
||||
else
|
||||
./scripts/build/check-dependency.sh pip
|
||||
./scripts/build/check-dependency.sh brew
|
||||
./scripts/build/check-dependency.sh make
|
||||
if [ "$ARGV_OPERATING_SYSTEM" == "darwin" ]; then
|
||||
./scripts/build/check-dependency.sh brew
|
||||
brew install afsctool jq
|
||||
elif [ "$ARGV_OPERATING_SYSTEM" == "win32" ]; then
|
||||
./scripts/build/check-dependency.sh choco
|
||||
choco install nsis -version 2.51
|
||||
choco install jq
|
||||
choco install curl
|
||||
else
|
||||
echo "Unsupported operating system: $ARGV_OPERATING_SYSTEM" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./scripts/build/check-dependency.sh npm
|
||||
./scripts/build/check-dependency.sh pip
|
||||
./scripts/build/check-dependency.sh make
|
||||
|
||||
npm config set spin=false
|
||||
npm install -g uglify-es@3.0.3
|
||||
pip install -r requirements.txt
|
||||
brew install afsctool jq
|
||||
|
||||
make info
|
||||
make electron-develop
|
||||
fi
|
@ -19,20 +19,40 @@
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ -z "$TRAVIS_OS_NAME" ]; then
|
||||
echo "This script is only meant to run in Travis CI" 1>&2
|
||||
function usage() {
|
||||
echo "Usage: $0"
|
||||
echo ""
|
||||
echo "Options"
|
||||
echo ""
|
||||
echo " -o <operating system>"
|
||||
echo " -r <architecture>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ARGV_OPERATING_SYSTEM=""
|
||||
ARGV_ARCHITECTURE=""
|
||||
|
||||
while getopts ":o:r:" option; do
|
||||
case $option in
|
||||
o) ARGV_OPERATING_SYSTEM=$OPTARG ;;
|
||||
r) ARGV_ARCHITECTURE=$OPTARG ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$ARGV_OPERATING_SYSTEM" ] || [ -z "$ARGV_ARCHITECTURE" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
./scripts/build/check-dependency.sh npm
|
||||
./scripts/build/check-dependency.sh make
|
||||
|
||||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||
if [ "$ARGV_OPERATING_SYSTEM" == "linux" ]; then
|
||||
./scripts/build/docker/run-command.sh \
|
||||
-r "$TARGET_ARCH" \
|
||||
-r "$ARGV_ARCHITECTURE" \
|
||||
-s "$(pwd)" \
|
||||
-c 'make sanity-checks && xvfb-run --server-args=$XVFB_ARGS npm test'
|
||||
else
|
||||
./scripts/build/check-dependency.sh make
|
||||
./scripts/build/check-dependency.sh npm
|
||||
|
||||
make sanity-checks
|
||||
npm test
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user