-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInstall-Jurymatic.ps1
81 lines (55 loc) · 2.95 KB
/
Install-Jurymatic.ps1
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
<#
.NOTES
Script <> with <3 by @rasmuskriest
.SYNOPSIS
The final solution for creating jury booklets for events of the European Youth Parliament.
.DESCRIPTION
The final solution for creating jury booklets for events of the European Youth Parliament. This is script one out of two which sets up a new jurymatic instance.
.EXAMPLE
.\Install-Jurymatic.ps1
#>
#Requires -Version 3.0
Write-Output "Welcome to the jurymatic installer!
_ _ _
(_)_ _ _ __ _ _ _ __ ___ __ _| |_(_) ___
| | | | | '__| | | | '_ ` _ \ / _` | __| |/ __|
| | |_| | | | |_| | | | | | | (_| | |_| | (__
_/ |\__,_|_| \__, |_| |_| |_|\__,_|\__|_|\___|
|__/ |___/"
Write-Output "=============================="
Write-Output "This file will start the installation process."
Write-Output "=============================="
if (Get-Command py.exe -errorAction SilentlyContinue) {
py.exe $PSScriptRoot\get-pip.py
pip.exe install virtualenv
virtualenv $PSScriptRoot
Invoke-Expression .\Scripts\activate.ps1
pip.exe install -r requirements.txt
py.exe manage.py migrate
Write-Output "============================="
Write-Output "We are now going to create the administration user for the jurymatic server. Please remember the details you enter here. Only username and password are required fields."
Write-Output "============================="
py.exe manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '[email protected]', 'admin')"
Write-Output "============================="
Write-Output "Congratulations, you are done. You can now run start.bat or Start-Jurymatic.ps1 respectively and log into jurymatic with username 'admin' and password 'admin."
Write-Output "Please make sure to change the password after your first login."
Write-Output "============================="
Pause
}
else {
python.exe $PSScriptRoot\get-pip.py
pip.exe install virtualenv
virtualenv $PSScriptRoot
Invoke-Expression .\Scripts\activate.ps1
pip.exe install -r requirements.txt
python.exe manage.py migrate
Write-Output "============================="
Write-Output "We are now going to create the administration user for the jurymatic server. Please remember the details you enter here. Only username and password are required fields."
Write-Output "============================="
python.exe manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '[email protected]', 'admin')"
Write-Output "============================="
Write-Output "Congratulations, you are done. You can now run start.bat or Start-Jurymatic.ps1 respectively and log into jurymatic with username 'admin' and password 'admin."
Write-Output "Please make sure to change the password after your first login."
Write-Output "============================="
Pause
}