-
Notifications
You must be signed in to change notification settings - Fork 0
/
stage_extension_at_pvln.cmd
90 lines (74 loc) · 1.95 KB
/
stage_extension_at_pvln.cmd
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
:: Name: stage_extension_at_pvln.cmd
:: Purpose: set enviroment and run deploy script
:: Author: [email protected]
:: Revision: 2019 02 11 - initial version
:: 2020 03 15 - new folder structure
::
@ECHO off
SETLOCAL ENABLEEXTENSIONS
:: BASIC SETTINGS
:: ==============
:: Setting the name of the script
SET me=%~n0
:: Setting the name of the directory with this script
SET parent=%~p0
:: Setting the drive of this commandfile
SET drive=%~d0
:: Setting the directory and drive of this commandfile
SET cmd_dir=%~dp0
::
:: (re)set environment variables
::
SET VERBOSE=YES
::
:: Setting for Error messages
::
SET ERROR_MESSAGE=errorfree
:: Setting required environment variables:
::
:: Where to put the files on the staging/download server
SET download_folder=/download/joomla/modules/ipheionmaps/
SET update_folder=/update/joomla/modules/ipheionmaps/
:: Where to find the secrets
SET secrets_folder=..\..\..\_secrets
:: -OUTPUT DIRECTORY FOR BUILD = INPUT DIRECTORY FOR STAGING
:: do not start with \ , and do not end with \
SET output_dir=..\_bin
CLS
CD "%cmd_dir%"
:: struc_utils_folder
CD ..\struc\utils\
IF EXIST name.cmd (
CALL name.cmd
) ELSE (
SET ERROR_MESSAGE=[ERROR] [%~n0 ] file with extension name settings doesn't exist ...
GOTO ERROR_EXIT
)
CD "%cmd_dir%"
:: struc_utils_folder
CD ..\struc\utils\
IF EXIST version.cmd (
CALL version.cmd
) ELSE (
SET ERROR_MESSAGE=[ERROR] [%~n0 ] file with version info settings doesn't exist ...
GOTO ERROR_EXIT
)
::
:: Assume psftp should be used first. Then pscp. If not available choose ftp
::
:: !! Do not use " or ' at beginning or end of the list
:: Do not use sftp as the password can't be entered from batch files
SET CHECK_TRANSFER_LIST=psftp pscp ftp
CD "%cmd_dir%"
CALL stage_files.cmd
GOTO CLEAN_EXIT
:ERROR_EXIT
cd "%cmd_dir%"
ECHO *******************
ECHO %ERROR_MESSAGE%
ECHO *******************
:CLEAN_EXIT
cd "%cmd_dir%"
:: Wait some time and exit the script
::
timeout /T 10