Skip to content

Commit e1961c8

Browse files
feat: add arm binary (#840)
## What ## Why ## Notes --------- Co-authored-by: yaroslav-codefresh <[email protected]>
1 parent a3dbb12 commit e1961c8

File tree

4 files changed

+63
-22
lines changed

4 files changed

+63
-22
lines changed

__mocks__/codefresh.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# More examples of Codefresh YAML can be found at
2+
# https://codefresh.io/docs/docs/yaml-examples/examples/
3+
4+
version: "1.0"
5+
# Stages can help you organize your steps in stages
6+
stages:
7+
- "clone"
8+
- "build"
9+
- "test"
10+
11+
steps:
12+
clone:
13+
title: "Cloning repository"
14+
type: "git-clone"
15+
repo: "https://github.com/codefresh-io/cli/"
16+
# Clone the master branch. Or, use ${{CF_BRANCH}} to get branch name from trigger
17+
# Learn more at https://codefresh.io/docs/docs/codefresh-yaml/variables/
18+
revision: "master"
19+
stage: "clone"
20+
21+
build:
22+
title: "Building Docker image"
23+
type: "build"
24+
image_name: "codefresh-io/cli"
25+
working_directory: "${{clone}}"
26+
# Set 'latest' tag on the image. Or, use built-in variables
27+
# like ${{CF_BRANCH_TAG_NORMALIZED}} to use the current branch name/tag.
28+
tag: "latest"
29+
dockerfile: "Dockerfile"
30+
stage: "build"
31+
32+
test:
33+
title: "Running test"
34+
type: "freestyle" # Run any command
35+
image: "ubuntu:latest" # The image in which command will be executed
36+
working_directory: "${{clone}}" # Running command where code cloned
37+
commands:
38+
- "ls"
39+
stage: "test"
40+

docs/index.js

+19-18
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ const ALLOW_BETA_COMMANDS = process.env.ALLOW_BETA_COMMANDS;
1616
const categoriesOrder = {
1717
completion: 30,
1818
authentication: 31,
19-
'operate on resources' : 32,
20-
pipelines : 40,
21-
'pipelines v2 (beta)' : 42,
22-
projects : 45,
19+
'operate on resources': 32,
20+
pipelines: 40,
21+
'pipelines v2 (beta)': 42,
22+
projects: 45,
2323
builds: 50,
24-
contexts : 70 ,
25-
images : 80 ,
26-
triggers : 90,
27-
environments : 100 ,
28-
compositions : 110 ,
29-
'helm repos' : 111 ,
24+
contexts: 70,
25+
images: 80,
26+
triggers: 90,
27+
environments: 100,
28+
compositions: 110,
29+
'helm repos': 111,
3030
'predefined pipelines': 120,
3131
'cli config': 121,
3232
teams: 130,
33-
more : 150,
33+
more: 150,
3434
};
3535

3636

@@ -115,7 +115,7 @@ const getWeight = async (command) => {
115115
}
116116
};
117117

118-
const createCommandFile = async (nestedCategory,command) => {
118+
const createCommandFile = async (nestedCategory, command) => {
119119
const docs = command.prepareDocs();
120120
const dir = path.resolve(baseDir, `${(nestedCategory || 'undefined').toLowerCase()}`);
121121

@@ -216,7 +216,7 @@ const createCategoryFile = async (content, category) => {
216216
* updates the category main file with a specific command
217217
* possible extensions are: HEADER, COMMANDS
218218
*/
219-
const updateCategoryFileArray = async (nestedCategory,command, existingContent) => {
219+
const updateCategoryFileArray = async (nestedCategory, command, existingContent) => {
220220
const docs = command.prepareDocs();
221221
const { category } = docs;
222222
const finalCategoryArr = existingContent || {};
@@ -253,7 +253,7 @@ const updateCategoryFileArray = async (nestedCategory,command, existingContent)
253253
finalCategoryArr.category = category;
254254
newCmd.weight = await getWeight(command);
255255
newCmd.content = commandString;
256-
if (!finalCategoryArr.commands){
256+
if (!finalCategoryArr.commands) {
257257
finalCategoryArr.commands = [];
258258

259259
}
@@ -318,16 +318,16 @@ const createAutomatedDocs = async () => {
318318

319319
// document only in case category field exists and there are no sub commands under it
320320
const docs = command.prepareDocs();
321-
const {category} = docs;
321+
const { category } = docs;
322322
if (!category || await hasSubCommands(command)) {
323323
continue;
324324
}
325325

326326
nestedCategories[category] = await getNestedCategories(command);
327327
const nestedCategory = nestedCategories[category];
328-
categories[category] = await updateCategoryFileArray(nestedCategory,command, categories[category]);
328+
categories[category] = await updateCategoryFileArray(nestedCategory, command, categories[category]);
329329
await upsertCategoryFolder(nestedCategory);
330-
await createCommandFile(nestedCategory,command);
330+
await createCommandFile(nestedCategory, command);
331331
}
332332

333333
let categoriesFinalContent = {};
@@ -356,7 +356,7 @@ const createDownloadPage = async () => {
356356
links.push(asset.browser_download_url);
357357
}));
358358
const commandFilePath = path.resolve(baseDir, './installation/download.md');
359-
const finalContent=
359+
const finalContent =
360360
'+++\n' +
361361
'title = "Download"\n' +
362362
'description = "asd"\n' +
@@ -372,6 +372,7 @@ const createDownloadPage = async () => {
372372
' <li><a href=' + links[1] + ' target="_blank">Linux-x64</a></li>\n' +
373373
' <li><a href=' + links[2] + ' target="_blank">Macos-x64</a></li>\n' +
374374
' <li><a href=' + links[3] + ' target="_blank">Windows-x64</a></li>\n' +
375+
' <li><a href=' + links[4] + ' target="_blank">Alpine-arm64</a></li>\n' +
375376
'</ul> \n' +
376377
'\n' +
377378
'After downloading the binary, untar or unzip it and your are good to go.<br>\n' +

lib/interface/cli/commands/root/root.sdk.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('root commands', () => {
140140
describe('Not valid yaml ', async () => {
141141
it('should throw error for not valid file', async () => {
142142
const argv = {
143-
filenames: ['./codefresh.yml'],
143+
filenames: ['./__mocks__/codefresh.yml'],
144144
};
145145
const result = await validateCmd.handler(argv)
146146
.catch(err => err);

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.85.1",
3+
"version": "0.86.0",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,
@@ -9,7 +9,7 @@
99
"test": "jest .spec.js --coverage",
1010
"e2e": "bash e2e/e2e.spec.sh",
1111
"eslint": "eslint --fix lib/logic/**",
12-
"pkg": "pkg . -t node16-alpine-x64,node16-macos-x64,node16-linux-x64,node16-win-x64 --out-path ./dist",
12+
"pkg": "pkg . -t node16-alpine-x64,node16-macos-x64,node16-linux-x64,node16-win-x64,node16-linux-arm64 --out-path ./dist",
1313
"serve-docs": "yarn build-local-docs && cd temp && hugo server -D",
1414
"serve-docs-beta": "ALLOW_BETA_COMMANDS=true yarn build-local-docs && cd temp && hugo server -D",
1515
"build-local-docs": "node ./docs/index.js",
@@ -115,4 +115,4 @@
115115
"./test-setup.js"
116116
]
117117
}
118-
}
118+
}

0 commit comments

Comments
 (0)