-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpsakefile.ps1
More file actions
39 lines (33 loc) · 1.41 KB
/
psakefile.ps1
File metadata and controls
39 lines (33 loc) · 1.41 KB
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
Task Publish -Depends Pack {
Exec { docker login docker.io --username=tiksn }
$remoteTag = "docker.io/$script:latestImageTag"
Exec { docker tag $script:latestImageTag $remoteTag }
Exec { docker push $remoteTag }
}
Task Pack -Depends Build {
$src = (Resolve-Path ".\src\").Path
Exec { docker build -f Dockerfile $src -t $script:latestImageTag }
}
Task Build -Depends TranspileModels {
$script:publishFolder = Join-Path -Path $script:trashFolder -ChildPath "publish"
New-Item -Path $script:publishFolder -ItemType Directory
$project = Resolve-Path ".\src\IdentityManagementService.csproj"
$project = $project.Path
Exec { dotnet publish $project --output $script:publishFolder }
}
Task TranspileModels -Depends Init,Clean {
$apiModelYaml = (Resolve-Path ".\src\ApiModels.yml").Path
$apiModelOutput = Join-Path -Path ".\src\Models" -ChildPath "ApiModels"
Exec { smite --input-file $apiModelYaml --lang csharp --field property --output-folder $apiModelOutput }
}
Task Clean -Depends Init {
}
Task Init {
$date = Get-Date
$ticks = $date.Ticks
$script:latestImageTag = "tiksn/lionize-identity-management-service:latest"
$trashFolder = Join-Path -Path . -ChildPath ".trash"
$script:trashFolder = Join-Path -Path $trashFolder -ChildPath $ticks.ToString("D19")
New-Item -Path $script:trashFolder -ItemType Directory
$script:trashFolder = Resolve-Path -Path $script:trashFolder
}