knife-ionoscloud 5.0.0.beta.1 → 5.0.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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +20 -0
  3. data/.github/workflows/publish.yml +25 -14
  4. data/README.md +81 -0
  5. data/docs/README.md +33 -18
  6. data/docs/changelog.md +2 -1
  7. data/docs/subcommands/backupunit_create.md +11 -8
  8. data/docs/subcommands/backupunit_delete.md +11 -8
  9. data/docs/subcommands/backupunit_list.md +11 -8
  10. data/docs/subcommands/backupunit_ssourl.md +13 -10
  11. data/docs/subcommands/composite_server_create.md +12 -9
  12. data/docs/subcommands/contract_list.md +11 -8
  13. data/docs/subcommands/datacenter_create.md +14 -10
  14. data/docs/subcommands/datacenter_delete.md +11 -8
  15. data/docs/subcommands/datacenter_list.md +11 -8
  16. data/docs/subcommands/firewall_create.md +14 -11
  17. data/docs/subcommands/firewall_delete.md +14 -11
  18. data/docs/subcommands/firewall_list.md +14 -11
  19. data/docs/subcommands/group_create.md +11 -8
  20. data/docs/subcommands/group_delete.md +11 -8
  21. data/docs/subcommands/group_get.md +12 -9
  22. data/docs/subcommands/group_list.md +11 -8
  23. data/docs/subcommands/group_user_add.md +12 -9
  24. data/docs/subcommands/group_user_remove.md +12 -9
  25. data/docs/subcommands/image_list.md +11 -8
  26. data/docs/subcommands/ipblock_create.md +12 -9
  27. data/docs/subcommands/ipblock_delete.md +11 -8
  28. data/docs/subcommands/ipblock_list.md +11 -8
  29. data/docs/subcommands/ipfailover_add.md +15 -12
  30. data/docs/subcommands/ipfailover_remove.md +14 -11
  31. data/docs/subcommands/k8s_create.md +11 -8
  32. data/docs/subcommands/k8s_delete.md +11 -8
  33. data/docs/subcommands/k8s_list.md +11 -8
  34. data/docs/subcommands/kubeconfig_get.md +12 -9
  35. data/docs/subcommands/label_add.md +12 -9
  36. data/docs/subcommands/label_list.md +11 -8
  37. data/docs/subcommands/label_remove.md +12 -9
  38. data/docs/subcommands/lan_create.md +12 -9
  39. data/docs/subcommands/lan_delete.md +12 -9
  40. data/docs/subcommands/lan_list.md +12 -9
  41. data/docs/subcommands/loadbalancer_create.md +12 -9
  42. data/docs/subcommands/loadbalancer_delete.md +12 -9
  43. data/docs/subcommands/loadbalancer_get.md +13 -10
  44. data/docs/subcommands/loadbalancer_list.md +12 -9
  45. data/docs/subcommands/loadbalancer_nic_add.md +13 -10
  46. data/docs/subcommands/loadbalancer_nic_remove.md +13 -10
  47. data/docs/subcommands/location_list.md +11 -8
  48. data/docs/subcommands/nic_create.md +14 -12
  49. data/docs/subcommands/nic_delete.md +13 -10
  50. data/docs/subcommands/nic_list.md +13 -10
  51. data/docs/subcommands/node_delete.md +13 -10
  52. data/docs/subcommands/node_list.md +13 -10
  53. data/docs/subcommands/node_replace.md +14 -11
  54. data/docs/subcommands/nodepool_create.md +19 -16
  55. data/docs/subcommands/nodepool_delete.md +12 -9
  56. data/docs/subcommands/nodepool_list.md +12 -9
  57. data/docs/subcommands/pcc_create.md +11 -8
  58. data/docs/subcommands/pcc_delete.md +11 -8
  59. data/docs/subcommands/pcc_list.md +11 -8
  60. data/docs/subcommands/request_list.md +12 -9
  61. data/docs/subcommands/request_status.md +12 -9
  62. data/docs/subcommands/request_wait.md +12 -9
  63. data/docs/subcommands/resource_list.md +11 -10
  64. data/docs/subcommands/s3key_create.md +12 -9
  65. data/docs/subcommands/s3key_delete.md +12 -9
  66. data/docs/subcommands/s3key_list.md +12 -9
  67. data/docs/subcommands/server_create.md +13 -10
  68. data/docs/subcommands/server_delete.md +13 -10
  69. data/docs/subcommands/server_list.md +12 -9
  70. data/docs/subcommands/server_reboot.md +12 -9
  71. data/docs/subcommands/server_start.md +13 -10
  72. data/docs/subcommands/server_stop.md +12 -9
  73. data/docs/subcommands/share_create.md +13 -10
  74. data/docs/subcommands/share_delete.md +12 -9
  75. data/docs/subcommands/share_list.md +12 -9
  76. data/docs/subcommands/snapshot_create.md +13 -10
  77. data/docs/subcommands/snapshot_delete.md +11 -8
  78. data/docs/subcommands/snapshot_list.md +11 -8
  79. data/docs/subcommands/snapshot_restore.md +14 -11
  80. data/docs/subcommands/user_create.md +12 -10
  81. data/docs/subcommands/user_delete.md +11 -8
  82. data/docs/subcommands/user_list.md +12 -9
  83. data/docs/subcommands/user_ssourl.md +12 -9
  84. data/docs/subcommands/volume_attach.md +13 -10
  85. data/docs/subcommands/volume_create.md +12 -9
  86. data/docs/subcommands/volume_delete.md +12 -9
  87. data/docs/subcommands/volume_detach.md +13 -10
  88. data/docs/subcommands/volume_list.md +12 -9
  89. data/docs/summary.md +1 -0
  90. data/git-versioning.sh +113 -0
  91. data/lib/knife-ionoscloud/version.rb +1 -1
  92. data/sonar-project.properties +12 -0
  93. metadata +8 -4
data/docs/summary.md CHANGED
@@ -87,3 +87,4 @@
87
87
  * [VolumeDelete](subcommands/volume_delete.md)
88
88
  * [VolumeDetach](subcommands/volume_detach.md)
89
89
  * [VolumeList](subcommands/volume_list.md)
90
+
data/git-versioning.sh ADDED
@@ -0,0 +1,113 @@
1
+ #!/bin/sh
2
+
3
+ version="${1}"
4
+ old_version="${2}"
5
+
6
+ committer_name=${COMMITTER_NAME:-"IONOS Cloud CLI Robot"}
7
+ committer_email=${COMMITTER_EMAIL:-"sdk@cloud.ionos.com"}
8
+
9
+ function usage() {
10
+ echo "usage: ionosctl <version>"
11
+ }
12
+
13
+ function error() {
14
+ echo "! ERROR: ${1}"
15
+ }
16
+
17
+ function warning() {
18
+ echo "! WARNING: ${1}"
19
+ }
20
+
21
+ function info() {
22
+ echo "~ ${1}"
23
+ }
24
+
25
+ function debug() {
26
+ echo ">> $1"
27
+ }
28
+
29
+ function get_major() {
30
+ local ret=$(echo "${1}" | cut -d '.' -f 1)
31
+ local first_char=$(echo "${ret}" | cut -c1-1)
32
+ if [ "${first_char}" = "v" ]; then
33
+ # strip the v from the major component
34
+ ret=$(echo "${ret}" | cut -c2-100)
35
+ fi
36
+ echo "${ret}"
37
+ }
38
+
39
+ function get_minor() {
40
+ echo $(echo "${1}" | cut -d '.' -f 2)
41
+ }
42
+
43
+ if [ "${version}" = "" ]; then
44
+ error "version not specified"
45
+ usage
46
+ exit 1
47
+ fi
48
+
49
+ if [ "${old_version}" = "" ]; then
50
+ error "old version not specified"
51
+ usage
52
+ exit 1
53
+ fi
54
+
55
+ major=$(get_major "${version}")
56
+ if [ "${major}" = "" ]; then
57
+ error "cannot compute major version from ${version}"
58
+ exit 1
59
+ fi
60
+
61
+ minor=$(get_minor "${version}")
62
+ if [ "${minor}" = "" ]; then
63
+ error "cannot compute minor version from ${version}"
64
+ exit 1
65
+ fi
66
+
67
+ info "using git committer name: ${committer_name}"
68
+ info "using git committer email: ${committer_email}"
69
+
70
+ # setting up committer info
71
+ git config --local user.name "${committer_name}" >/dev/null || exit 1
72
+ git config --local user.email ${committer_email} >/dev/null || exit 1
73
+
74
+ git config --local pull.rebase false
75
+
76
+ # we don't need to spam stdout with useless info :)
77
+ git config --local advice.detachedHead false
78
+
79
+ # check if we have a new major or minor
80
+ info "new version is: ${version}"
81
+ info "found new version: $(git tag --list "v*" --sort=refname | tail -n 1)"
82
+
83
+ info "old version is: ${old_version}"
84
+ info "found older version: $(git tag --list "v*" --sort=refname | tail -n 2 | head -n 1)"
85
+
86
+ info "checking if we have a new major or minor version ..."
87
+ if [ "${old_version}" != "" ]; then
88
+ old_major=$(get_major "${old_version}")
89
+ old_minor=$(get_minor "${old_version}")
90
+ info "old major: ${old_major} / old minor: is ${old_minor} / current major: ${major} / current minor: ${minor}"
91
+ if [ "${old_major}" != "" -a "${old_minor}" != "" ]; then
92
+ if [ "${old_major}" != "${major}" -o "${old_minor}" != "${minor}" ]; then
93
+ # create release branch for old version from the old version tag
94
+ branch_name="release/${old_major}.${old_minor}.x"
95
+ git branch -a | grep ${branch_name}
96
+ if [ "$?" = "0" ]; then
97
+ warning "a release branch ${branch_name} already exists"
98
+ else
99
+ info "creating a new release branch: ${branch_name}"
100
+ git checkout ${old_version} >/dev/null || exit 1
101
+ git checkout -b "${branch_name}" >/dev/null || exit 1
102
+ git push -u origin ${branch_name} >/dev/null || exit 1
103
+ git checkout ${version} >/dev/null || exit 1
104
+ fi
105
+ else
106
+ info "no new release branch needed"
107
+ fi
108
+ else
109
+ info "could not compute old major or old minor versions"
110
+ fi
111
+ else
112
+ info "no older versions found"
113
+ fi
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Ionoscloud
3
- VERSION = '5.0.0.beta.1'
3
+ VERSION = '5.0.0'
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  end
@@ -0,0 +1,12 @@
1
+ sonar.projectKey=knife-plugin
2
+ sonar.organization=ionos-cloud
3
+
4
+ # This is the name and version displayed in the SonarCloud UI.
5
+ #sonar.projectName=knife-plugin
6
+ #sonar.projectVersion=1.0
7
+
8
+ # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
9
+ #sonar.sources=.
10
+
11
+ # Encoding of the source code. Default is default system encoding
12
+ #sonar.sourceEncoding=UTF-8
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-ionoscloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.beta.1
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - IONOS Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -83,12 +83,14 @@ files:
83
83
  - ".github/ISSUE_TEMPLATE/bug_report.md"
84
84
  - ".github/ISSUE_TEMPLATE/config.yml"
85
85
  - ".github/ISSUE_TEMPLATE/feature_request.md"
86
+ - ".github/workflows/build.yml"
86
87
  - ".github/workflows/ci.yml"
87
88
  - ".github/workflows/publish.yml"
88
89
  - ".gitignore"
89
90
  - ".rubocop.yml"
90
91
  - Gemfile
91
92
  - LICENSE.txt
93
+ - README.md
92
94
  - Rakefile
93
95
  - docs/README.md
94
96
  - docs/changelog.md
@@ -178,6 +180,7 @@ files:
178
180
  - docs/summary.md
179
181
  - docs/templates/subcommand_doc.mustache
180
182
  - docs/templates/summary.mustache
183
+ - git-versioning.sh
181
184
  - knife-ionoscloud.gemspec
182
185
  - lib/chef/knife/ionoscloud_backupunit_create.rb
183
186
  - lib/chef/knife/ionoscloud_backupunit_delete.rb
@@ -263,6 +266,7 @@ files:
263
266
  - lib/chef/knife/ionoscloud_volume_detach.rb
264
267
  - lib/chef/knife/ionoscloud_volume_list.rb
265
268
  - lib/knife-ionoscloud/version.rb
269
+ - sonar-project.properties
266
270
  - spec/chef/knife/ionoscloud_backupunit_create_spec.rb
267
271
  - spec/chef/knife/ionoscloud_backupunit_delete_spec.rb
268
272
  - spec/chef/knife/ionoscloud_backupunit_list_spec.rb
@@ -364,9 +368,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
364
368
  version: '0'
365
369
  required_rubygems_version: !ruby/object:Gem::Requirement
366
370
  requirements:
367
- - - ">"
371
+ - - ">="
368
372
  - !ruby/object:Gem::Version
369
- version: 1.3.1
373
+ version: '0'
370
374
  requirements: []
371
375
  rubygems_version: 3.1.4
372
376
  signing_key: