Skip to content

Feature/add api token command key support #3 - #4

Merged
mhemrg merged 5 commits into
liara-cloud:masterfrom
HMarzban:feature/add-api_token-command-key-support
Apr 8, 2019
Merged

mhemrg merged 5 commits into
liara-cloud:masterfrom
HMarzban:feature/add-api_token-command-key-support

Conversation

@HMarzban

@HMarzban HMarzban commented Apr 6, 2019

Copy link
Copy Markdown
Contributor

Hi, as I mentioned in issue #3, I found a way to make it easy deployment for CI/CD.
now we can use cli like below:

$ liara deploy --port <project-port> --project <project-name> --api_token <your-token>

If you have any further questions about the concept of implementations, I'll be glad to be accountable 😊

@mhemrg

mhemrg commented Apr 8, 2019 •

Copy link
Copy Markdown
Member

Wow. Great PR 😊 👍

@mhemrg mhemrg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few comments that should be addressed before this gets merged. 😊

Comment thread README.md
Comment thread src/liara.js Outdated
liaraConf = JSON.parse(readFileSync(liaraConfPath));
}else{
liaraConf = {}
liaraConf["api_token"] = args.api_token;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using underline in the command line is not a good convention.
I recommend using --api-token.

@mhemrg
mhemrg merged commit 1f7aad3 into liara-cloud:master Apr 8, 2019
@mhemrg

mhemrg commented Apr 8, 2019

Copy link
Copy Markdown
Member

Thank you @HMarzban. Merged. 🎉

@HMarzban

HMarzban commented Apr 8, 2019

Copy link
Copy Markdown
Contributor Author

It was my pleasure 😊

@mhemrg

mhemrg commented Apr 9, 2019

Copy link
Copy Markdown
Member

I didn't test this PR myself and seems that it doesn't work properly.

@mhemrg mhemrg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some comments that would help to fix this PR.

Comment thread src/liara.js
let liaraConf;
try {
liaraConf = JSON.parse(readFileSync(liaraConfPath));
if(!args.api_token){

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still uses api_token with the underline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api_token is default property we get from liaraConf variable when user login successfully.

Comment thread package.json
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-backpack": "^0.4.3",
"@babel/core": "^7.4.3",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't upgrade npm packages unless you're sure that the project is compatible with them.
Currently, the CLI doesn't work with these new versions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the last config of bable-core which was version 6 is not compatible with babel-loader and I face to an error a lot,
now it's compatible with new version of babel-core, and I ran test suite and it was okay.

Comment thread src/liara.js
liaraConf = JSON.parse(readFileSync(liaraConfPath));
}else{
liaraConf = {}
liaraConf["api-token"] = args.api_token;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be correct:

liaraConf.api_token = args["api-token"];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you right

@mhemrg

mhemrg commented Apr 9, 2019

Copy link
Copy Markdown
Member

I fixed the issue myself :)

@HMarzban

HMarzban commented Apr 9, 2019

Copy link
Copy Markdown
Contributor Author

Let me correct all these issues and write a new unit test for this PR. then I let you know to check it up all features again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants