@toa.io/cli 1.0.0-alpha.59 → 1.0.0-alpha.61

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/cli",
3
- "version": "1.0.0-alpha.59",
3
+ "version": "1.0.0-alpha.61",
4
4
  "description": "Toa CLI",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -25,8 +25,8 @@
25
25
  "@toa.io/console": "1.0.0-alpha.59",
26
26
  "@toa.io/generic": "1.0.0-alpha.59",
27
27
  "@toa.io/kubernetes": "1.0.0-alpha.59",
28
- "@toa.io/norm": "1.0.0-alpha.59",
29
- "@toa.io/operations": "1.0.0-alpha.59",
28
+ "@toa.io/norm": "1.0.0-alpha.61",
29
+ "@toa.io/operations": "1.0.0-alpha.61",
30
30
  "@toa.io/yaml": "1.0.0-alpha.59",
31
31
  "dotenv": "16.1.1",
32
32
  "find-up": "5.0.0",
@@ -34,5 +34,5 @@
34
34
  "paseto": "3.1.4",
35
35
  "yargs": "17.6.2"
36
36
  },
37
- "gitHead": "157e7fa2e26f4612bbb7848c420f4c21746e5bfd"
37
+ "gitHead": "25e32ccba495a1f7197e378a5208cfc1a6b3b8a1"
38
38
  }
package/readme.md CHANGED
@@ -83,6 +83,16 @@ Credentials specified in the output file are preserved.
83
83
  </dd>
84
84
  </dl>
85
85
 
86
+ ### export image tags
87
+
88
+ <dl>
89
+ <dt><code>toa export tags &lt;environment&gt;</code></dt>
90
+ <dd>Print image tags.
91
+
92
+ <code>--path</code> path to context (default <code>.</code>)<br/>
93
+ </dd>
94
+ </dl>
95
+
86
96
  ## Operations
87
97
 
88
98
  > Some commands use current `kubectl` and `docker` context.
@@ -0,0 +1,23 @@
1
+ 'use strict'
2
+
3
+ const { tags } = require('../../handlers/export/tags')
4
+
5
+ const builder = (yargs) => {
6
+ yargs
7
+ .positional('environment', {
8
+ type: 'string',
9
+ desc: 'Deployment environment'
10
+ })
11
+ .option('path', {
12
+ alias: 'p',
13
+ group: 'Command options:',
14
+ type: 'string',
15
+ desc: 'Path to context',
16
+ default: '.'
17
+ })
18
+ }
19
+
20
+ exports.command = ['tags <environment>']
21
+ exports.desc = 'Export image tags'
22
+ exports.builder = builder
23
+ exports.handler = tags
@@ -5,7 +5,7 @@ const { context: find } = require('../../util/find')
5
5
  const { deployment: { Factory } } = require('@toa.io/operations')
6
6
 
7
7
  /**
8
- * @param {{ path: string, target: string, environment?: string }} argv
8
+ * @param {{ path: string, target: string, environment: string }} argv
9
9
  * @returns {Promise<void>}
10
10
  */
11
11
  const secrets = async (argv) => {
@@ -0,0 +1,21 @@
1
+ 'use strict'
2
+
3
+ const { console } = require('@toa.io/console')
4
+ const { context: find } = require('../../util/find')
5
+ const { deployment: { Factory } } = require('@toa.io/operations')
6
+
7
+ /**
8
+ * @param {{ path: string, target: string, environment: string }} argv
9
+ * @returns {Promise<void>}
10
+ */
11
+ const tags = async (argv) => {
12
+ const path = find(argv.path)
13
+ const factory = await Factory.create(path, argv.environment)
14
+ const operator = factory.operator()
15
+ const tags = operator.tags()
16
+
17
+ for (const tag of tags)
18
+ console.log(tag)
19
+ }
20
+
21
+ exports.tags = tags