mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* Remove lots of refs to iron and funcy oracle etc.. * more ref replacements * Replacing more refs. Treeder * Use Fn not FN
39 lines
1016 B
PowerShell
39 lines
1016 B
PowerShell
# Build script for PowerShell
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$cmd = $args[0]
|
|
Write-Host "cmd: $cmd"
|
|
|
|
|
|
function quick() {
|
|
try {
|
|
go build
|
|
if (-not $?) {
|
|
Write-Host "build failed!" # WTH, error handling in powershell sucks
|
|
exit
|
|
}
|
|
} catch {
|
|
# This try/catch thing doesn't work, the above if statement does work though
|
|
Write-Host "build failed 2!"
|
|
exit
|
|
}
|
|
./functions
|
|
}
|
|
|
|
function build () {
|
|
docker run --rm -v ${pwd}:/go/src/github.com/fnproject/functions -w /go/src/github.com/fnproject/functions golang:alpine go build -o functions-alpine
|
|
docker build -t fnproject/functions:latest .
|
|
}
|
|
|
|
function run () {
|
|
docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -e LOG_LEVEL=debug -e "DB_URL=sqlite3:///app/data/fn.db" -v $PWD/data:/app/data -p 8080:8080 fnproject/functions
|
|
}
|
|
|
|
switch ($cmd)
|
|
{
|
|
"quick" {quick}
|
|
"build" { build }
|
|
"run" {run}
|
|
default {"Invalid command: $cmd"}
|
|
}
|