Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

circleci commandSet #217

Merged
merged 3 commits into from Aug 8, 2020
Merged

circleci commandSet #217

merged 3 commits into from Aug 8, 2020

Conversation

pulkit-khullar
Copy link
Contributor

@pulkit-khullar pulkit-khullar commented Aug 6, 2020

circleci_workflow_run -> Trigger workflow for default branch or provided branch based on the access token provided.
In case, Token does not have access to the specified branch. The default branch workflow will be triggered as API doesn't return an error in that case.

circleci_workflow_list -> Provides with the list of last 5 workflow runs.

@v-shant
Copy link
Contributor

v-shant commented Aug 6, 2020

seems like this command-set not following the nimbella project structure. this should be the structure of folders/files

circleci
 |______ packages
 |                |______ circleci
 |                     |_______ run_wrokflow.js (file)
 |                     |                 or
 |                     |__________ run_workflow (folder)
 |                                       |_________ (index.js or src/index.js)
 |______  commands.yaml
 |
 |_______ README.md 

@@ -0,0 +1,9 @@
sourceBasePath: https://raw.githubusercontent.com/nimbella/command-sets/master/circleci/src
Copy link
Contributor

@v-shant v-shant Aug 6, 2020

Choose a reason for hiding this comment

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

sourceBasePath and sourcePath not required. these are deprecated.

circleci/README.md Outdated Show resolved Hide resolved
@niks3089 niks3089 merged commit 91da3ec into nimbella:master Aug 8, 2020
@rabbah
Copy link
Contributor

rabbah commented Aug 8, 2020

Suggested updates to the docs. Apparently I had not “submitted” the review.

circleci/README.md Show resolved Hide resolved
circleci/README.md Show resolved Hide resolved
circleci/README.md Show resolved Hide resolved
This secret should be created with the following naming convention. `projectName_token`. Where the project name is your circleCi project name. example `webApp_token`.

`vcsType` - Version Control System. Either `gh` for GitHub or `bb` BitBucket.
`orgName` - Name of your gh/bb organisation specify the account username if its a personal project.
Copy link
Contributor

Choose a reason for hiding this comment

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

The name of you GitHub or BitBucket organization. Specify your account username if it is a personal project.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can the org name also be optional. If not specified then the commands must include it when run.

circleci/README.md Show resolved Hide resolved
These are :
`projectToken` - CircleCI allows you to create a Token on a project basis to access API, Make sure you provide the token here which can access all those branches which you want to use via this command.

This secret should be created with the following naming convention. `projectName_token`. Where the project name is your circleCi project name. example `webApp_token`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn’t required though - so this is a tip? I think once you have the api token what it’s actually called in the circle dashboard isn’t important.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, What it’s actually called in the circle dashboard isn’t important but it's easy for user to remember the name, and based on the name we can send the specific token in the request.

The reason behind projectName_token is, let's say we have 2 projects in CCI commander and main.
So, I have created 2 API access tokens 1 for each.

Now, I want to run a workflow for commander first and then for main. This, I would have to pass as a command parameter, and based on that program can check for the token as all the secrets are available to all the commands present inside same app.

/nc circleci_workflow_run commander develop -> commander_token
/nc circleci_workflow_run main develop -> main_token

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.

None yet

4 participants