Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 18 03:30
    @bradrydzewski banned @vityafx
  • May 07 20:55
    @bradrydzewski banned @izznogooood
David Lewis
@HighwayofLife

Is there a difference between:

when:
  branch:
  - master
  - feature/*

and

when:
  branch:
    includes:
    - master
    - feature/*
Brad Rydzewski
@bradrydzewski
@HighwayofLife nope
David Lewis
@HighwayofLife
👍
Brad Rydzewski
@bradrydzewski
@shqear93 this controls server-side logging, not the logs you see in the user interface. If you are trying to figure out why the logs you see in the user interface are not formatted or colored, see https://github.com/drone/drone-ui/issues/313#issuecomment-215795387
Khaled AbuShqear
@shqear93
@bradrydzewski thanks for reply, do you mean drone-server enables the colored output by default ?
Brad Rydzewski
@bradrydzewski
yes, if your pipeline commands emit colored logs, Drone will render them
Khaled AbuShqear
@shqear93
Got it, thanks :+1:
Brad Rydzewski
@bradrydzewski
when Drone executes your pipeline, the commands are executed in a non-interactive terminal. Many programs disable formatting if the terminal is non-interactive (e.g. stdin is closed). In some cases you can override and force programs to emit colored output regardless, in which case Drone will detect and display the colors in the UI.
Manuel GarcĂ­a-Amado
@militarpancho
Hi!, a question I can figure out it might be possible but I didn't find documentation at all....It's about Go templates....For example, if I have a kubernetes deployment(or a regular yaml file or something like that) in the following code, might the substitution of the env variable work in drone?
....
containers:
      - name: myproject
        image: eu.gcr.io/myproject/myproject:{{DRONE_SEMVER}}
....
you cannot use Go templates, but you can use substitution as described in the docs
Manuel GarcĂ­a-Amado
@militarpancho
Okey, thanks!, so to use env substitution in yaml files I could go with envsubst and similar tools, thanks!
Brad Rydzewski
@bradrydzewski
sorry, not sure I understand the comment about envsubst
Manuel GarcĂ­a-Amado
@militarpancho
Ups! jeje, I was referring that in order to substitute environment variables in files within the workspace, I will need to use envsubst
Brad Rydzewski
@bradrydzewski
sorry, I think I'm still confused
envsubst is a library
Manuel GarcĂ­a-Amado
@militarpancho
yes..using it in the commands
steps:
- name: build
  image: militarpancho1/tele-buildbox:6.2.3
  commands:
    - envsubst < kubernetes/deployment.tmpl.yaml > kubernetes/deployment.yaml
And the file kubernetes/deployment.tmpl.yaml contains among other thing the one that i commented before:
....
containers:
      - name: myproject
        image: eu.gcr.io/myproject/myproject:{{DRONE_SEMVER}}
....
Manuel GarcĂ­a-Amado
@militarpancho
Anyways...thanks for the fast help and support as usual!!! =D
Nevin Morgan
@nevinsm
Hi, has anyone else encountered this error when running the new kubernetes runner? level=error msg="cannot request stage" error="context canceled"
Nevin Morgan
@nevinsm
it almost seems like the kube runner isn't waiting long enough for the response. I get a successful connection, and I am able to send the same request via postman and get a response, it just takes a few seconds
Brad Rydzewski
@bradrydzewski
I believe that message just reflects the fact that runner does long polling
the system connects, eventually times out, and reconnects
Nevin Morgan
@nevinsm
okay, that in the logs just had me worried I had configured something wrong
I will push some builds through it and see if anything errors out
Brad Rydzewski
@bradrydzewski
I updated the code to use trace logging for context errors, to reflect the fact that they are expected
+    if err == context.Canceled || err == context.DeadlineExceeded {
+        log.WithError(err).Trace("no stage returned")
+        return nil
+    }
    if err != nil {
        log.WithError(err).Error("cannot request stage")
        return err
    }
hopefully that will cause less confusion
Nevin Morgan
@nevinsm
thanks, sorry for the confusion on my part
Brad Rydzewski
@bradrydzewski
no, I wrote the confusing logging code, so my fault !
Nevin Morgan
@nevinsm
are there docs on what service account I need to configure for the kubernetes runner that I am just missing? I get an error default: secrets is forbidden: User "system:serviceaccount:drone:default" cannot create resource "secrets" in API group "" in the namespace "drone" so I just want to make sure I didn't miss a doc on what role resources I need for the runner, or the server
Brad Rydzewski
@bradrydzewski
this has not been documented yet
but in terms of what exact permissions are necessary, this has not been documented
Nevin Morgan
@nevinsm
okay, thanks for the heads up. I will have to modify my deployment and add a service account for drone, and add permissions as I run into errors
Brad Rydzewski
@bradrydzewski
if you don't mind sharing what you come up with, I would be happy to add to the documentation
Nevin Morgan
@nevinsm
will do, but it probably won't be until tomorrow. I need to get the rest of our runners configured, and I think I will switch my helm charts to separate out my server from my runner deployments. I have the same chart deploying both right now, but since the kubernetes runner is a standalone runner I think I should probably separate them now. Thanks for all the hard work getting this rewritten, I really like it being a separate concern from my drone server
Brad Rydzewski
@bradrydzewski
that is an interesting point, about having separate charts for the server vs runner. especially since Drone is multi-runner. One could install Drone Server + Drone Kubernetes Runner + Drone SSH Runner + Drone Digital Ocean Runner (each runner providing something different to the install)
@HighwayofLife thoughts on above ^^
Peter Sheats
@sheats
Is it possible to make a step conditional upon success/failure of a previous step?
guess closest I see is conditional upon status of pipeline
Peter Sheats
@sheats
My use case is to only execute step B if a step A is successful, but I don't want to mark build as failure if step A fails. To make that happen I have to set failure: ignore so it seems like step B can't look at pipeline status since it won't be marked as fail. (testing this out now)
Brad Rydzewski
@bradrydzewski

I have to set failure: ignore so it seems like step B can't look at pipeline status since it won't be marked as fail. (testing this out now)

this is correct

the only option I can think of is to combine into a single step, and execute the commands as a shell script
Peter Sheats
@sheats
Is there a way to execute a step only if the commit is related to an open PR?
Brad Rydzewski
@bradrydzewski
for example:
set +e
./some-test-script.sh
if [ $? != 0 ] 
then
set -e
./some-other-script.sh
fi
Peter Sheats
@sheats
I think other systems (codefresh) call it a syncronize event
actually, i think that solution should work
Brad Rydzewski
@bradrydzewski

I believe for a pull request synchronization you can do the following:

when:
  action: [ sync ]

note that this will not run when the pull request is opened.

Nevin Morgan
@nevinsm
@bradrydzewski treating the drone server as the standalone unit it is working really well for me. I carved some VMs out of my openstack cloud that manages my internal rack of servers to give me a couple of each (docker, ssh, exec) runner, and then added a single EC2 instance to the mix just to have something offsite so that my team's builds don't stop if something goes wrong at the office. Is there a way to set runner priority so I can have that EC2 instance be the last resort? It is by far the least powerful VM, I just want it to be the backup if everything else drops. I can also just keep the image around in AWS and spin it up manually if there isn't a way to set runner priority
Brad Rydzewski
@bradrydzewski
no, there isn't a way to set runner priority. Your best bet is to have an AMI around in case you need to quickly spin something up. Or better yet, maybe just a stopped instance, since you won't be billed for it.