Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 20 05:53
    @ashwilliams1 banned @matrixbot
  • Oct 18 2019 03:30
    @bradrydzewski banned @vityafx
  • May 07 2019 20:55
    @bradrydzewski banned @izznogooood
golanggc
@golanggc
you are all good man
who can help me
my pipeline never triggered to build
golanggc
@golanggc
I use the drone/charts to set up the drone, and the drone-runner-kube on k8s, but the pipeline never triggered

pipeline:

kind: pipeline
type: kubernetes
name: default
dns_config:
  nameservers:
    - 192.168.0.63
    - 172.21.0.10
steps:
- name: greeting
  image: alpine
  commands:
  - echo world
trigger:
  event:
  - push
golanggc
@golanggc
Is there anyone can help me, good luck with you all the time!
@dschmidt Hi!
Kacper
@Upgreydd
Have a question. Is there an option to add default tasks to all repositories and runs in DroneCI? I'd like to use http://plugins.drone.io/masci/drone-datadog/ globally. Any idea how to solve that?
2 replies
Jozsef Kiraly
@fonix232

Hi all!

I'm facing a weird situation. I have a working flow for building an Android app, which needs to be optimised a bit. The main focus is on a step that grabs the output of various unit test coverage reports, etc., and uploads them to a private server. The step works, but takes a very long time since every file is uploaded one by one.

This step is not crucial to the flow itself, so failures are ignored (it happens from time to time due to the target server not being available). However, it also blocks other tasks from running, thus the flow becomes incredibly long (the actual unit test and build steps take around 3-4 minutes, this upload task can take up to 10 minutes). I wanted to make this step run in the background so that other steps can follow (which do not depend on the results of this upload step), cutting down time needed for the GitHub verification (so e.g. the upload task can be still running, but the PR in question can be merged before it finishes). The closest option I could find for this is detaching the step from the flow, which works, except... The detached step gets killed as soon as the rest of the flow is finished. As we are not guaranteed to have uploaded all the files at that point, this means my upload task gets broken midway through the uploads.

Is there a way for Drone to wait for a detached step to be finished before finishing the flow and killing said detached step? Or should I just make a separate pipeline for the uploads?

2 replies
SchindlerTo
@SchindlerTo

Hi,
i set up the drone server and a drone runner on my machine and connected it to bitbucket - this works quite well out of the box.
Now I am facing a problem and I am really struggeling: I build a costum docker image which has some domain specific software in it (locally). I pass the name of the image in the pipeline:

steps:
 -  name: name
- image: my_costum_image

now if I commit something everyhting works - great.
Additionally I need to change the MAC adress of the pipeline cotainer (not the runner).
I tried to just add some additional NIC, but docker does not let me do that at runtimee due to NET_ADMIN and I do not understand how to grad the container the NET_ADMIN permission. I also tried to add:

DRONE_RUNNER_PRIVILEGED_IMAGES=my_costum_image

to my drone-agent / the runner, but I am still not able to execture ip link add link eth0 (error: RTNETLINK answers: Operation not permitted)

I am able to reproduce this error locally without drone by starting my image with docker and exec a bash. I am also able to solve the problem locally by --add-cap=NET_ADMIN on the exec command.
Is there a possibility to grant NET_ADMIN to the pipeline container or any other suggestions on how to solve the problem?

2 replies
Jem Altieri
@jemaltieri

Hi there all. I'm using the drone slack plugin, and trying to neaten up the messages. I'm invoking like this:

- name: notify slack of result
   image: plugins/slack
   settings:
   webhook:
     from_secret: slack_deploy_notifications_webhook
   channel: deploy-notifications
   template: >
          *{{#success build.status}}{{ else }}{{/success}} {{ uppercasefirst build.status }}: Build #{{ build.number }}* (type: `{{ build.event }}`)\n
          further messages\n

but the \n s are not resulting in actual newlines in the message, they're instead showing up in the text. how do i get some newlines in my slack messages?

16 replies
Sriram Maddirala
@SriramMaddirala
Hey I was looking into whether it's possible to setup my drone.yml so that whenever a commit is made to a fork of my repo, drone pushes a build to my docker registry. Example repo : team/product. Example fork: user/product
lunax
@mlunax
Hi,
I wanted to make custom workdir in pipeline, is it possible?
(To make plugin/docker inside in one specific folder)
Austin Lee
@lizheming
try run cd dir/ command before plugin/docker step?
lunax
@mlunax
I think that makes plugin not to start (building step)
Austin Lee
@lizheming
or try to use context option in plugin/docker?
lunax
@mlunax
Contex not working there
my dockerfile trying add file outside of contex folder
Austin Lee
@lizheming
So why you want to custom workdir? may be root directory is a good anwser. Or you can add step to copy all need files to a new folder then set context option to it.
lunax
@mlunax
Austin Lee
@lizheming
ADD electron-packager/electron-packager.sh /bin/

modify to

ADD electron-packager.sh /bin/

then set context value to electron-packager.sh. I think it can work well.

lunax
@mlunax
was not working
I had changed this after I wroted here
Austin Lee
@lizheming
what's error message output?
lunax
@mlunax
somethink like that (i dont have logs)
/src/drone/docker-build.../electron-packager.sh not found
while dockerfile tries the 'add'
Brad Rydzewski
@bradrydzewski

Contex not working there. my dockerfile trying add file outside of contex folder

you can specify a path to both the context and dockerfile

settings:
  context: foo/bar
  dockerfile: foo/bar/Dockerfile
lunax
@mlunax
I specified
both
Brad Rydzewski
@bradrydzewski
however, note that Docker will not allow you to add files or folders outside of the context. This is a docker limitation, not a Drone limitation
lunax
@mlunax
I don't want to add files outside of the context
my context and my dockerfile (without .git)
is in subdir
Austin Lee
@lizheming
let me try it with drone cloud, please wait for a moment
Austin Lee
@lizheming
ADD electron-packager/electron-packager.sh /bin/

modify to

ADD electron-packager.sh /bin/

then set context value to electron-packager.sh. I think it can work well.

I try it and it works done. https://cloud.drone.io/lizheming/drone-plugins/4/1/3 here is build log. Notice you also set context: electron-packager in .drone.yml. and I got an error becase an invalid repo tag, so I try to just create latest tag. Here is the last yaml https://github.com/lizheming/drone-plugins/blob/master/.drone.yml @mlunax

Error parsing reference: "******/drone-electron-packager:refs/heads/master" is not a valid repository/tag: invalid reference format
lunax
@mlunax
thats the step before
ignore it or delete it?
wait
what
ok
sorry
wait thats stupid
that didn't work for me
lunax
@mlunax
Okay, now it works. I dunno why.
I have second question:
I wanted to use docker image builded in previous step to publish after I use promotion.
opax7
@opax7
I am about to build some legacy .NET apps and would like to build them using Windows containers. The docs stated that "Support for Docker pipelines on Windows is experimental and is not recommended for production use at this time." Is there a roadmap or timeline where this will be production ready?
7 replies
Rahees9983
@Rahees9983
I want to integrate sonarqube with drone ci/cd so that I can analysis static code. How can I achieve the integration of drone and Sonarqube ?
3 replies
I have used this
http://plugins.drone.io/aosapps/drone-sonar-plugin/
but I am getting below error.
==> Code Analysis Result: INFO: Scanner configuration file: /bin/sonar-scanner-4.2.0.1873/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 4.2.0.1873
INFO: Java 1.8.0_212 IcedTea (64-bit)
INFO: Linux 4.15.0-108-generic amd64
INFO: User cache: /root/.sonar/cache
ERROR: SonarQube server [] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.649s
INFO: Final Memory: 6M/481M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:73)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:42)
at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)
... 7 more
Caused by: java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found
at org.sonarsource.scanner.api.internal.shaded.okhttp.HttpUrl$Builder.parse(HttpUrl.java:1332)
at org.sonarsource.scanner.api.internal.shaded.okhttp.HttpUrl.get(HttpUrl.java:917)
at org.sonarsource.scanner.api.internal.shaded.okhttp.Request$Builder.url(Request.java:165)
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:109)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
... 10 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
1 reply
JinlongWukong
@JinlongWukong
my drone ci build failed, with error "Killed (cancelled)" from web console, is there any default timeout setting there?
2 replies
Michael Slizenko
@hovoodd

Hi. Can anyone tell me how to write env variable to a file? I try this, but it doensn't work.

echo $KUBE_CONFIG > ~/.kube/config
kubectl apply -f ./deploy/$APP/$APP_ENV.yaml

Fails with error: error loading config file "/.kube/config": yaml: mapping values are not allowed in this context

3 replies
Daniel Grove
@drGrove
There are no docs and the discussion threads all make references to things that do not work at all for service accounts in kubernetes pipelines. I've created a PR to add some clear documentation on this. drone/docs#426
Begley Brothers (Development)
@bbros-dev
We are trying to script setup of drone-server with gitea. We can script the gitea provision of an app id and secret. However the Drone server setup has us stumped. Curl to 80 on the droneserver indicates javascript is required. Have we missed something obvious? All the blog posts we see assume the drone server setup is user driven rather than script driven.
12 replies
quantonganh
@quantonganh
Hi, external environment variable cannot be used in image: section (as a tag), right?
5 replies