mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
chore: publish development Bintray packages (#1611)
This commit includes several changes to adapt the CI configuration files and Bintray publish script to perform development deployments. - Move our Bintray details to the Makefile - Deploy to a new Bintray component if `RELEASE_TYPE` is `snapshot` - Call `publish-bintray-debian` and `publish-bintray-redhat` in the CI deployment script - Call the Bintray deployment scripts for RPMs Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit is contained in:
parent
1103492193
commit
de62b2e65c
@ -67,7 +67,7 @@ script:
|
||||
deploy:
|
||||
provider: script
|
||||
skip_cleanup: true
|
||||
script: scripts/ci/deploy-aws-s3.sh -o $HOST_OS -r $TARGET_ARCH
|
||||
script: scripts/ci/deploy.sh -o $HOST_OS -r $TARGET_ARCH
|
||||
on:
|
||||
branch: master
|
||||
|
||||
|
66
Makefile
66
Makefile
@ -26,6 +26,29 @@ APPLICATION_NAME = $(shell jq -r '.displayName' package.json)
|
||||
APPLICATION_DESCRIPTION = $(shell jq -r '.description' package.json)
|
||||
APPLICATION_COPYRIGHT = $(shell cat electron-builder.yml | shyaml get-value copyright)
|
||||
|
||||
BINTRAY_ORGANIZATION = resin-io
|
||||
BINTRAY_REPOSITORY_DEBIAN = debian
|
||||
BINTRAY_REPOSITORY_REDHAT = redhat
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Extra variables
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
TARGET_ARCH_DEBIAN = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t debian)
|
||||
TARGET_ARCH_REDHAT = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t redhat)
|
||||
TARGET_ARCH_APPIMAGE = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t appimage)
|
||||
TARGET_ARCH_ELECTRON_BUILDER = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t electron-builder)
|
||||
PLATFORM_PKG = $(shell ./scripts/build/platform-convert.sh -r $(PLATFORM) -t pkg)
|
||||
ENTRY_POINT_CLI = lib/cli/etcher.js
|
||||
ETCHER_CLI_BINARY = $(APPLICATION_NAME_LOWERCASE)
|
||||
ifeq ($(TARGET_PLATFORM),win32)
|
||||
ETCHER_CLI_BINARY = $(APPLICATION_NAME_LOWERCASE).exe
|
||||
endif
|
||||
|
||||
APPLICATION_NAME_LOWERCASE = $(shell echo $(APPLICATION_NAME) | tr A-Z a-z)
|
||||
APPLICATION_VERSION_DEBIAN = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")
|
||||
APPLICATION_VERSION_REDHAT = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Release type
|
||||
# ---------------------------------------------------------------------
|
||||
@ -36,11 +59,13 @@ PACKAGE_JSON_VERSION = $(shell jq -r '.version' package.json)
|
||||
ifeq ($(RELEASE_TYPE),production)
|
||||
APPLICATION_VERSION = $(PACKAGE_JSON_VERSION)
|
||||
S3_BUCKET = resin-production-downloads
|
||||
BINTRAY_COMPONENT = $(APPLICATION_NAME_LOWERCASE)
|
||||
endif
|
||||
ifeq ($(RELEASE_TYPE),snapshot)
|
||||
CURRENT_COMMIT_HASH = $(shell git log -1 --format="%h")
|
||||
APPLICATION_VERSION = $(PACKAGE_JSON_VERSION)+$(CURRENT_COMMIT_HASH)
|
||||
S3_BUCKET = resin-nightly-downloads
|
||||
BINTRAY_COMPONENT = $(APPLICATION_NAME_LOWERCASE)-devel
|
||||
endif
|
||||
ifndef APPLICATION_VERSION
|
||||
$(error Invalid release type: $(RELEASE_TYPE))
|
||||
@ -164,26 +189,6 @@ else
|
||||
ELECTRON_BUILDER_OPTIONS += --extraMetadata.analytics.mixpanel.token=$(ANALYTICS_MIXPANEL_TOKEN)
|
||||
endif
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Extra variables
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
TARGET_ARCH_DEBIAN = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t debian)
|
||||
TARGET_ARCH_REDHAT = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t redhat)
|
||||
TARGET_ARCH_APPIMAGE = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t appimage)
|
||||
TARGET_ARCH_ELECTRON_BUILDER = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET_ARCH) -t electron-builder)
|
||||
PLATFORM_PKG = $(shell ./scripts/build/platform-convert.sh -r $(PLATFORM) -t pkg)
|
||||
ENTRY_POINT_CLI = lib/cli/etcher.js
|
||||
ETCHER_CLI_BINARY = $(APPLICATION_NAME_LOWERCASE)
|
||||
ifeq ($(PLATFORM),win32)
|
||||
ETCHER_CLI_BINARY = $(APPLICATION_NAME_LOWERCASE).exe
|
||||
endif
|
||||
|
||||
PRODUCT_NAME = etcher
|
||||
APPLICATION_NAME_LOWERCASE = $(shell echo $(APPLICATION_NAME) | tr A-Z a-z)
|
||||
APPLICATION_VERSION_DEBIAN = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")
|
||||
APPLICATION_VERSION_REDHAT = $(shell echo $(APPLICATION_VERSION) | tr "-" "~")
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Rules
|
||||
# ---------------------------------------------------------------------
|
||||
@ -448,14 +453,14 @@ ifeq ($(RELEASE_TYPE),production)
|
||||
-f $(publishable) \
|
||||
-b $(S3_BUCKET) \
|
||||
-v $(APPLICATION_VERSION) \
|
||||
-p $(PRODUCT_NAME)))
|
||||
-p $(APPLICATION_NAME_LOWERCASE)))
|
||||
endif
|
||||
ifeq ($(RELEASE_TYPE),snapshot)
|
||||
$(foreach publishable,$^,$(call execute-command,./scripts/publish/aws-s3.sh \
|
||||
-f $(publishable) \
|
||||
-b $(S3_BUCKET) \
|
||||
-v $(APPLICATION_VERSION) \
|
||||
-p $(PRODUCT_NAME) \
|
||||
-p $(APPLICATION_NAME_LOWERCASE) \
|
||||
-k $(shell date +"%Y-%m-%d")))
|
||||
endif
|
||||
|
||||
@ -464,19 +469,28 @@ endif
|
||||
|
||||
ifdef PUBLISH_BINTRAY_DEBIAN
|
||||
publish-bintray-debian: $(PUBLISH_BINTRAY_DEBIAN)
|
||||
$(foreach publishable,$^,$(call execute-command,./scripts/publish/bintray-debian.sh \
|
||||
$(foreach publishable,$^,$(call execute-command,./scripts/publish/bintray.sh \
|
||||
-f $(publishable) \
|
||||
-v $(APPLICATION_VERSION_DEBIAN) \
|
||||
-r $(TARGET_ARCH) \
|
||||
-c $(APPLICATION_NAME_LOWERCASE) \
|
||||
-t $(RELEASE_TYPE)))
|
||||
-t $(RELEASE_TYPE) \
|
||||
-o $(BINTRAY_ORGANIZATION) \
|
||||
-p $(BINTRAY_REPOSITORY_DEBIAN) \
|
||||
-c $(BINTRAY_COMPONENT)))
|
||||
|
||||
TARGETS += publish-bintray-debian
|
||||
endif
|
||||
|
||||
ifdef PUBLISH_BINTRAY_REDHAT
|
||||
publish-bintray-redhat: $(PUBLISH_BINTRAY_REDHAT)
|
||||
# TODO: Update this after we've created ./scripts/publish/bintray-redhat.sh
|
||||
$(foreach publishable,$^,$(call execute-command,./scripts/publish/bintray.sh \
|
||||
-f $(publishable) \
|
||||
-v $(APPLICATION_VERSION_REDHAT) \
|
||||
-r $(TARGET_ARCH) \
|
||||
-t $(RELEASE_TYPE) \
|
||||
-o $(BINTRAY_ORGANIZATION) \
|
||||
-p $(BINTRAY_REPOSITORY_REDHAT) \
|
||||
-c $(BINTRAY_COMPONENT)))
|
||||
|
||||
TARGETS += publish-bintray-redhat
|
||||
endif
|
||||
|
@ -43,7 +43,7 @@ test_script:
|
||||
- bash .\scripts\ci\build-installers.sh -o win32 -r %TARGET_ARCH%
|
||||
|
||||
deploy_script:
|
||||
- bash .\scripts\ci\deploy-aws-s3.sh -o win32 -r %TARGET_ARCH%
|
||||
- if %APPVEYOR_REPO_BRANCH%==master (bash .\scripts\ci\deploy.sh -o win32 -r %TARGET_ARCH%)
|
||||
|
||||
notifications:
|
||||
|
||||
|
@ -48,8 +48,8 @@ if [ "$ARGV_OPERATING_SYSTEM" == "linux" ]; then
|
||||
./scripts/build/docker/run-command.sh \
|
||||
-r "$ARGV_ARCHITECTURE" \
|
||||
-s "$(pwd)" \
|
||||
-c "make publish-aws-s3"
|
||||
-c "make installers-all"
|
||||
else
|
||||
./scripts/build/check-dependency.sh make
|
||||
make publish-aws-s3
|
||||
make installers-all
|
||||
fi
|
@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
###
|
||||
# Copyright 2016 resin.io
|
||||
#
|
||||
@ -28,26 +27,32 @@ function usage() {
|
||||
echo "Options"
|
||||
echo ""
|
||||
echo " -f <file>"
|
||||
echo " -v <debian-friendly version>"
|
||||
echo " -v <version>"
|
||||
echo " -r <architecture>"
|
||||
echo " -c <component name>"
|
||||
echo " -t <release type (production|snapshot)>"
|
||||
echo " -o <bintray organization>"
|
||||
echo " -p <bintray repository>"
|
||||
echo " -c <bintray component>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ARGV_FILE=""
|
||||
ARGV_VERSION=""
|
||||
ARGV_ARCHITECTURE=""
|
||||
ARGV_COMPONENT_NAME=""
|
||||
ARGV_RELEASE_TYPE=""
|
||||
ARGV_ORGANIZATION=""
|
||||
ARGV_REPOSITORY=""
|
||||
ARGV_COMPONENT=""
|
||||
|
||||
while getopts ":f:v:r:c:t:" option; do
|
||||
while getopts ":f:v:r:t:o:p:c:" option; do
|
||||
case $option in
|
||||
f) ARGV_FILE="$OPTARG" ;;
|
||||
v) ARGV_VERSION="$OPTARG" ;;
|
||||
r) ARGV_ARCHITECTURE="$OPTARG" ;;
|
||||
c) ARGV_COMPONENT_NAME="$OPTARG" ;;
|
||||
t) ARGV_RELEASE_TYPE="$OPTARG" ;;
|
||||
o) ARGV_ORGANIZATION="$OPTARG" ;;
|
||||
p) ARGV_REPOSITORY="$OPTARG" ;;
|
||||
c) ARGV_COMPONENT="$OPTARG" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
@ -55,8 +60,10 @@ done
|
||||
if [ -z "$ARGV_FILE" ] || \
|
||||
[ -z "$ARGV_VERSION" ] || \
|
||||
[ -z "$ARGV_ARCHITECTURE" ] || \
|
||||
[ -z "$ARGV_COMPONENT_NAME" ] || \
|
||||
[ -z "$ARGV_RELEASE_TYPE" ]
|
||||
[ -z "$ARGV_RELEASE_TYPE" ] || \
|
||||
[ -z "$ARGV_ORGANIZATION" ] || \
|
||||
[ -z "$ARGV_REPOSITORY" ] || \
|
||||
[ -z "$ARGV_COMPONENT" ]
|
||||
then
|
||||
usage
|
||||
fi
|
||||
@ -87,9 +94,10 @@ PACKAGE_ARCHITECTURE=$(./scripts/build/architecture-convert.sh -r "$ARGV_ARCHITE
|
||||
curl --upload-file $ARGV_FILE \
|
||||
--user $BINTRAY_USER:$BINTRAY_API_KEY \
|
||||
--header "X-Bintray-Debian-Distribution: $PACKAGE_DISTRIBUTION" \
|
||||
--header "X-Bintray-Debian-Component: $ARGV_COMPONENT_NAME" \
|
||||
--header "X-Bintray-Debian-Component: $ARGV_COMPONENT" \
|
||||
--header "X-Bintray-Debian-Architecture: $PACKAGE_ARCHITECTURE" \
|
||||
--header "X-Bintray-Override: 1" \
|
||||
--header "X-Bintray-Publish: 1" \
|
||||
https://api.bintray.com/content/resin-io/debian/$ARGV_COMPONENT_NAME/$ARGV_VERSION/$PACKAGE_FILE_NAME
|
||||
https://api.bintray.com/content/$ARGV_ORGANIZATION/$ARGV_REPOSITORY/$ARGV_COMPONENT/$ARGV_VERSION/$PACKAGE_FILE_NAME
|
||||
|
||||
echo "$ARGV_FILE has been uploaded successfully"
|
Loading…
x
Reference in New Issue
Block a user