-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
158 lines (154 loc) · 9.83 KB
/
.gitlab-ci.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Windows Runner
.windows_runners:
# Used to select runners from the list of available runners. A runner must have all tags listed here to run the job.
tags:
- shared-windows
- windows
- windows-1809
# Groups jobs into stages. All jobs in one stage must complete before next stage is executed.
stages:
- sign
# Below is the definition of your job to sign file
sign-file:
# Define what stage the job will run in.
stage: sign
# Runner for Sign File on Windows
extends:
- .windows_runners
before_script:
# Create Install Dir
- New-Item -ItemType Directory -Force -Path C:\Users\gitlab_runner\Desktop\eSignerCKA
script:
# Download and Unzip eSignerCKA Setup
- Invoke-WebRequest -OutFile eSigner_CKA_Setup.zip "https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.7/SSL.COM-eSigner-CKA_1.0.7.zip"
- Expand-Archive -Force eSigner_CKA_Setup.zip
- Remove-Item eSigner_CKA_Setup.zip
- Move-Item -Destination "eSigner_CKA_Installer.exe" -Path "eSigner_CKA_*\*.exe"
# Setup eSignerCKA in Silent Mode
- Start-Process ".\eSigner_CKA_Installer.exe" -argumentlist '/CURRENTUSER /VERYSILENT /SUPPRESSMSGBOXES /DIR="C:\Users\gitlab_runner\Desktop\eSignerCKA"' -wait
# Check installation directory
- dir C:\Users\gitlab_runner\Desktop\eSignerCKA
# Check installation directory
- Get-ChildItem -Path C:\Users\gitlab_runner\Desktop\eSignerCKA
# Setup eSignerCKA Dependency
- Start-Process ".\setup\vc_redist.x86.exe" -argumentlist "/install /q" -wait
- Start-Process ".\setup\vc_redist.x64.exe" -argumentlist "/install /q" -wait
- Start-Process "C:\Users\gitlab_runner\Desktop\eSignerCKA\RegisterKSP.exe" -wait
- Start-Process "C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCSP.Config.exe" -wait
# Config Account Information on eSignerCKA
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe config -mode ${MODE} -user "${USERNAME}" -pass "${PASSWORD}" -totp "${TOTP_SECRET}" -key "C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA\master.key" -r
# Unload Certificate into Windows Store
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe unload
# Load Certificate into Windows Store
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe load
# Check data directory
- dir C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA
# Check config data directory
- dir C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA\Config
# Select Certificate From Windows Store
- $CodeSigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | WHERE { $_.subject -Match "Esigner" }; echo $CodeSigningCert.Thumbprint > .Thumbprint
# Debug Certificate Thumbprint
- Set-Variable -Name Thumbprint -Value (Get-Content .Thumbprint); echo $Thumbprint
# Sign Sample File with SignTool
- powershell.exe -ExecutionPolicy Bypass -Command "Set-Variable -Name Thumbprint -Value (Get-Content .Thumbprint); 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\signtool.exe sign /debug /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 $Thumbprint HelloWorld.dll'"
# Below is the definition of your job to sign file
sign-vsix:
# Define what stage the job will run in.
stage: sign
# Runner for Sign File on Windows
extends:
- .windows_runners
before_script:
# Create Install Dir
- New-Item -ItemType Directory -Force -Path C:\Users\gitlab_runner\Desktop\eSignerCKA
script:
# Download and Unzip eSignerCKA Setup
- Invoke-WebRequest -OutFile eSigner_CKA_Setup.zip "https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.7/SSL.COM-eSigner-CKA_1.0.7.zip"
- Expand-Archive -Force eSigner_CKA_Setup.zip
- Remove-Item eSigner_CKA_Setup.zip
- Move-Item -Destination "eSigner_CKA_Installer.exe" -Path "eSigner_CKA_*\*.exe"
# Setup eSignerCKA in Silent Mode
- Start-Process ".\eSigner_CKA_Installer.exe" -argumentlist '/CURRENTUSER /VERYSILENT /SUPPRESSMSGBOXES /DIR="C:\Users\gitlab_runner\Desktop\eSignerCKA"' -wait
# Check installation directory
- dir C:\Users\gitlab_runner\Desktop\eSignerCKA
# Check installation directory
- Get-ChildItem -Path C:\Users\gitlab_runner\Desktop\eSignerCKA
# Setup eSignerCKA Dependency
- Start-Process ".\setup\vc_redist.x86.exe" -argumentlist "/install /q" -wait
- Start-Process ".\setup\vc_redist.x64.exe" -argumentlist "/install /q" -wait
- Start-Process "C:\Users\gitlab_runner\Desktop\eSignerCKA\RegisterKSP.exe" -wait
- Start-Process "C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCSP.Config.exe" -wait
# Config Account Information on eSignerCKA
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe config -mode ${MODE} -user "${USERNAME}" -pass "${PASSWORD}" -totp "${TOTP_SECRET}" -key "C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA\master.key" -r
# Unload Certificate into Windows Store
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe unload
# Load Certificate into Windows Store
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe load
# Check data directory
- dir C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA
# Check config data directory
- dir C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA\Config
# Select Certificate From Windows Store
- $CodeSigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | WHERE { $_.subject -Match "Esigner" }; echo $CodeSigningCert.Thumbprint > .Thumbprint
# Debug Certificate Thumbprint
- Set-Variable -Name Thumbprint -Value (Get-Content .Thumbprint); echo $Thumbprint
# Install Dotnet Runtime 7.0
- choco install dotnet-runtime -y
# Install OpenVsixSignTool to Custom Location
- New-Item -ItemType Directory -Force -Path C:\Users\gitlab_runner\Desktop\dotnet-tools
- Invoke-WebRequest -OutFile OpenVsixSignTool.zip https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.4/OpenVsixSignTool_1.0.0-x86.zip
- Move-Item -Path OpenVsixSignTool.zip -Destination C:\Users\gitlab_runner\Desktop\dotnet-tools\OpenVsixSignTool.zip
- Expand-Archive -LiteralPath C:\Users\gitlab_runner\Desktop\dotnet-tools\OpenVsixSignTool.zip -DestinationPath C:\Users\gitlab_runner\Desktop\dotnet-tools -Force
# Sign Sample File with OpenVsixSignTool
- powershell.exe -ExecutionPolicy Bypass -Command 'Set-Variable -Name Thumbprint -Value (Get-Content .Thumbprint); C:\Users\gitlab_runner\Desktop\dotnet-tools\OpenVsixSignTool --roll-forward LatestMajor sign --sha1 $Thumbprint --timestamp http://ts.ssl.com -ta sha256 -fd sha256 "SSLcom.vsix"'
# Below is the definition of your job to sign file
sign-app:
# Define what stage the job will run in.
stage: sign
# Runner for Sign File on Windows
extends:
- .windows_runners
before_script:
# Create Install Dir
- New-Item -ItemType Directory -Force -Path C:\Users\gitlab_runner\Desktop\eSignerCKA
script:
# Speed up Download using Invoke-WebRequest
- $ErrorActionPreference = "SilentlyContinue"
- Set-Variable -Name Thumbprint -Value "SilentlyContinue"
# Download and Unzip eSignerCKA Setup
- Invoke-WebRequest -OutFile eSigner_CKA_Setup.zip "https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.7/SSL.COM-eSigner-CKA_1.0.7.zip"
- Expand-Archive -Force eSigner_CKA_Setup.zip
- Remove-Item eSigner_CKA_Setup.zip
- Move-Item -Destination "eSigner_CKA_Installer.exe" -Path "eSigner_CKA_*\*.exe"
# Download and Unzip Dynamics 365 Setup
- Invoke-WebRequest -OutFile Dynamics.365.BC.12841.US.DVD.zip "https://download.microsoft.com/download/3/e/7/3e71083e-6cd6-4598-a6bb-5c602b74aec3/Release/Dynamics.365.BC.12841.US.DVD.zip"
- Expand-Archive -Force Dynamics.365.BC.12841.US.DVD.zip
# Install Dynamics 365
- Start-Process ".\Dynamics.365.BC.12841.US.DVD\setup.exe" -argumentlist "/config .\Dynamics.365.BC.12841.US.DVD\Install-NavComponentConfig.xml /quiet" -wait
# Setup eSignerCKA in Silent Mode
- Start-Process ".\eSigner_CKA_Installer.exe" -argumentlist '/CURRENTUSER /VERYSILENT /SUPPRESSMSGBOXES /DIR="C:\Users\gitlab_runner\Desktop\eSignerCKA"' -wait
# Check installation directory
- dir C:\Users\gitlab_runner\Desktop\eSignerCKA
# Check installation directory
- Get-ChildItem -Path C:\Users\gitlab_runner\Desktop\eSignerCKA
# Setup eSignerCKA Dependency
- Start-Process ".\setup\vc_redist.x86.exe" -argumentlist "/install /q" -wait
- Start-Process ".\setup\vc_redist.x64.exe" -argumentlist "/install /q" -wait
- Start-Process "C:\Users\gitlab_runner\Desktop\eSignerCKA\RegisterKSP.exe" -wait
- Start-Process "C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCSP.Config.exe" -wait
# Config Account Information on eSignerCKA
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe config -mode ${MODE} -user "${USERNAME}" -pass "${PASSWORD}" -totp "${TOTP_SECRET}" -key "C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA\master.key" -r
# Unload Certificate into Windows Store
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe unload
# Load Certificate into Windows Store
- C:\Users\gitlab_runner\Desktop\eSignerCKA\eSignerCKATool.exe load
# Check data directory
- dir C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA
# Check config data directory
- dir C:\Users\gitlab_runner\AppData\Roaming\eSignerCKA\Config
# Select Certificate From Windows Store
- $CodeSigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | WHERE { $_.subject -Match "Esigner" }; echo $CodeSigningCert.Thumbprint > .Thumbprint
# Debug Certificate Thumbprint
- Set-Variable -Name Thumbprint -Value (Get-Content .Thumbprint); echo $Thumbprint
# Sign Sample File with SignTool
- powershell.exe -ExecutionPolicy Bypass -Command "Set-Variable -Name Thumbprint -Value (Get-Content .Thumbprint); 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\signtool.exe sign /debug /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 $Thumbprint HelloWorld.app'"