-
Notifications
You must be signed in to change notification settings - Fork 343
/
Copy pathpython-app-runnerupdates.json
160 lines (160 loc) · 9.81 KB
/
python-app-runnerupdates.json
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
[
{
"UpdateStageName": "App Download",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"cd python-app-runner && rm -rf srv >/dev/null 2>&1; DownloadSource=\\\"{{DownloadSource}}\\\"; DownloadBranch=\\\"{{DownloadBranch}}\\\"; [[ -n \\\"{{DownloadUsername}}\\\" ]] && DownloadUrl=\\\"${DownloadSource/https:\\/\\//https:\\/\\/{{DownloadUsername}}:{{DownloadPassword}}@}\\\" || DownloadUrl=\\\"$DownloadSource\\\"; [ ! -d .git ] && { echo \\\"Installing the app\\\" && git clone \\\"$DownloadUrl\\\" srv >/dev/null && \\cp -r srv/. ./ >/dev/null 2>&1 && rm -rf srv >/dev/null 2>&1 && git fetch --all >/dev/null && [ -z \\\"$DownloadBranch\\\" ] && DownloadBranch=$(git symbolic-ref refs/remotes/origin/HEAD | sed \\\"s|.*/||\\\"); git checkout $DownloadBranch --force >/dev/null && git pull >/dev/null && echo \\\"App installed\\\"; } || { echo \\\"Updating the app\\\" && git fetch --all >/dev/null && [ -z \\\"$DownloadBranch\\\" ] && DownloadBranch=$(git symbolic-ref refs/remotes/origin/HEAD | sed \\\"s|.*/||\\\"); git checkout $DownloadBranch --force >/dev/null && git pull >/dev/null && echo \\\"App updated\\\"; }\"",
"UpdateSourceConditionSetting": "DownloadType",
"UpdateSourceConditionValue": "GitRepo",
"SkipOnFailure": false
},
{
"UpdateStageName": "App Download",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "powershell.exe",
"UpdateSourceArgs": "-NoProfile -Command \"$ProgressPreference='SilentlyContinue'; cd python-app-runner; Remove-Item srv -Recurse -Force -ErrorAction SilentlyContinue | Out-Null; $DownloadSource = \\\"{{DownloadSource}}\\\"; $DownloadBranch = \\\"{{DownloadBranch}}\\\"; if (![string]::IsNullOrEmpty(\\\"{{DownloadUsername}}\\\")) { $DownloadUrl = $DownloadSource -replace \\\"https://\\\", \\\"https://{{DownloadUsername}}:{{DownloadPassword}}@\\\" } else { $DownloadUrl = \\\"$DownloadSource\\\" }; if (-Not (Test-Path .git)) { Write-Output \\\"Installing the app\\\"; git clone \\\"$DownloadUrl\\\" srv 1> $null; Copy-Item srv/* ./ -Recurse -Force -ErrorAction SilentlyContinue | Out-Null; Remove-Item srv -Recurse -Force -ErrorAction SilentlyContinue | Out-Null; if ([string]::IsNullOrEmpty($DownloadBranch)) { $DownloadBranch = (git symbolic-ref refs/remotes/origin/HEAD) -replace '.*/' }; git checkout --force $DownloadBranch 1> $null; if ($?) { git pull 1> $null }; if ($?) { Write-Output \\\"App installed\\\" } } else { Write-Output \\\"Updating the app\\\"; git fetch --all 1> $null; if ([string]::IsNullOrEmpty($DownloadBranch)) { $DownloadBranch = (git symbolic-ref refs/remotes/origin/HEAD) -replace '.*/' }; git checkout --force $DownloadBranch 1> $null; if ($?) { git pull 1> $null }; if ($?) { Write-Output \\\"App updated\\\" } }\"",
"UpdateSourceConditionSetting": "DownloadType",
"UpdateSourceConditionValue": "GitRepo",
"SkipOnFailure": false
},
{
"UpdateStageName": "App Download",
"UpdateSourcePlatform": "All",
"UpdateSource": "GithubRelease",
"UpdateSourceArgs": "{{DownloadSource}}",
"UpdateSourceData": "{{DownloadFilename}}",
"UpdateSourceVersion": "{{DownloadVersion}}",
"UpdateSourceTarget": "{{$FullBaseDir}}",
"UnzipUpdateSource": true,
"OverwriteExistingFiles": true,
"DeleteAfterExtract": true,
"UpdateSourceConditionSetting": "DownloadType",
"UpdateSourceConditionValue": "GithubRelease"
},
{
"UpdateStageName": "App Download",
"UpdateSourcePlatform": "All",
"UpdateSource": "FetchURL",
"UpdateSourceData": "{{DownloadSource}}",
"UpdateSourceTarget": "{{$FullBaseDir}}",
"UnzipUpdateSource": true,
"OverwriteExistingFiles": true,
"DeleteAfterExtract": true,
"UpdateSourceConditionSetting": "DownloadType",
"UpdateSourceConditionValue": "DownloadURL"
},
{
"UpdateStageName": "Create Virtual Environment",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"if ! command -v /usr/bin/python{{PythonVersion}} >/dev/null 2>&1; then echo 'Error: Python {{PythonVersion}} is not installed.\nSee https://discourse.cubecoders.com/t/python-app-runner-guide/7420#p-15668-h-11-linux-3'; exit 1; fi; /usr/bin/python{{PythonVersion}} -u -m venv --clear --upgrade-deps \\\"{{$FullBaseDir}}venv\\\"\"",
"SkipOnFailure": false
},
{
"UpdateStageName": "Create Virtual Environment",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "cmd.exe",
"UpdateSourceArgs": "/C where py >NUL 2>&1 || (echo Error: Python launcher \"py\" is not installed for all users on this system or is not in the System PATH. & echo See https://discourse.cubecoders.com/t/python-app-runner-guide/7420#p-15668-h-12-windows-4 & exit /b 1) & py -{{PythonVersion}} --version >NUL 2>&1 || (echo Error: Python {{PythonVersion}} is not installed for all users on this system. & echo See https://discourse.cubecoders.com/t/python-app-runner-guide/7420#p-15668-h-12-windows-4 & exit /b 1) & py -{{PythonVersion}} -u -m venv --clear --upgrade-deps \"{{$FullBaseDir}}venv\"",
"SkipOnFailure": false
},
{
"UpdateStageName": "Install Basic Python Packages",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"source \\\"{{$FullBaseDir}}venv/bin/activate\\\" && python3 -u -m pip install -U setuptools wheel discord.py python-dotenv\"",
"SkipOnFailure": false
},
{
"UpdateStageName": "Install Basic Python Packages",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "cmd.exe",
"UpdateSourceArgs": "/C \"{{$FullBaseDir}}venv\\Scripts\\activate.bat\" && python.exe -u -m pip install -U setuptools wheel discord.py python-dotenv",
"SkipOnFailure": false
},
{
"UpdateStageName": "App Download",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"source \\\"{{$FullBaseDir}}venv/bin/activate\\\" && python3 -u -m pip install -U {{DownloadPackageArgs}} {{DownloadSource}}\"",
"UpdateSourceConditionSetting": "DownloadType",
"UpdateSourceConditionValue": "PyPIPackage",
"SkipOnFailure": false
},
{
"UpdateStageName": "App Download",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "cmd.exe",
"UpdateSourceArgs": "/C \"{{$FullBaseDir}}venv\\Scripts\\activate.bat\" && python.exe -u -m pip install -U {{DownloadPackageArgs}} {{DownloadSource}}",
"UpdateSourceConditionSetting": "DownloadType",
"UpdateSourceConditionValue": "PyPIPackage",
"SkipOnFailure": false
},
{
"UpdateStageName": "Install Additional Python Packages",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"cd \\\"{{$FullBaseDir}}\\\" && source ./venv/bin/activate && python3 -u -m pip install -U -r ./{{AppDir}}/requirements.txt\"",
"UpdateSourceConditionSetting": "PackagesInstallType",
"UpdateSourceConditionValue": "file",
"SkipOnFailure": false
},
{
"UpdateStageName": "Install Additional Python Packages",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "cmd.exe",
"UpdateSourceArgs": "/C cd \"{{$FullBaseDir}}\" && venv\\Scripts\\activate.bat && python.exe -u -m pip install -U -r .\\{{AppDir}}\\requirements.txt",
"UpdateSourceConditionSetting": "PackagesInstallType",
"UpdateSourceConditionValue": "file",
"SkipOnFailure": false
},
{
"UpdateStageName": "Install Additional Python Packages",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"source \\\"{{$FullBaseDir}}venv/bin/activate\\\" && python3 -u -m pip install -U {{PythonPackages}}\"",
"UpdateSourceConditionSetting": "PackagesInstallType",
"UpdateSourceConditionValue": "specifier",
"SkipOnFailure": false
},
{
"UpdateStageName": "Install Additional Python Packages",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "cmd.exe",
"UpdateSourceArgs": "/C \"{{$FullBaseDir}}venv\\Scripts\\activate.bat\" && python.exe -u -m pip install -U {{PythonPackages}}",
"UpdateSourceConditionSetting": "PackagesInstallType",
"UpdateSourceConditionValue": "specifier",
"SkipOnFailure": false
},
{
"UpdateStageName": "Run App Setup Command",
"UpdateSourcePlatform": "Linux",
"UpdateSource": "Executable",
"UpdateSourceData": "/bin/bash",
"UpdateSourceArgs": "-c \"cd \\\"{{$FullBaseDir}}\\\" && source ./venv/bin/activate && {{AppSetupCommand}}\"",
"UpdateSourceConditionSetting": "RunAppSetupCommand",
"UpdateSourceConditionValue": "true",
"SkipOnFailure": false
},
{
"UpdateStageName": "Run App Setup Command",
"UpdateSourcePlatform": "Windows",
"UpdateSource": "Executable",
"UpdateSourceData": "cmd.exe",
"UpdateSourceArgs": "/C cd \"{{$FullBaseDir}}\" && venv\\Scripts\\activate.bat && {{AppSetupCommand}}",
"UpdateSourceConditionSetting": "RunAppSetupCommand",
"UpdateSourceConditionValue": "true",
"SkipOnFailure": false
}
]