|
17 | 17 | # This file contains rules used by the LiveCode Buildbot installation at |
18 | 18 | # <https://vulcan.livecode.com/> |
19 | 19 |
|
| 20 | +# Load version information |
| 21 | +include version |
| 22 | + |
| 23 | +# Get git commit information |
| 24 | +ifeq ($(BUILD_EDITION),commercial) |
| 25 | +GIT_VERSION=g$(shell git --git-dir=../.git rev-parse --short HEAD) |
| 26 | +else |
| 27 | +GIT_VERSION=g$(shell git rev-parse --short HEAD) |
| 28 | +endif |
| 29 | + |
20 | 30 | ################################################################ |
21 | 31 | # Configure with gyp |
22 | 32 | ################################################################ |
@@ -91,6 +101,12 @@ buildtool_command = $(LIVECODE) -ui $(BUILDTOOL_STACK) \ |
91 | 101 | --engine-dir . --output-dir . --work-dir ./_cache/builder_tool \ |
92 | 102 | --private-dir .. |
93 | 103 |
|
| 104 | +# Settings for upload |
| 105 | +RSYNC ?= rsync |
| 106 | +UPLOAD_SERVER ?= meg.on-rev.com |
| 107 | +UPLOAD_PATH = staging/$(BUILD_LONG_VERSION)/$(GIT_VERSION) |
| 108 | +UPLOAD_MAX_RETRIES = 50 |
| 109 | + |
94 | 110 | dist-docs: |
95 | 111 | $(buildtool_command) --platform $(buildtool_platform) --stage docs |
96 | 112 |
|
@@ -121,12 +137,39 @@ dist-tools: dist-tools-community |
121 | 137 | distmac-disk: distmac-disk-community |
122 | 138 |
|
123 | 139 | dist-tools-community: |
124 | | - $(buildtool_command) --platform linux --platform mac --stage tools --edition community |
| 140 | + $(buildtool_command) --platform linux --platform mac --platform win --stage tools --edition community |
125 | 141 | dist-tools-commercial: |
126 | | - $(buildtool_command) --platform linux --platform mac --stage tools --edition commercial |
127 | | - |
128 | | -# FIXME upload installers to distribution server |
129 | | -dist-upload: |
| 142 | + $(buildtool_command) --platform linux --platform mac --platform win --stage tools --edition commercial |
| 143 | + |
| 144 | +# Make a list of installers to be uploaded to the distribution server |
| 145 | +dist-upload-files.txt: |
| 146 | + find . -maxdepth 1 -name 'LiveCode*Installer-*-Mac.dmg' \ |
| 147 | + -o -name 'LiveCode*Installer-*-Windows.exe' \ |
| 148 | + -o -name 'LiveCode*Installer-*-Linux.*' \ |
| 149 | + > $@ |
| 150 | + |
| 151 | +# Perform the upload. This is in two steps: |
| 152 | +# (1) Create the target directory |
| 153 | +# (2) Transfer the files using rsync |
| 154 | +# |
| 155 | +# We need to do the actual transfer in a loop to deal with possible |
| 156 | +# connection drops |
| 157 | +dist-upload-mkdir: |
| 158 | + ssh $(UPLOAD_SERVER) "mkdir -p $(UPLOAD_PATH)" |
| 159 | +dist-upload: dist-upload-files.txt dist-upload-mkdir |
| 160 | + trap "echo Interrupted; exit;" SIGINT SIGTERM; \ |
| 161 | + i=0; \ |
| 162 | + false; \ |
| 163 | + while [ $$? -ne 0 -a $$i -lt $(UPLOAD_MAX_RETRIES) ] ; do \ |
| 164 | + i=$$(($$i+1)); \ |
| 165 | + rsync -v --progress --partial --chmod=ugo=rwX --executability \ |
| 166 | + --files-from=dist-upload-files.txt . $(UPLOAD_SERVER):$(UPLOAD_PATH); \ |
| 167 | + done; \ |
| 168 | + rc=$$?; \ |
| 169 | + if [ $$i -eq $(UPLOAD_MAX_RETRIES) ]; then \ |
| 170 | + echo "Maximum retries reached, giving up"; \ |
| 171 | + fi; \ |
| 172 | + exit $$rc |
130 | 173 |
|
131 | 174 | # This rule is used for packing the Mac installer contents; the |
132 | 175 | # resulting archive gets transferred to a Mac for signing and |
|
0 commit comments