Skip to content

Commit

Permalink
chore: create installers (but don't publish) on every pull request (b…
Browse files Browse the repository at this point in the history
…alena-io#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: balena-io#1078
See: balena-io#1354
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
  • Loading branch information
Juan Cruz Viotti authored May 18, 2017
1 parent a74e6b5 commit 30ed217
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ install:

script:
- ./scripts/ci/travis-test.sh
- ./scripts/ci/travis-build-installers.sh

deploy:
provider: script
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ TARGET_ARCH_DEBIAN = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET
PRODUCT_NAME = etcher
APPLICATION_NAME_LOWERCASE = $(shell echo $(APPLICATION_NAME) | tr A-Z a-z)
APPLICATION_VERSION_DEBIAN = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")

# Fix hard link Appveyor issues
CPRF = cp -RLf

# ---------------------------------------------------------------------
Expand Down Expand Up @@ -430,6 +432,7 @@ TARGETS = \
package-electron \
package-cli \
cli-develop \
installers-all \
electron-develop

package-electron: $(BUILD_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH)
Expand Down Expand Up @@ -478,6 +481,8 @@ PUBLISH_AWS_S3 += \
$(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).zip
endif

installers-all: $(PUBLISH_AWS_S3) $(PUBLISH_BINTRAY_DEBIAN)

ifdef PUBLISH_AWS_S3
publish-aws-s3: $(PUBLISH_AWS_S3)
ifeq ($(RELEASE_TYPE),production)
Expand Down
5 changes: 3 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ build: off
test_script:
- node --version
- npm --version
- cmd: .\scripts\ci\appveyor-test.bat
- .\scripts\ci\appveyor-test.bat
- .\scripts\ci\appveyor-build-installers.bat

deploy_script:
- cmd: .\scripts\ci\appveyor-deploy.bat
- .\scripts\ci\appveyor-deploy.bat

notifications:

Expand Down
24 changes: 24 additions & 0 deletions scripts/ci/appveyor-build-installers.bat
Original file line number Diff line number Diff line change
@@ -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%
36 changes: 36 additions & 0 deletions scripts/ci/travis-build-installers.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions scripts/ci/travis-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ if [ -z "$TRAVIS_OS_NAME" ]; then
exit 1
fi

./scripts/build/check-dependency.sh npm
./scripts/build/check-dependency.sh make

if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
./scripts/build/docker/run-command.sh \
-r "$TARGET_ARCH" \
Expand Down

0 comments on commit 30ed217

Please sign in to comment.