Skip to content

Commit b003d8d

Browse files
committed
use configuration: release candidate ready
1 parent 0c82a08 commit b003d8d

14 files changed

+663
-139
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build Docker Server Launcher
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
# Step 1: Checkout the repository
15+
- name: Checkout Code
16+
uses: actions/checkout@v3
17+
18+
# Step 2: Set up .NET SDK
19+
- name: Set up .NET SDK
20+
uses: actions/setup-dotnet@v3
21+
with:
22+
dotnet-version: 7.0.x # Replace with the desired .NET version
23+
24+
# Step 3: Create a temporary project to compile the .cs file
25+
- name: Create Temporary Project
26+
run: |
27+
mkdir temp
28+
dotnet new console --output temp --name docker-server-launcher
29+
mv ./docker-server-launcher.cs ./temp/Program.cs
30+
31+
# Step 4: Compile to a self-contained Windows executable
32+
- name: Build Executable
33+
run: |
34+
dotnet publish ./temp/docker-server-launcher.csproj `
35+
-r win-x64 `
36+
--self-contained true `
37+
/p:OutputType=WinExe `
38+
/p:Configuration=Release `
39+
-o ./output
40+
41+
# Step 5: Archive the executable as a repository artifact
42+
- name: Archive Build Output
43+
uses: actions/upload-artifact@v3
44+
with:
45+
name: vanderstack-docker-server
46+
path: ./output
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Delete GitHub Artifact
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
artifact_id:
7+
description: 'ID of the artifact to delete'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
delete-artifact:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Delete selected artifact
17+
uses: actions/github-script@v6
18+
with:
19+
script: |
20+
const response = await github.rest.actions.listArtifactsForRepo({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo
23+
});
24+
25+
const artifactId = '${{ inputs.artifact_id }}';
26+
const artifactToDelete = response.data.artifacts.find(artifact => artifact.id == artifactId);
27+
28+
if (artifactToDelete) {
29+
console.log(`Deleting artifact: ID: ${artifactToDelete.id}, Workflow: ${artifactToDelete.workflow_run.head_branch}, SHA: Workflow: ${artifactToDelete.workflow_run.head_sha}, Created: ${artifactToDelete.created_at}, Download: ${artifactToDelete.archive_download_url}`);
30+
31+
await github.rest.actions.deleteArtifact({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
artifact_id: artifactToDelete.id
35+
});
36+
37+
console.log(`Artifact deleted successfully.`);
38+
39+
console.log('Remaining artifacts:');
40+
response.data.artifacts.filter(artifact => artifact.id != artifactId).forEach(artifact => {
41+
console.log(`ID: ${artifact.id}, Workflow: ${artifact.workflow_run.head_branch}, SHA: Workflow: ${artifact.workflow_run.head_sha}, Created: ${artifact.created_at}, Download: ${artifact.archive_download_url}`);
42+
});
43+
44+
} else {
45+
console.log(`Artifact with ID "${artifactId}" not found.`);
46+
47+
if (response.data.artifacts.length > 0) {
48+
const artifacts = response.data.artifacts;
49+
console.log('Artifacts found:');
50+
artifacts.forEach(artifact => {
51+
console.log(`ID: ${artifact.id}, Workflow: ${artifact.workflow_run.head_branch}, SHA: Workflow: ${artifact.workflow_run.head_sha}, Created: ${artifact.created_at}, Download: ${artifact.archive_download_url}`);
52+
});
53+
}
54+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: List GitHub Artifacts
2+
3+
on:
4+
workflow_dispatch: # Triggered manually
5+
6+
jobs:
7+
list-artifacts:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: List all artifacts
12+
uses: actions/github-script@v6
13+
with:
14+
script: |
15+
const response = await github.rest.actions.listArtifactsForRepo({
16+
owner: context.repo.owner,
17+
repo: context.repo.repo
18+
});
19+
20+
if (response.data.artifacts.length > 0) {
21+
const artifacts = response.data.artifacts;
22+
console.log('Artifacts found:');
23+
artifacts.forEach(artifact => {
24+
console.log(`ID: ${artifact.id}, Workflow: ${artifact.workflow_run.head_branch}, SHA: Workflow: ${artifact.workflow_run.head_sha}, Created: ${artifact.created_at}, Download: ${artifact.archive_download_url}`);
25+
});
26+
} else {
27+
console.log('No artifacts found.');
28+
}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Exclude executables and ISOs such as:
2+
# example.exe
3+
# alpine-docker-v3.20-x86_64.iso
4+
*.exe
5+
*.iso
6+
7+
# Exclude custom configuration
8+
config.json
9+
10+
# Include example configuration
11+
!config.example.json

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
1. install VirtualBox
2-
2. Use `vanderstack/Alpine-Docker-ISO/` to obtain Alpine docker server ISO
3-
4. locate VBoxManage.exe
4-
5. configure and run `create-docker-vm.ps1`
5-
6. Use `Manage Advanced Sharing Settings` to enable network sharing
6-
7. configure and run `create-user-and-share.ps1`
7-
8. Build VM launcher `csc /target:winexe /out:vanderstack-docker-server.exe vanderstack-docker-server.cs`
8-
9. configure and run `schedule-start-server.ps1`
2+
2. Use `Manage Advanced Sharing Settings` to enable File and printer sharing and for all networks enable password protected sharing
3+
3. Use `Publish ISO` action from `vanderstack/Alpine-Docker-ISO/` to obtain Alpine docker server ISO
4+
4. Create `config.json` from `config.example.json` with desired configuration
5+
5. Run `create-docker-vm.ps1`
6+
6. Run `create-user-and-share.ps1`
7+
7. Build `docker-server-launcher.exe` using the Github Action `Build Docker Server Launcher`
8+
8. Run `schedule-docker-server-launcher.ps1`
99

1010
Todo:
1111
add tailscale
1212
add obsidian
1313
add n8n
14+
create AI similar to do browser
1415
add portainer
1516
add retroarch
1617
add media server

config.example.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"create-docker-vm": {
3+
"VBoxManage": "C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe",
4+
"VMFolder": "C:\\docker-server",
5+
"VMName": "docker-server",
6+
"VMMemory": 2048,
7+
"VMCPUs": 2,
8+
"VMDiskSize": 20000,
9+
"OSType": "linux_64",
10+
"ISOPath": "alpine-docker-v3.20-x86_64.iso"
11+
},
12+
"create-user-and-share": {
13+
"username": "docker-share-user",
14+
"password": "",
15+
"sharePath": "C:\\docker-server\\share",
16+
"shareName": "docker-server-share$"
17+
},
18+
"delete-share": {
19+
"sharePath": "C:\\docker-server\\share"
20+
},
21+
"delete-user": {
22+
"username": "docker-share-user"
23+
},
24+
"docker-server-launcher": {
25+
"VBoxManage": "C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe",
26+
"VMName": "docker-server"
27+
},
28+
"schedule-docker-server-launcher": {
29+
"taskName": "DockerServer",
30+
"taskDescription": "Run Docker Server on system boot",
31+
"exePath": "C:\\docker-server\\docker-server-launcher.exe",
32+
"exeArguments": ""
33+
},
34+
"unschedule-docker-server-launcher": {
35+
"taskName": "DockerServer"
36+
}
37+
}

0 commit comments

Comments
 (0)