Skip to content

Commit b61b1ea

Browse files
justindbaurwithinfocus
andauthoredJul 8, 2024
Devcontainer Improvements (bitwarden#4466)
* Optionally Run `docker-compose` * Use Traversal Projects Over Solution Files * Cleanup VSCode Tasks * Bind DataProtection Keys to Host - Makes it so the container can be rebuilt without corrupting data * Update .vscode/tasks.json Co-authored-by: Matt Bishop <[email protected]> --------- Co-authored-by: Matt Bishop <[email protected]>
1 parent 25cf611 commit b61b1ea

File tree

9 files changed

+52
-284
lines changed

9 files changed

+52
-284
lines changed
 

‎.devcontainer/community_dev/devcontainer.json

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
"dockerComposeFile": "../../.devcontainer/bitwarden_common/docker-compose.yml",
44
"service": "bitwarden_server",
55
"workspaceFolder": "/workspace",
6+
"mounts": [
7+
{
8+
"source": "../../dev/.data/keys",
9+
"target": "/home/vscode/.aspnet/DataProtection-Keys",
10+
"type": "bind"
11+
}
12+
],
613
"customizations": {
714
"vscode": {
815
"settings": {},

‎.devcontainer/internal_dev/devcontainer.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
"dockerComposeFile": [
44
"../../.devcontainer/bitwarden_common/docker-compose.yml",
55
"../../.devcontainer/internal_dev/docker-compose.override.yml"
6-
], "service": "bitwarden_server",
6+
],
7+
"service": "bitwarden_server",
78
"workspaceFolder": "/workspace",
9+
"mounts": [
10+
{
11+
"source": "../../dev/.data/keys",
12+
"target": "/home/vscode/.aspnet/DataProtection-Keys",
13+
"type": "bind"
14+
}
15+
],
816
"customizations": {
917
"vscode": {
1018
"settings": {},

‎.vscode/tasks.json

+18-15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"tasks": [
44
{
55
"label": "buildIdentityApi",
6+
"hide": true,
67
"dependsOrder": "sequence",
78
"dependsOn": [
89
"buildIdentity",
@@ -14,6 +15,7 @@
1415
},
1516
{
1617
"label": "buildIdentityApiAdmin",
18+
"hide": true,
1719
"dependsOrder": "sequence",
1820
"dependsOn": [
1921
"buildIdentity",
@@ -26,6 +28,7 @@
2628
},
2729
{
2830
"label": "buildFullServer",
31+
"hide": true,
2932
"dependsOrder": "sequence",
3033
"dependsOn": [
3134
"buildAdmin",
@@ -40,6 +43,7 @@
4043
},
4144
{
4245
"label": "buildSelfHostBit",
46+
"hide": true,
4347
"dependsOrder": "sequence",
4448
"dependsOn": [
4549
"buildAdmin",
@@ -52,6 +56,7 @@
5256
},
5357
{
5458
"label": "buildSelfHostOss",
59+
"hide": true,
5560
"dependsOrder": "sequence",
5661
"dependsOn": [
5762
"buildAdmin",
@@ -62,6 +67,7 @@
6267
},
6368
{
6469
"label": "buildIcons",
70+
"hide": true,
6571
"command": "dotnet",
6672
"type": "process",
6773
"args": [
@@ -74,6 +80,7 @@
7480
},
7581
{
7682
"label": "buildPortal",
83+
"hide": true,
7784
"command": "dotnet",
7885
"type": "process",
7986
"args": [
@@ -86,6 +93,7 @@
8693
},
8794
{
8895
"label": "buildSso",
96+
"hide": true,
8997
"command": "dotnet",
9098
"type": "process",
9199
"args": [
@@ -98,6 +106,7 @@
98106
},
99107
{
100108
"label": "buildEvents",
109+
"hide": true,
101110
"command": "dotnet",
102111
"type": "process",
103112
"args": [
@@ -110,6 +119,7 @@
110119
},
111120
{
112121
"label": "buildEventsProcessor",
122+
"hide": true,
113123
"command": "dotnet",
114124
"type": "process",
115125
"args": [
@@ -122,6 +132,7 @@
122132
},
123133
{
124134
"label": "buildAdmin",
135+
"hide": true,
125136
"command": "dotnet",
126137
"type": "process",
127138
"args": [
@@ -134,6 +145,7 @@
134145
},
135146
{
136147
"label": "buildIdentity",
148+
"hide": true,
137149
"command": "dotnet",
138150
"type": "process",
139151
"args": [
@@ -146,6 +158,7 @@
146158
},
147159
{
148160
"label": "buildAPI",
161+
"hide": true,
149162
"command": "dotnet",
150163
"type": "process",
151164
"args": [
@@ -162,6 +175,7 @@
162175
},
163176
{
164177
"label": "buildNotifications",
178+
"hide": true,
165179
"command": "dotnet",
166180
"type": "process",
167181
"args": [
@@ -178,6 +192,7 @@
178192
},
179193
{
180194
"label": "buildBilling",
195+
"hide": true,
181196
"command": "dotnet",
182197
"type": "process",
183198
"args": [
@@ -192,20 +207,6 @@
192207
"isDefault": true
193208
}
194209
},
195-
{
196-
"label": "clean",
197-
"type": "shell",
198-
"command": "dotnet clean",
199-
"presentation": {
200-
"echo": true,
201-
"reveal": "always",
202-
"focus": false,
203-
"panel": "shared",
204-
"showReuseMessage": true,
205-
"clear": false
206-
},
207-
"problemMatcher": "$msCompile"
208-
},
209210
{
210211
"label": "test",
211212
"type": "shell",
@@ -225,13 +226,15 @@
225226
"problemMatcher": "$msCompile"
226227
},
227228
{
228-
"label": "Setup Secrets",
229+
"label": "Set Up Secrets",
230+
"detail": "A task to run setup_secrets.ps1",
229231
"type": "shell",
230232
"command": "pwsh -WorkingDirectory ${workspaceFolder}/dev -Command '${workspaceFolder}/dev/setup_secrets.ps1 -clear:$${input:setupSecretsClear}'",
231233
"problemMatcher": []
232234
},
233235
{
234236
"label": "Install Dev Cert",
237+
"detail": "A task to install the Bitwarden developer cert to run your local install as an admin.",
235238
"type": "shell",
236239
"command": "dotnet tool install -g dotnet-certificate-tool -g && certificate-tool add --file ${workspaceFolder}/dev/dev.pfx --password '${input:certPassword}'",
237240
"problemMatcher": []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project Sdk="Microsoft.Build.Traversal">
2+
<ItemGroup>
3+
<ProjectReference Include="**\*.*proj" />
4+
</ItemGroup>
5+
</Project>

‎bitwarden_license/test/bitwarden_license.tests.sln

-37
This file was deleted.

‎dev/ef_migrate.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ $service = "mysql"
99

1010
Write-Output "--- Attempting to start $service service ---"
1111

12-
docker-compose --profile $service up -d --no-recreate
12+
# Attempt to start mysql but if docker-compose doesn't
13+
# exist just trust that the user has it running some other way
14+
if (command -v docker-compose) {
15+
docker-compose --profile $service up -d --no-recreate
16+
}
1317

1418
dotnet tool restore
1519

‎global.json

+3
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"sdk": {
33
"version": "8.0.100",
44
"rollForward": "latestFeature"
5+
},
6+
"msbuild-sdks": {
7+
"Microsoft.Build.Traversal": "4.1.0"
58
}
69
}

‎test/Bitwarden.Tests.proj

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project Sdk="Microsoft.Build.Traversal">
2+
<ItemGroup>
3+
<ProjectReference Include="**\*.*proj" />
4+
</ItemGroup>
5+
</Project>

‎test/bitwarden.tests.sln

-230
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.