-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathcreateSnapshot.btm
68 lines (50 loc) · 1.96 KB
/
createSnapshot.btm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
rem # input arguments
rem # %1 - folder with 3rd party software
rem # - HG repository is updated to head
rem # Required env variables:
rem # PUBLISH_URL - url (user@host) of the publish server
rem # ID_KEY - identity key file for logging into publish server
call updateSetVariables__.btm snapshot
set WIN_SNAPSHOT=orange-win-snapshot-hg-%daystr
set WIN_PYTHON_SNAPSHOT=orange-win-w-python-snapshot-hg-%daystr
set ADDON_BIOINFORMATICS_SNAPSHOT=orangeAddOn-bioinformatics-snapshot-hg-%daystr
set ADDON_TEXT_SNAPSHOT=orangeAddOn-text-snapshot-hg-%daystr
set SOURCE_SNAPSHOT=orange-source-snapshot-hg-%daystr.zip
rem # build core
cdd %SCRIPTDIR
call createCommon__.btm snapshot %1 %WIN_SNAPSHOT %WIN_PYTHON_SNAPSHOT
break_on_error
rem # build add ons
cdd %SCRIPTDIR
call createCommonAddOns__.btm snapshot %ADDON_BIOINFORMATICS_SNAPSHOT %ADDON_TEXT_SNAPSHOT
break_on_error
rem # pack sources
cdd %WORKDIR\orange
rem # build source distribution
e:\Python27\python.exe setup.py sdist
break_on_error
move /z dist\Orange-?.*.zip %DISTDIR\%SOURCE_SNAPSHOT
cd %DISTDIR%
rem # remember new filenames
call "%SCRIPTDIR\updateVersionsPy__.btm" filenames_win.set
rem # if no errors then publish on web (everything at the same time)
rem # Create a ftp batch script "move.scr".
rem # (problem is sftp does not support an atomic move operation)
echo cd files > move.scr
for %FILENAME in (*.exe) do (
echo put %FILENAME %FILENAME.tmp >> move.scr
echo rm %FILENAME >> move.scr
echo rename %FILENAME.tmp %FILENAME >> move.scr
)
echo put %SOURCE_SNAPSHOT %SOURCE_SNAPSHOT.tmp >> move.scr
echo rm %SOURCE_SNAPSHOT >> move.scr
echo rename %SOURCE_SNAPSHOT.tmp %SOURCE_SNAPSHOT >> move.scr
echo put filenames_win.set filenames_win.set.tmp >> move.scr
echo rm filenames_win.set >> move.scr
echo rename filenames_win.set.tmp filenames_win.set >> move.scr
echo exit >> move.scr
rem # Finally move all the files
psftp -i "%ID_KEY%" %PUBLISH_URL% -batch -be -b move.scr
rem # Cleanup
del /Q *.exe
del /Q *.zip