Skip to content

Commit 71c5bd3

Browse files
committed
feat(make): add Make feature
1 parent 38a49df commit 71c5bd3

File tree

11 files changed

+112
-0
lines changed

11 files changed

+112
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
"docker-out",
2121
"git-lfs",
2222
"go",
23+
"make",
2324
"node",
2425
"vault-cli",
2526
"zig"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Below is a list with included features, click on the link for more details.
2020
| [docker-out](./features/src/docker-out/README.md) | A feature which installs the Docker client and re-uses the host socket. |
2121
| [git-lfs](./features/src/git-lfs/README.md) | A feature which installs Git LFS. |
2222
| [go](./features/src/go/README.md) | A feature which installs Go. |
23+
| [make](./features/src/make/README.md) | A feature which installs GNU Make. |
2324
| [node](./features/src/node/README.md) | A package which installs Node.js. |
2425
| [vault-cli](./features/src/vault-cli/README.md) | A feature which installs the Vault CLI. |
2526
| [zig](./features/src/zig/README.md) | A feature which installs Zig. |

build/build.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var featureList = []string{
2525
"docker-out",
2626
"git-lfs",
2727
"go",
28+
"make",
2829
"node",
2930
"vault-cli",
3031
"zig",
@@ -107,6 +108,17 @@ func init() {
107108
return publishFeature("go")
108109
})
109110

111+
////////// make
112+
gotaskr.Task("Feature:make:Package", func() error {
113+
return packageFeature("make")
114+
})
115+
gotaskr.Task("Feature:make:Test", func() error {
116+
return testFeature("make")
117+
})
118+
gotaskr.Task("Feature:make:Publish", func() error {
119+
return publishFeature("make")
120+
})
121+
110122
////////// node
111123
gotaskr.Task("Feature:node:Package", func() error {
112124
return packageFeature("node")

features/src/make/NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Notes
2+
3+
### System Compatibility
4+
5+
Debian, Ubuntu

features/src/make/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Make (make)
2+
3+
A package which installs Make.
4+
5+
## Example Usage
6+
7+
```json
8+
"features": {
9+
"ghcr.io/postfinance/devcontainer-features/make:0.1.0": {
10+
}
11+
}
12+
```
13+
14+
## Notes
15+
16+
### System Compatibility
17+
18+
Debian, Ubuntu
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "make",
3+
"version": "0.1.0",
4+
"name": "Make",
5+
"description": "A package which installs Make."
6+
}

features/src/make/install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
. ./functions.sh
2+
3+
"./installer_$(detect_arch)"

features/src/make/installer.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package main
2+
3+
import (
4+
"builder/installer"
5+
"fmt"
6+
"os"
7+
8+
"github.com/roemer/gover"
9+
)
10+
11+
//////////
12+
// Main
13+
//////////
14+
15+
func main() {
16+
if err := runMain(); err != nil {
17+
fmt.Printf("Error: %v\n", err)
18+
os.Exit(1)
19+
}
20+
}
21+
22+
func runMain() error {
23+
// Create and process the feature
24+
feature := installer.NewFeature("Make", true,
25+
&makeComponent{
26+
ComponentBase: installer.NewComponentBase("Make", installer.VERSION_SYSTEM_DEFAULT),
27+
})
28+
return feature.Process()
29+
}
30+
31+
//////////
32+
// Implementation
33+
//////////
34+
35+
type makeComponent struct {
36+
*installer.ComponentBase
37+
}
38+
39+
func (c *makeComponent) InstallVersion(version *gover.Version) error {
40+
return installer.Tools.Apt.InstallDependencies("make")
41+
}

features/test/make/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
[[ -f "$(dirname "$0")/../functions.sh" ]] && source "$(dirname "$0")/../functions.sh"
5+
[[ -f "$(dirname "$0")/functions.sh" ]] && source "$(dirname "$0")/functions.sh"
6+
7+
check_command_exists "make"

features/test/make/scenarios.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"install": {
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"options": [
6+
"--add-host=host.docker.internal:host-gateway"
7+
]
8+
},
9+
"features": {
10+
"./make": {}
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)