chore: create installers (but don't publish) on every pull request (#1365)

This allows us to catch changes that break our installer builds before
merging the problematic changes.

As a way to simplify the CI configuration files, this commit introduces
an `installers-all` Makefile target that builds all installers.

This commit also replaces all the `cp -rf` calls with `cp -RLf` in
Makefile to avoid some weird hard link Appveyor issues.

See: https://github.com/resin-io/etcher/pull/1078
See: https://github.com/resin-io/etcher/pull/1354
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2017-05-17 23:00:59 -04:00 committed by GitHub
parent a74e6b53cd
commit 30ed217c79
6 changed files with 72 additions and 2 deletions

View File

@ -38,6 +38,7 @@ install:
script: script:
- ./scripts/ci/travis-test.sh - ./scripts/ci/travis-test.sh
- ./scripts/ci/travis-build-installers.sh
deploy: deploy:
provider: script provider: script

View File

@ -156,6 +156,8 @@ TARGET_ARCH_DEBIAN = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET
PRODUCT_NAME = etcher PRODUCT_NAME = etcher
APPLICATION_NAME_LOWERCASE = $(shell echo $(APPLICATION_NAME) | tr A-Z a-z) APPLICATION_NAME_LOWERCASE = $(shell echo $(APPLICATION_NAME) | tr A-Z a-z)
APPLICATION_VERSION_DEBIAN = $(shell echo $(APPLICATION_VERSION) | tr "-" "~") APPLICATION_VERSION_DEBIAN = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")
# Fix hard link Appveyor issues
CPRF = cp -RLf CPRF = cp -RLf
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
@ -430,6 +432,7 @@ TARGETS = \
package-electron \ package-electron \
package-cli \ package-cli \
cli-develop \ cli-develop \
installers-all \
electron-develop electron-develop
package-electron: $(BUILD_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH) package-electron: $(BUILD_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH)
@ -478,6 +481,8 @@ PUBLISH_AWS_S3 += \
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).zip $(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).zip
endif endif
installers-all: $(PUBLISH_AWS_S3) $(PUBLISH_BINTRAY_DEBIAN)
ifdef PUBLISH_AWS_S3 ifdef PUBLISH_AWS_S3
publish-aws-s3: $(PUBLISH_AWS_S3) publish-aws-s3: $(PUBLISH_AWS_S3)
ifeq ($(RELEASE_TYPE),production) ifeq ($(RELEASE_TYPE),production)

View File

@ -35,10 +35,11 @@ build: off
test_script: test_script:
- node --version - node --version
- npm --version - npm --version
- cmd: .\scripts\ci\appveyor-test.bat - .\scripts\ci\appveyor-test.bat
- .\scripts\ci\appveyor-build-installers.bat
deploy_script: deploy_script:
- cmd: .\scripts\ci\appveyor-deploy.bat - .\scripts\ci\appveyor-deploy.bat
notifications: notifications:

View File

@ -0,0 +1,24 @@
@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%

View File

@ -0,0 +1,36 @@
#!/bin/bash
###
# 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.
###
set -e
set -u
if [ -z "$TRAVIS_OS_NAME" ]; then
echo "This script is only meant to run in Travis CI" 1>&2
exit 1
fi
./scripts/build/check-dependency.sh make
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
./scripts/build/docker/run-command.sh \
-r "$TARGET_ARCH" \
-s "$(pwd)" \
-c 'make installers-all'
else
make installers-all
fi

View File

@ -24,6 +24,9 @@ if [ -z "$TRAVIS_OS_NAME" ]; then
exit 1 exit 1
fi fi
./scripts/build/check-dependency.sh npm
./scripts/build/check-dependency.sh make
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
./scripts/build/docker/run-command.sh \ ./scripts/build/docker/run-command.sh \
-r "$TARGET_ARCH" \ -r "$TARGET_ARCH" \