mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-22 16:36:30 +00:00
Merge pull request #133 from zond/master
DRONE_BRANCH and DRONE_PR env variables
This commit is contained in:
commit
404f7784bc
1 changed files with 15 additions and 0 deletions
|
@ -412,6 +412,21 @@ func (b *Builder) writeDockerfile(dir string) error {
|
|||
dockerfile.WriteRun("echo 'StrictHostKeyChecking no' > /root/.ssh/config")
|
||||
}
|
||||
|
||||
dockerfile.WriteEnv("CI", "true")
|
||||
dockerfile.WriteEnv("DRONE", "true")
|
||||
if b.Repo.Branch != "" {
|
||||
dockerfile.WriteEnv("DRONE_BRANCH", b.Repo.Branch)
|
||||
}
|
||||
if b.Repo.Commit != "" {
|
||||
dockerfile.WriteEnv("DRONE_COMMIT", b.Repo.Commit)
|
||||
}
|
||||
if b.Repo.PR != "" {
|
||||
dockerfile.WriteEnv("DRONE_PR", b.Repo.PR)
|
||||
}
|
||||
if b.Repo.Dir != "" {
|
||||
dockerfile.WriteEnv("DRONE_BUILD_DIR", b.Repo.Dir)
|
||||
}
|
||||
|
||||
dockerfile.WriteAdd("proxy.sh", "/etc/drone.d/")
|
||||
dockerfile.WriteEntrypoint("/bin/bash -e /usr/local/bin/drone")
|
||||
|
||||
|
|
Loading…
Reference in a new issue