mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-24 10:07:21 +02:00
Merge pull request #133 from zond/master
DRONE_BRANCH and DRONE_PR env variables
This commit is contained in:
commit
404f7784bc
@ -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 New Issue
Block a user