civo_cli 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b547957f2d531e61809da88d07b4e67e0822f8b950585a7ca6837b42c038a736
4
- data.tar.gz: d42ce8e7b56a75affd123b8d233ae24c502177143b1db08c324e1680031e7690
3
+ metadata.gz: 81e7ed8f71461ca37d64781e74c4f0af20928710a09786450b1c3d453dc4b15d
4
+ data.tar.gz: dfda2e2d015a3ba6b03c6b706c96bf294fa72ca21f8ba689695ae9f2db46abf6
5
5
  SHA512:
6
- metadata.gz: 3e47da3fbcde79faae12e110e0118d57d0a6f927f9e06ba2ba542c8b231b35d03e44ce7f69a09cbbbff7eaf53b17a540c0fb374e588687d0cbe18833a8ad66cf
7
- data.tar.gz: a3cb039260a20a553eb971ce0fbc206862e5c866e3c9b272f9700e71149099680843302712506dd9e2a53f6619046779d336e73f28e0dccd20b8eff095d44750
6
+ metadata.gz: d517214d9db059b213825f810b49a1b4bd156f78b0e98589a2957ece959bb0d403662c436cca6c320a69335a2db3a1df92aaaddd4c46d5587bd0921186ccfc34
7
+ data.tar.gz: 4668d099d3d6d470eb6dc5451961dfe0a1c80e7aece59a37613df8d3592c2bb29285417e2bcafa908710d54997f7352f1fc2642c3862502458d5934e1534ca5c
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@ All notable changes to the Civo CLI will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [0.5.7] - 2019-12-04
7
+ ### Changed
8
+ - Set a minimum version of activesupport to fix https://github.com/civo/cli/issues/51 (thanks to Dr Nic Williams for the bug report)
9
+
6
10
  ## [0.5.6] - 2019-11-13
7
11
  ### Added
8
12
  - Support for not installing default applications using `--remove-applications` during k3s cluster creation
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- civo_cli (0.5.6)
4
+ civo_cli (0.5.7)
5
+ activesupport (>= 6.0.0)
5
6
  bundler (>= 1.17)
6
7
  civo (>= 1.2.9)
7
8
  colorize
@@ -32,7 +33,7 @@ GEM
32
33
  crack (0.4.3)
33
34
  safe_yaml (~> 1.0.0)
34
35
  diff-lcs (1.3)
35
- faraday (0.17.0)
36
+ faraday (0.17.1)
36
37
  multipart-post (>= 1.2, < 3)
37
38
  ffi (1.11.1)
38
39
  flexirest (1.8.6)
@@ -116,7 +117,7 @@ GEM
116
117
  addressable (>= 2.3.6)
117
118
  crack (>= 0.3.2)
118
119
  hashdiff (>= 0.4.0, < 2.0.0)
119
- zeitwerk (2.2.1)
120
+ zeitwerk (2.2.2)
120
121
 
121
122
  PLATFORMS
122
123
  ruby
data/README.md CHANGED
@@ -7,7 +7,8 @@ Civo CLI is a tool to manage your [Civo.com](https://www.civo.com) account from
7
7
 
8
8
  ## Table of contents
9
9
  - [Introduction](#introduction)
10
- - [Set-Up](#set-up)
10
+ - [Set-Up](#set-up)
11
+ - [Docker Usage](#docker-usage)
11
12
  - [API Keys](#api-keys)
12
13
  - [Instances](#instances)
13
14
  - [Kubernetes clusters](#kubernetes-clusters)
@@ -46,13 +47,34 @@ To run the tool, simply run `civo` with your chosen options. You can find contex
46
47
  `civo instance help create`
47
48
  and so on. The main components of Civo CLI are outlined in the following sections.
48
49
 
50
+ ## Docker Usage
51
+ Civo's CLI utilty can also run within a Docker container, which avoids the need to maintain a Ruby environment on the main system.
52
+
53
+ To run, you generally will want to map the API key for presistence.
54
+
55
+ ```
56
+ touch $HOME/.civo.json
57
+ docker run -it --rm -v $HOME/.civo.json:/home/user/.civo.json civo/cli:latest
58
+ ```
59
+
60
+ To make usage easier, an alias is recommended. Here's an example how to set one to the same command as would be used if installed directly on the system, and using the Docker image:
61
+
62
+ ```
63
+ alias civo="docker run -it --rm -v $HOME/.civo.json:/home/user/.civo.json civo/cli:latest"
64
+ # Maybe put the above line in ~/.bash_profile or ~/.zshrc
65
+ civo sshkey list
66
+ civo instance list
67
+ civo instance create --size g2.xsmall
68
+ civo k8s list
69
+ ```
70
+
49
71
  ## API Keys
50
72
  #### Introduction
51
- In order to use the command-line tool, you will need to authenticate yourself to the Civo API using a special key. You can find an automatically-generated API key or regenerate a new key at [https://www.civo.com/api](https://www.civo.com/api).
73
+ In order to use the command-line tool, you will need to authenticate yourself to the Civo API using a special key. You can find an automatically-generated API key or regenerate a new key at [https://www.civo.com/api](https://www.civo.com/api).
52
74
 
53
75
  #### Adding a current API Key to your account
54
76
  You can add the API Key to the CLI tool through the API Keys command.
55
- `civo apikey add apikey_name apikey` such as:
77
+ `civo apikey add apikey_name apikey` such as:
56
78
 
57
79
  ```
58
80
  $ civo apikey add Demo_Test_Key DAb75oyqVeaE7BI6Aa74FaRSP0E2tMZXkDWLC9wNQdcpGfH51r
@@ -63,7 +85,7 @@ As you can have multiple API keys stored to handle multiple accounts, you will n
63
85
  $ civo apikey current Demo_Test_Key
64
86
  The current API Key is now Demo_Test_Key
65
87
  ```
66
- #### Managing and listing API keys
88
+ #### Managing and listing API keys
67
89
  You can list all stored API keys in your configuration by invoking `civo apikey list` or remove one by name by using `civo apikey remove apikey_name`.
68
90
 
69
91
  ## Instances
@@ -107,7 +129,7 @@ $ civo instance show api-demo.test
107
129
 
108
130
  ----------------------------- NOTES -----------------------------
109
131
 
110
-
132
+
111
133
  ```
112
134
 
113
135
  You will be able to see the instance's details by running `civo instance show api-demo.test` as above.
@@ -234,7 +256,7 @@ Provided you have room in your Civo quota, you can upgrade any instance up in si
234
256
  ```
235
257
  $ civo instance upgrade api-demo-renamed.test g2.medium
236
258
  Resizing api-demo-renamed.test to g2.medium. Use 'civo instance show api-demo-renamed.test' to see the current status.
237
-
259
+
238
260
  $ civo instance show api-demo-renamed.test
239
261
  ID : 715f95d1-3cee-4a3c-8759-f9b49eec34c4
240
262
  Hostname : api-demo-renamed.test
@@ -279,6 +301,7 @@ You can create an instance by running `civo kubernetes create` with a cluster na
279
301
 
280
302
  * `size` - The size of nodes to create, from the current list of sizes available at [`civo sizes`](#sizes). Defaults to `g2.medium`.
281
303
  * `nodes` - The number of nodes to create (the master also acts as a node).
304
+ * `version` - the `k3s` version to use on the cluster. Defaults to the latest.
282
305
  * `wait` - a simple flag (e.g. `--wait`) that will cause the CLI to spin and wait for the cluster to be `ACTIVE`.
283
306
  * `save` - a flag used in conjunction with `--wait` (i.e. `--wait --save`) to save the configuration to your local `~/.kube/config` file.
284
307
 
@@ -314,6 +337,13 @@ civo kubernetes rename my-first-cluster --name="Production"
314
337
  Kubernetes cluster my-first-cluster is now named Production
315
338
  ```
316
339
 
340
+ #### Starting a cluster without default applications
341
+ By default, `traefik` is bundled in with `k3s` to act as the ingress controller. If you want to set up a cluster without `traefik`, you can use the `remove-applications` option in the creation command to start a cluster without it:
342
+
343
+ ```
344
+ civo kubernetes create --remove-applications=traefik --nodes=2 --wait --save
345
+ ```
346
+
317
347
  #### Removing the cluster
318
348
  If you're completely finished with a cluster you can delete it with:
319
349
 
@@ -447,7 +477,7 @@ $ civo domainrecord create civoclidemo.xyz mx 10.0.0.1 -p=10 -t=1000
447
477
 
448
478
  #<Civo::DnsRecord id: "2079e6e1-0633-4cd0-b883-e82a8991a91a", created_at: "2019-06-17 12:38:02", updated_at: "2019-06-17 12:38:02", account_id: nil, domain_id: "418181b2-fcd2-46a2-ba7f-c843c331e79b", name: "@", value: "10.0.0.1", type: "mx", priority: 10, ttl: 1000, ETag: "187cf7e849ce53336a889b2bde7ed061", Status: 200>
449
479
  Created MX record civoclidemo.xyz for civoclidemo.xyz with a TTL of 1000 seconds and with a priority of 10 with ID 2079e6e1-0633-4cd0-b883-e82a8991a91a
450
- ```
480
+ ```
451
481
  #### Listing DNS Records
452
482
  You can get an overview of all records you have created for a particular domain by requesting `civo domainrecord list domain.name`:
453
483
  ```
@@ -482,7 +512,7 @@ You will then be able to **configure rules** that allow connections to and from
482
512
  * `start_port` - The starting port that the rule applies to. Required.
483
513
  * `end_port` - The end of the port range that the rule applies to. Optional; if not specified, the rule will only apply to `start_port` specified.
484
514
  * `protocol` - The protocol for the rule (`TCP, UDP, ICMP`). If not provided, defaults to `TCP`.
485
- * `cidr` - The IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR. Defaults to being globally applied, i.e. `0.0.0.0/0`.
515
+ * `cidr` - The IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR. Defaults to being globally applied, i.e. `0.0.0.0/0`.
486
516
  * `direction` - Will this rule affect `inbound` or `outbound` traffic? Defaults to `inbound`.
487
517
  * `label` - A label for your own reference for this rule. Optional.
488
518
 
@@ -521,7 +551,7 @@ You can remove a firewall rule simply by calling `civo firewall delete_rule fire
521
551
  ```
522
552
  $ civo firewall delete_rule 09f8d85b-0cf1-4dcf-a472-ba247fb4be21 4070f87b-e6c6-4208-91c5-fc4bc72c1587
523
553
  Removed Firewall rule 4070f87b-e6c6-4208-91c5-fc4bc72c1587
524
-
554
+
525
555
  $ civo firewall list_rules 09f8d85b-0cf1-4dcf-a472-ba247fb4be21
526
556
  +-------+----------+------------+----------+------+-------+
527
557
  | Firewall rules for 09f8d85b-0cf1-4dcf-a472-ba247fb4be21 |
@@ -565,7 +595,7 @@ Removed the network cli-demo with ID 74b69006-ea59-46a0-96c4-63f5bfa290e1
565
595
 
566
596
  ## Load Balancers
567
597
  #### Introduction
568
- Civo supports load balancing for your instances, allowing you to spread web traffic between them to maximise availability. You can view details about load balancers you may have running, create new oness, update information and even remove them from the command line.
598
+ Civo supports load balancing for your instances, allowing you to spread web traffic between them to maximise availability. You can view details about load balancers you may have running, create new oness, update information and even remove them from the command line.
569
599
 
570
600
  #### Viewing Load Balancers
571
601
  You can list currently-active load balancers by calling `civo loadbalancer list`. This will draw a table detailing the unique ID, hostname, protocol, port, TLS certificate information, backend check path and connection information.
@@ -742,7 +772,7 @@ Detailed information about a template can be obtained via the CLI using `civo te
742
772
  #### Creating a Template
743
773
  You can convert a **bootable** Volume (virtual disk) of an instance, or alternatively use an existing image ID, to create a template. The options for the `civo template create` command are:
744
774
  ```
745
- Options:
775
+ Options:
746
776
  -c, [--cloud-init-file=CLOUD_INIT_FILENAME] # The filename of a file to be used as user-data/cloud-init
747
777
  -d, [--description=DESCRIPTION] # A full/long multiline description (optional)
748
778
  -i, [--image-id=IMAGE_ID] # The glance ID of the base filesystem image
data/civo_cli.gemspec CHANGED
@@ -51,4 +51,5 @@ Gem::Specification.new do |spec|
51
51
  spec.add_runtime_dependency "bundler", ">= 1.17"
52
52
  spec.add_runtime_dependency 'civo', ">= 1.2.9"
53
53
  spec.add_runtime_dependency 'json'
54
+ spec.add_runtime_dependency 'activesupport', ">= 6.0.0"
54
55
  end
data/docker/Dockerfile ADDED
@@ -0,0 +1,5 @@
1
+ FROM ruby:alpine
2
+ MAINTAINER Steve Miller <me@r15cookie.com>
3
+ RUN gem install civo_cli
4
+ RUN adduser -S user
5
+ USER user
data/docker/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # Civo CLI in Docker
2
+
3
+ Build a Docker container embedded with the latest `civo` command. Note that it does NOT yet build from source;
4
+ it simply pulls the latest Civo CLI from RubyGems. Usage is in the main repo's README. The Docker that builds
5
+ from source is a work in progress and available at https://github.com/ssmiller25/cli/tree/dockerbuild
6
+
7
+ ## Pushing to Civo's official DockerHub
8
+
9
+ For Civo staff only: from the cloned repository, build it with the current version and "latest" tags:
10
+
11
+ ```
12
+ docker build -t civo/cli:latest -f docker/Dockerfile .
13
+ docker build -t civo/cli:0.x.y -f docker/Dockerfile .
14
+ ```
15
+
16
+ Then after running `docker login` to authenticate to the Civo organisation you can do:
17
+
18
+ ```
19
+ docker push civo/cli:latest
20
+ docker push civo/cli:0.x.y
21
+ ```
data/lib/apikey.rb CHANGED
@@ -21,14 +21,16 @@ module CivoCLI
21
21
  def add(name, key)
22
22
  CivoCLI::Config.set_apikey(name, key)
23
23
  puts "Saved the API Key #{key.colorize(:green)} as #{name.colorize(:green)}"
24
+ current(name)
24
25
  end
25
26
 
26
27
  desc "remove NAME", "Remove the API Key with a label of 'NAME'"
27
28
  def remove(name)
28
- keys = CivoCLI::Config.get_apikeys
29
+ keys = CivoCLI::Config.get_apikeys
29
30
  if keys.keys.include?(name)
30
31
  CivoCLI::Config.delete_apikey(name)
31
32
  puts "Removed the API Key #{name.colorize(:green)}"
33
+ current(nil)
32
34
  else
33
35
  puts "The API Key #{name.colorize(:red)} couldn't be found."
34
36
  exit 1
@@ -37,9 +39,12 @@ module CivoCLI
37
39
  map "delete" => "remove", "rm" => "remove"
38
40
 
39
41
  desc "current [NAME]", "Either return the name of the current API key or set the current key to be the one with a label of 'NAME'"
40
- def current(name=nil)
41
- if name.nil?
42
- puts "The current API Key is #{CivoCLI::Config.get_current_apikey_name.colorize(:green)}"
42
+ def current(name = nil)
43
+ currentkey = CivoCLI::Config.get_current_apikey_name
44
+ if name.nil? && currentkey
45
+ puts "The current API Key is #{currentkey.colorize(:green)}"
46
+ elsif name.nil? && !currentkey
47
+ puts "No current API Key set".colorize(:red)
43
48
  else
44
49
  keys = CivoCLI::Config.get_apikeys
45
50
  if keys.keys.include?(name)
@@ -1,3 +1,3 @@
1
1
  module CivoCLI
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: civo_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-11-13 00:00:00.000000000 Z
13
+ date: 2019-12-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -180,6 +180,20 @@ dependencies:
180
180
  - - ">="
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
+ - !ruby/object:Gem::Dependency
184
+ name: activesupport
185
+ requirement: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: 6.0.0
190
+ type: :runtime
191
+ prerelease: false
192
+ version_requirements: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: 6.0.0
183
197
  description: The official command line client for interacting with Civo's API
184
198
  email:
185
199
  - andy@civo.com
@@ -203,6 +217,8 @@ files:
203
217
  - bin/console
204
218
  - bin/setup
205
219
  - civo_cli.gemspec
220
+ - docker/Dockerfile
221
+ - docker/README.md
206
222
  - exe/civo
207
223
  - lib/apikey.rb
208
224
  - lib/ask_service.rb