{{ .Created }}
I get an integer. I know its probably the UNIX timestamp, but is there a way to get it in a human readable form?
drone build ls drone/hello-world --format="{{ time .Started }}"
$ drone build ls drone/hello-world --format="{{ .Number }},{{ time .Started }},{{ .Status }}"
123,2020-05-08 13:51:42 -0400 EDT,success
122,2020-05-08 12:25:19 -0400 EDT,success
121,2020-05-05 14:15:15 -0400 EDT,success
120,2020-05-04 09:13:49 -0400 EDT,success
119,2020-04-28 12:01:16 -0400 EDT,success
118,2020-04-28 12:00:35 -0400 EDT,success
hi, this is probably answered but i can't find a clear example/answer:
how can one filter by pull request merge ?
(basically i want to only trigger the build when a PR merge happens and ignore other PR actions)
kind: pipeline
name: default
steps:
- name: build and publish to ECR
image: plugins/ecr
settings:
repo: myrepo
registry: myrepo.dkr.ecr.eu-central-1.amazonaws.com
region: eu-central-1
tags:
- api-${DRONE_SOURCE_BRANCH}-${DRONE_BUILD_NUMBER}
- api-${DRONE_SOURCE_BRANCH}-latest
dockerfile: Dockerfile
when:
event:
- pull_request
branch:
- dev
push
events in Drone
I'm getting a "There was a problem enabling your repository. Validation Failed."
repository activation error ONLY when trying to build drone/drone from a Dockerfile. All I'm doing is adding some environment variables to the drone/drone image, e.g.
FROM drone/drone:1
ARG DRONE_GITHUB_CLIENT_ID
ENV DRONE_GITHUB_CLIENT_ID=$DRONE_GITHUB_CLIENT_ID
...
and running docker
with the same exact options. Any idea what could be the issue?
{"admin":true,"level":"debug","msg":"api: sync repository permissions","name":"noto-emoji-docker","namespace":"Drone","read":true,"request-id":"6e8d961579d61152440b5be83137e628","time":"2020-05-12T16:35:38Z","user.admin":true,"user.login":"admin","write":true}
{"admin":true,"level":"debug","msg":"api: repository permissions synchronized","name":"noto-emoji-docker","namespace":"Drone","read":true,"request-id":"6e8d961579d61152440b5be83137e628","time":"2020-05-12T16:35:39Z","user.admin":true,"user.login":"admin","write":true}
{"level":"debug","msg":"api: root access granted","name":"noto-emoji-docker","namespace":"Drone","request-id":"6e8d961579d61152440b5be83137e628","time":"2020-05-12T16:35:39Z","user.admin":true,"user.login":"admin"}
{"level":"debug","msg":"api: root access granted","name":"noto-emoji-docker","namespace":"Drone","request-id":"6e8d961579d61152440b5be83137e628","time":"2020-05-12T16:35:39Z","user.admin":true,"user.login":"admin"}
{"fields.time":"2020-05-12T16:35:39Z","latency":1002167554,"level":"debug","method":"POST","msg":"","remote":"10.42.0.0:59252","request":"/api/repos/Drone/noto-emoji-docker/builds","request-id":"6e8d961579d61152440b5be83137e628","time":"2020-05-12T16:35:39Z"}
@ashwilliams1 I've dug a bit deeper and figured out it has to do with DRONE_SERVER_HOST
in my Dockerfile vs. as an --env
variable with docker run. For some reason when I use:
RUN echo "${DRONE_SERVER_HOST}"
ARG DRONE_SERVER_HOST
ENV DRONE_SERVER_HOST=$DRONE_SERVER_HOST
RUN echo "${DRONE_SERVER_HOST}"
The variable doesn't change from localhost
but all others do.
@ashwilliams1 I've dug a bit deeper and figured out it has to do with
DRONE_SERVER_HOST
in my Dockerfile vs. as an--env
variable with docker run. For some reason when I use:RUN echo "${DRONE_SERVER_HOST}" ARG DRONE_SERVER_HOST ENV DRONE_SERVER_HOST=$DRONE_SERVER_HOST RUN echo "${DRONE_SERVER_HOST}"
The variable doesn't change from
localhost
but all others do.
Emmm ... this is interesting too
ENV DRONE_SERVER_HOST=$DRONE_SERVER_HOST
is equivalent to ENV DRONE_SERVER_HOST=localhost
where $DRONE_SERVER_HOST
is always taken from the ENV variable defined in the base image rather than the ARG variable irrespective of order. I can work around this by passing in a build argument of a different name and then overriding the environment variable with another ENV instruction like this:ARG DRONE_SERVER_HOST_ARG
ENV DRONE_SERVER_HOST=$DRONE_SERVER_HOST_ARG
DRONE_DEBUG
enabled) but I can see the webhook being correctly fired in gitea