serverkit-mise 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +32 -10
- data/lib/serverkit/mise/version.rb +1 -1
- data/lib/serverkit/resources/mise_use.rb +7 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45ba8d94900cc5cfb660c79c771cd7f54dc10f148d58cfec905d7bc5e4aa224c
|
4
|
+
data.tar.gz: 328b8341f1856421f3c1b070ad506535bcbb3a2c928b3a6f5ae8dc6dd03f99b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f06c7abd57467656360b691599841b1f70879a4e347d060e1ccfb7d92643dc67b2ee511485bda140897a2078e697faccd8819293e4651a9553f1c1291562f92
|
7
|
+
data.tar.gz: 04b300d341bf6fa87279a49d3a2eb196e46e5eb91016d8cd00e7acda20c73d2f8d8142aca1f71beee32f895fd6aae820f230f8507a2da7d0cfd752d7d082eb38
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[](https://github.com/serverkit/serverkit-mise/actions/workflows/test.yml)
|
2
|
+
[](https://badge.fury.io/rb/serverkit-mise)
|
2
3
|
|
3
4
|
# serverkit-mise
|
4
5
|
|
@@ -6,21 +7,40 @@
|
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
bundle add serverkit-mise
|
10
|
+
```rb
|
11
|
+
# Gemfile
|
12
|
+
gem "serverkit-mise"
|
13
13
|
```
|
14
14
|
|
15
|
-
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
### Prerequisites
|
18
|
+
|
19
|
+
- Ensure you have [serverkit](https://github.com/serverkit/serverkit) gem installed
|
20
|
+
- Ensure you have [mise](https://github.com/jdx/mise) installed on your system
|
16
21
|
|
17
|
-
|
18
|
-
|
22
|
+
### Basic Example
|
23
|
+
|
24
|
+
Create a recipe file that uses the mise resources:
|
25
|
+
|
26
|
+
```yaml
|
27
|
+
# recipe.yml
|
28
|
+
resources:
|
29
|
+
# Install Node.js using mise
|
30
|
+
- type: mise_install
|
31
|
+
name: node
|
32
|
+
version: 20.10.0
|
33
|
+
# Install Ruby and set it as global
|
34
|
+
- type: mise_use
|
35
|
+
name: ruby
|
36
|
+
version: 3.3.0
|
19
37
|
```
|
20
38
|
|
21
|
-
|
39
|
+
Then apply your recipe with Serverkit:
|
22
40
|
|
23
|
-
|
41
|
+
```console
|
42
|
+
$ serverkit apply recipe.yml
|
43
|
+
```
|
24
44
|
|
25
45
|
## Resource
|
26
46
|
|
@@ -51,7 +71,8 @@ Install specified tool and add the version to `mise.yml`.
|
|
51
71
|
#### Attributes
|
52
72
|
|
53
73
|
- `name` - tool name (required)
|
54
|
-
- `version` - tool version (optional)
|
74
|
+
- `version` - tool version (optional, if not specified, the latest version will be installed)
|
75
|
+
- `global` - global option (optional, default: `true`)
|
55
76
|
|
56
77
|
#### Example
|
57
78
|
|
@@ -60,6 +81,7 @@ resources:
|
|
60
81
|
- type: mise_use
|
61
82
|
name: go
|
62
83
|
version: '1.23'
|
84
|
+
global: false
|
63
85
|
- type: mise_use
|
64
86
|
name: ruby
|
65
87
|
```
|
@@ -7,18 +7,17 @@ module Serverkit
|
|
7
7
|
class MiseUse < Base
|
8
8
|
attribute :name, required: true, type: String
|
9
9
|
attribute :version, type: String
|
10
|
-
|
11
|
-
attribute :global, type: [TrueClass, FalseClass] # , default: true
|
10
|
+
attribute :global, type: [TrueClass, FalseClass], default: true
|
12
11
|
|
13
12
|
# @note Override
|
14
13
|
def apply
|
15
|
-
run_command("mise use
|
14
|
+
run_command("mise use #{global_option} #{name_with_version}")
|
16
15
|
end
|
17
16
|
|
18
17
|
# @note Override
|
19
18
|
def check
|
20
19
|
cmd = if global
|
21
|
-
"mise ls --
|
20
|
+
"mise ls --cd $HOME #{name} | grep '#{version_or_latest}'"
|
22
21
|
else
|
23
22
|
"mise ls --current #{name} | grep '#{version_or_latest}'"
|
24
23
|
end
|
@@ -42,13 +41,14 @@ module Serverkit
|
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
44
|
+
# @return [String]
|
45
45
|
def version_or_latest
|
46
46
|
version || "latest"
|
47
47
|
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
def global_option
|
50
|
+
"--global" if global
|
51
|
+
end
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverkit-mise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toshimaru
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 1.0.0
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
25
|
+
version: 1.0.0
|
26
26
|
description: Serverkit plug-in for mise.
|
27
27
|
email:
|
28
28
|
- me@toshimaru.net
|
@@ -53,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
53
|
requirements:
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
56
|
+
version: 2.7.0
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|