Skip to content

Commit ec772c7

Browse files
Itai GendlerItai Gendler
authored andcommitted
Add ability to filter images by tag
1 parent e81fd25 commit ec772c7

File tree

15 files changed

+95
-31
lines changed

15 files changed

+95
-31
lines changed

docs-template/content/contexts/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
title = "Contexts"
33
+++
44

5-
### [Update a context](update-a-context)
6-
`codefresh patch context`
7-
8-
Apply changes to a context
9-
105
### [Create a context](create-a-context)
116
`codefresh create context [type] [name]`
127

138
Create a context
149

10+
### [Update a context](update-a-context)
11+
`codefresh patch context`
12+
13+
Apply changes to a context
14+
1515
### [Delete a context](delete-a-context)
1616
`codefresh delete context [name]`
1717

docs-template/content/images/Get a single image.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Option | Default | Description
1818
--limit | 25 | Limit amount of returned results
1919
--all | | Return images from all possible registries (by default only r.cfcr.io images will be returned)
2020
--label | | Filter by a list of annotated labels
21+
--tag | | Filter by a list of tags
2122
--sha | | Filter by specific commit sha
2223
--image-name | | Filter by specific image name
2324
--branch | | Filter by specific branch

docs/authentication/create-authentication-context/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,31 @@
173173
<span>Contexts</span><i class="fa fa-angle-right fa-lg category-icon"></i>
174174
</a>
175175
<ul>
176+
<li data-nav-id="/contexts/create-a-context/" class="dd-item">
177+
<a href="/contexts/create-a-context/">
178+
<span>Create a context</span>
179+
</a>
180+
</li>
181+
<li data-nav-id="/contexts/delete-a-context/" class="dd-item">
182+
<a href="/contexts/delete-a-context/">
183+
<span>Delete a context</span>
184+
</a>
185+
</li>
186+
<li data-nav-id="/contexts/get-a-single-context/" class="dd-item">
187+
<a href="/contexts/get-a-single-context/">
188+
<span>Get a single context</span>
189+
</a>
190+
</li>
191+
<li data-nav-id="/contexts/replace-a-context/" class="dd-item">
192+
<a href="/contexts/replace-a-context/">
193+
<span>Replace a context</span>
194+
</a>
195+
</li>
196+
<li data-nav-id="/contexts/update-a-context/" class="dd-item">
197+
<a href="/contexts/update-a-context/">
198+
<span>Update a context</span>
199+
</a>
200+
</li>
176201
</ul>
177202
</li>
178203
<li data-nav-id="/environments/" class="dd-item">

docs/builds/get-a-single-build/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,16 @@
205205
<span>Environments</span><i class="fa fa-angle-right fa-lg category-icon"></i>
206206
</a>
207207
<ul>
208+
<li data-nav-id="/environments/delete-an-environment/" class="dd-item">
209+
<a href="/environments/delete-an-environment/">
210+
<span>Delete an environment</span>
211+
</a>
212+
</li>
213+
<li data-nav-id="/environments/get-a-single-composition/" class="dd-item">
214+
<a href="/environments/get-a-single-composition/">
215+
<span>Get a single composition</span>
216+
</a>
217+
</li>
208218
</ul>
209219
</li>
210220
<li data-nav-id="/images/" class="dd-item">

docs/contexts/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@
352352
<ul>
353353
<li>
354354
<ul>
355-
<li><a href="#update-a-context-update-a-context"><a href="update-a-context">Update a context</a></a></li>
356355
<li><a href="#create-a-context-create-a-context"><a href="create-a-context">Create a context</a></a></li>
356+
<li><a href="#update-a-context-update-a-context"><a href="update-a-context">Update a context</a></a></li>
357357
<li><a href="#delete-a-context-delete-a-context"><a href="delete-a-context">Delete a context</a></a></li>
358358
<li><a href="#get-a-single-context-get-a-single-context"><a href="get-a-single-context">Get a single context</a></a></li>
359359
<li><a href="#replace-a-context-replace-a-context"><a href="replace-a-context">Replace a context</a></a></li>
@@ -381,18 +381,18 @@ <h1>Contexts</h1>
381381

382382

383383

384-
<h3 id="update-a-context-update-a-context"><a href="update-a-context">Update a context</a></h3>
385-
386-
<p><code>codefresh patch context</code></p>
387-
388-
<p>Apply changes to a context</p>
389-
390384
<h3 id="create-a-context-create-a-context"><a href="create-a-context">Create a context</a></h3>
391385

392386
<p><code>codefresh create context [type] [name]</code></p>
393387

394388
<p>Create a context</p>
395389

390+
<h3 id="update-a-context-update-a-context"><a href="update-a-context">Update a context</a></h3>
391+
392+
<p><code>codefresh patch context</code></p>
393+
394+
<p>Apply changes to a context</p>
395+
396396
<h3 id="delete-a-context-delete-a-context"><a href="delete-a-context">Delete a context</a></h3>
397397

398398
<p><code>codefresh delete context [name]</code></p>

docs/images/get-a-single-image/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,12 @@ <h3 id="options">Options</h3>
439439
<td>Filter by a list of annotated labels</td>
440440
</tr>
441441

442+
<tr>
443+
<td>&ndash;tag</td>
444+
<td></td>
445+
<td>Filter by a list of tags</td>
446+
</tr>
447+
442448
<tr>
443449
<td>&ndash;sha</td>
444450
<td></td>

docs/index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"title": "Contexts",
9696
"tags": [],
9797
"description": "",
98-
"content": " Update a context codefresh patch context\nApply changes to a context\nCreate a context codefresh create context [type] [name]\nCreate a context\nDelete a context codefresh delete context [name]\nDelete a context\nGet a single context codefresh get contexts [name]\nGet a specific or an array of contexts\nReplace a context codefresh replace context\nReplace a context\n"
98+
"content": " Create a context codefresh create context [type] [name]\nCreate a context\nUpdate a context codefresh patch context\nApply changes to a context\nDelete a context codefresh delete context [name]\nDelete a context\nGet a single context codefresh get contexts [name]\nGet a specific or an array of contexts\nReplace a context codefresh replace context\nReplace a context\n"
9999
},
100100
{
101101
"uri": "http://cli.codefresh.io/compositions/create-a-composition/",
@@ -200,7 +200,7 @@
200200
"title": "Get a single image",
201201
"tags": [],
202202
"description": "",
203-
"content": " Command codefresh get images [id]\nGet a specific or an array of images\nPositionals Option Default Description id image id Options Option Default Description \u0026ndash;limit 25 Limit amount of returned results \u0026ndash;all Return images from all possible registries (by default only r.cfcr.io images will be returned) \u0026ndash;label Filter by a list of annotated labels \u0026ndash;sha Filter by specific commit sha \u0026ndash;image-name Filter by specific image name \u0026ndash;branch Filter by specific branch \u0026ndash;page 1 Paginated page "
203+
"content": " Command codefresh get images [id]\nGet a specific or an array of images\nPositionals Option Default Description id image id Options Option Default Description \u0026ndash;limit 25 Limit amount of returned results \u0026ndash;all Return images from all possible registries (by default only r.cfcr.io images will be returned) \u0026ndash;label Filter by a list of annotated labels \u0026ndash;tag Filter by a list of tags \u0026ndash;sha Filter by specific commit sha \u0026ndash;image-name Filter by specific image name \u0026ndash;branch Filter by specific branch \u0026ndash;page 1 Paginated page "
204204
},
205205
{
206206
"uri": "http://cli.codefresh.io/pipelines/get-a-single-pipeline/",

docs/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Positionals Option Default Description name context name Options O
231231
<guid>http://cli.codefresh.io/images/get-a-single-image/</guid>
232232
<description> Command codefresh get images [id]
233233
Get a specific or an array of images
234-
Positionals Option Default Description id image id Options Option Default Description &amp;ndash;limit 25 Limit amount of returned results &amp;ndash;all Return images from all possible registries (by default only r.cfcr.io images will be returned) &amp;ndash;label Filter by a list of annotated labels &amp;ndash;sha Filter by specific commit sha &amp;ndash;image-name Filter by specific image name &amp;ndash;branch Filter by specific branch &amp;ndash;page 1 Paginated page </description>
234+
Positionals Option Default Description id image id Options Option Default Description &amp;ndash;limit 25 Limit amount of returned results &amp;ndash;all Return images from all possible registries (by default only r.cfcr.io images will be returned) &amp;ndash;label Filter by a list of annotated labels &amp;ndash;tag Filter by a list of tags &amp;ndash;sha Filter by specific commit sha &amp;ndash;image-name Filter by specific image name &amp;ndash;branch Filter by specific branch &amp;ndash;page 1 Paginated page </description>
235235
</item>
236236

237237
<item>

docs/predefined-pipelines/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,21 @@
243243
<span>Pipelines</span><i class="fa fa-angle-right fa-lg category-icon"></i>
244244
</a>
245245
<ul>
246+
<li data-nav-id="/pipelines/execute-a-pipeline/" class="dd-item">
247+
<a href="/pipelines/execute-a-pipeline/">
248+
<span>Execute a pipeline</span>
249+
</a>
250+
</li>
251+
<li data-nav-id="/pipelines/get-a-single-pipeline/" class="dd-item">
252+
<a href="/pipelines/get-a-single-pipeline/">
253+
<span>Get a single pipeline</span>
254+
</a>
255+
</li>
256+
<li data-nav-id="/pipelines/update-a-single-pipeline/" class="dd-item">
257+
<a href="/pipelines/update-a-single-pipeline/">
258+
<span>Update a single pipeline</span>
259+
</a>
260+
</li>
246261
</ul>
247262
</li>
248263
<li data-nav-id="/predefined-pipelines/" class="dd-item parent active">

docs/predefined-pipelines/install-or-upgrade-a-helm-chart/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,19 @@
221221
<span>Images</span><i class="fa fa-angle-right fa-lg category-icon"></i>
222222
</a>
223223
<ul>
224-
<li data-nav-id="/images/annotate-an-image/" class="dd-item">
225-
<a href="/images/annotate-an-image/">
226-
<span>Annotate an image</span>
224+
<li data-nav-id="/predefined-pipelines/delete-a-helm-release/" class="dd-item">
225+
<a href="/predefined-pipelines/delete-a-helm-release/">
226+
<span>Delete a helm release</span>
227227
</a>
228228
</li>
229-
<li data-nav-id="/images/get-a-single-image/" class="dd-item">
230-
<a href="/images/get-a-single-image/">
231-
<span>Get a single image</span>
229+
<li data-nav-id="/predefined-pipelines/install-or-upgrade-a-helm-chart/" class="dd-item active">
230+
<a href="/predefined-pipelines/install-or-upgrade-a-helm-chart/">
231+
<span>Install or upgrade a Helm chart</span>
232232
</a>
233233
</li>
234-
<li data-nav-id="/images/tag-an-image/" class="dd-item">
235-
<a href="/images/tag-an-image/">
236-
<span>Tag an image</span>
234+
<li data-nav-id="/predefined-pipelines/test-a-helm-release/" class="dd-item">
235+
<a href="/predefined-pipelines/test-a-helm-release/">
236+
<span>Test a helm release</span>
237237
</a>
238238
</li>
239239
</ul>

examples/pipeline2-git.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
name: new-pipeline
2-
account: 59d33c4e9f75220a3710b2ee
1+
name: new-pipeline-git
32
metadata:
43
labels:
54
repo: github:ArikMaor/ping-server
@@ -9,7 +8,7 @@ spec:
98
repo: ArikMaor/ping-server
109
events: [push, pullrequest]
1110
branchRegex: '.'
12-
contexts: ['lala']
11+
contexts: []
1312
variables:
1413
- key: PORT
1514
value: 3000
@@ -19,6 +18,5 @@ spec:
1918
encrypted: true
2019
source:
2120
location: git
22-
repo: ArikMaor/ping-server
21+
repo: codefresh-io/cli
2322
path: codefresh.yml
24-

examples/pipeline2-url.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: new-pipeline-url
22
#account: 59d33c4e9f75220a3710b2ee
33
metadata:
44
labels:
5-
repo: github:ArikMaor/ping-server
5+
repo: github:codefresh-io/cli
66
spec:
77
triggers:
88
- type: scm

lib/interface/cli/commands/image/get.cmd.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ const command = new Command({
3838
alias: 'l',
3939
default: [],
4040
})
41+
.option('tag', {
42+
describe: 'Filter by a list of tags',
43+
alias: 't',
44+
type: Array,
45+
default: [],
46+
})
4147
.option('sha', {
4248
describe: 'Filter by specific commit sha',
4349
alias: 's',
@@ -58,6 +64,7 @@ const command = new Command({
5864
handler: async (argv) => {
5965
const imageId = argv.id;
6066
const labels = prepareKeyValueFromCLIEnvOption(argv.label);
67+
const tags = argv.tag;
6168
const sha = argv.sha;
6269
const limit = argv.limit;
6370
const type = argv.type;
@@ -80,6 +87,7 @@ const command = new Command({
8087
} else {
8188
images = await image.getAll({
8289
labels,
90+
tags,
8391
sha,
8492
limit,
8593
filterRegistries,

lib/logic/api/image.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const getAll = async (options) => {
6161
limit: options.limit,
6262
offset: options.offset,
6363
metadata: options.labels,
64+
tag: options.tags,
6465
type: options.type,
6566
branch: options.branch,
6667
imageDisplayNameRegex: options.imageName,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.7.5",
3+
"version": "0.7.6",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)