-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeploy.ps1
39 lines (24 loc) · 899 Bytes
/
Deploy.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
function RunAutomatedTests {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$tag
)
Write-Host "Build docker image for automated testing"
docker build . --pull --no-cache -t superservicetest:$tag --target test
Write-Host "Run automated tests in a container"
docker run -it --rm superservicetest:$tag
}
function BuildAndDeploy {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$tag
)
Write-Host "Build docker image with superservice"
docker build . --pull --no-cache -t superservice:$tag
Write-Host "Scan docker image for any vulnerabilities"
docker scan --file Dockerfile --exclude-base superservice:$tag
Write-Host "Run docker container - superservice"
docker run -it --rm -p 8080:8080 superservice:$tag
}