Drone Repo Add throwing error - No help topic for 'add' - drone.io

Getting the following error when using drone cli to add/activate repo
No help topic for 'add'
I can confirm I am successfully login and I am an admin.
{"id":1,"login":"XXXXX","email":"","machine":false,"admin":true,"active":true,"avatar":"https://bitbucket.org/account/XXXX/avatar/32/","syncing":false,"synced":1578888217,"created":1578431775,"updated":1578891320,"last_login":1578891344}
I can also list my repo using 'drone repo ls'

My guess, if you are using the add option is that you are still interacting with drone 0.8 or below, in this case the docs have been archived to an alternate location in favor of the latest version (v1.x). The old docs are still available under the following URL and help for the add option is present there:
https://0-8-0.docs.drone.io/cli-repository-add/
If you are not using 0.8 and are indeed trying to use 1.x, perhaps you are referencing improper documentation, as this cli option shifted in v1 to enable
$ drone repo enable <repo/name>
Regardless of the versions however, you will want to ensure you both have admin access to the repository (so that drone is able to add the appropriate webhooks) and also refresh or sync your repo listing in if it is something brand new:
$ drone repo sync
username/hello-world
organization/minio
...
NOTE: This might take a bit depending on how many repos you have access to

Related

Drone.io secrets not populating in yml appropriately and documentation seems inaccurate

I am running version 0.8.4 as a container in my lab. CLI is also at version 0.8.4
I am trying to use a secret in a command one of my containers is trying to run.
Following the documentation has me needing to sign a repo to allow the job to consume the secret. The drone CLI does not seem to have a
drone sign command for me to run. So I create the secret with a --skip-verify=true flag. This creates the secret but when I run the job it errors out. The output in the UI shows a blank space where the secret should be injected.
Here is an excerpt of my .drone.yml where I am trying to inject secrets -s production -u ${cf_user} -p ${cf_password} --s
I have tried all the following ways to create a secret:
drone secret add <repo_name> --name <key> --value <value> --skip-verify=true
drone secret add <repo_name> --name <key> --value <value>
GUI Creation
I notice when I create an all capital name value the UI represents the value in all lowercase when the CLI shows it in capitals.
I also notice that if I include hyphens in the name and try to use that in my drone.yml the job errors out immediately with a bad substitution error.
Any help understanding what I am doing wrong would be much appreciated!
I got lost in the different documentation available. Should have been looking here rather than secret-guide.
In case I am not alone, I needed to add a secrects block in my pipeline.
I also needed to access them with $SECRET_KEY rather than ${SECRET_KEY}
pipeline:
publish:
image: governmentpaas/cf-cli
secrets: [ cf_user, cf_password ]
Just a little update on this one, I stumbled over it as well because the docs are inconsistent.
In the 0.8.5 version the only thing I had to do is:
add secrets via CLI or UI
add secrets array to utilise it
no need to pass variables to environment.

Is it possible to invalidate build cache on a given branch?

I'm using Gitlab CI on one of my projects and I face the following problem :
My master build fails since a lot of time...
I push a new branch built from the master (no new commits) and push it, the build works.
I think that it's related to build cache because the codebase is strictly the same... The latest valid build cache may make the current code base failed...
Is there a way to clean the build cache on a specific branch ? In my case the master ? From the API ?
Finally, the Gitlab Team gave me the solution on Twitter : https://twitter.com/gitlab/status/832674380790394880
Since my repository is hosted on gitlab.com, I can't remove the cache by myself. But on the .gitlab-ci.yml file documentation, it's explained that we can use a cache:key entry.
This cache:key is used to determine how the cache entry is named so I can change the default value to start on a blank cache 😊.
Below a sample of my .gitlab-ci.yml file :
my-asset-build:
cache:
key: "$CI_COMMIT_REF_NAME-assets"
With that configuration, my cache is related to the current ref (so a build on the same ref will use the cache) with a suffix !
Thanks to the Gitlab Team for their quick answer on Twitter !
If you have trouble with the variable name, maybe you need to check this page : https://docs.gitlab.com/ce/ci/variables/README.html#9-0-renaming
Also, since Gitlab 10.4, we have a "Clear runner cache" button in the pipeline list. Clicking on that button will have the same effect than changing variable name without polluting commit history.

Delete or reset Gitlab CI builds

Is it possible to delete old builds in Gitlab CI?
I tested a few things and have now about 20 builds that are useless (most are failed anyway).
It also shows stages that I don't have anymore which kinda clutters the Pipelines page and some of the uploaded artifacts are a bit big.
I wasn't able to find any documentation on this, only that disabling CI in the settings doesn't remove the builds.
Using Gitlab 8.10 Community (hosted by Gitlab.com)
There is currently no option in the GUI to completely get rid of a build other than expunge related data from the build. (The erase option in the build)
If you would have a local installation you could modify the database directly but I would advise caution. (I'll put the guide here for completeness sake)
Login to the GitLab database. If you use the default PostgreSQL :
sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
Check if there is a table ci_builds. For pSQL: \dt
Delete the builds with normal SQL. For example: DELETE FROM ci_builds WHERE id = 2
(Optional) If you want to cleanup a list of commits which triggered a build you need to midify the table ci_commits.

How to handle customRole in serverless?

I would like to have different roles for different stages in serverless.
Example for stage 'dev' I have roleA-dev and for stage 'prod' the role is roleA-prod
What is best way to handle this kind of situation in serverless?
The obvious solution is to update customRole within s-function.json to include the ${stage} variable.
"customRole": "RoleA-${stage}"
Unfortunately, this functionality is currently incomplete in the released version of Serverless, but is expected to be available in v0.5. A GitHub issue has been opened that includes this specific functionality.
20160304 Update:
Serverless v0.5 has now been released for beta testing. You can install it using the following command:
npm install git://github.com/serverless/serverless#v0.5 -g

Egit pull failure showing error

I am facing problem with egit pull option.I can do push in my repo but cannot do pull from the repo. It comes with an error can anyone tell me the full process of pull.After googling i came to know something about fetch but from the site i am not completely aware of the use of it.When i selet team->pull eclipse show me this:"The current branch is not configured for pull No value for key branch.master.merge found in configuration".Help me?
Looks like this answers your question.
The current branch is not configured for pull No value for key branch.master.merge found in configuration
Also if you have command line GIT then you should also be able to do git branch --set-upstream BRANCH-NAME REMOTE-BRANCH-NAME that should set up the remote tracking also.