-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.ps1
executable file
·52 lines (36 loc) · 1.21 KB
/
install.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
if (Get-Command git -errorAction SilentlyContinue) {
if (Test-Path .git) {
git pull
}
else {
Write-Warning ".git directory missing, clone the repo using git to be able to update"
}
}
else {
Write-Warning "Install git to be able to fetch updates"
}
Write-Output "Installing scoop for dependency management"
if (! (Get-Command scoop -errorAction SilentlyContinue)) {
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
}
$env:Path = [System.Environment]::ExpandEnvironmentVariables([System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User"));
scoop bucket add main
scoop bucket add versions
Write-Output "Installing dependencies"
scoop install main/erlang@26.2.1
scoop install main/elixir@1.16.0
scoop install versions/nodejs20
scoop install main/pnpm
scoop install main/libvips
pnpm -C assets i
$env:NODE_ENV="production"
pnpm -C assets build
$env:MIX_ENV="prod"
$env:PHX_SERVER="true"
mix local.hex --force
mix local.rebar --force
mix deps.get --only prod
mix compile
mix phx.digest
Write-Output "Installation done!"