Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the parent build number as DRONE_PARENT_BUILD_NUMBER #1930

Closed

Conversation

robertstettner
Copy link

I needed this so that I could use the artifacts that I put on S3 with the build number, in my deployments (so that I wouldn't have to build them again).

@robertstettner
Copy link
Author

Maybe this should be called DRONE_PARENT_BUILD_NUMBER? So that you could reference fork builds?

@bradrydzewski
Copy link

agreed, DRONE_PARENT_BUILD_NUMBER would be more appropriate

agent/agent.go Outdated
@@ -312,6 +312,7 @@ func toEnv(w *model.Work) map[string]string {
}
if w.Build.Event == model.EventDeploy {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this value can be set for all event types, so it can be moved outside this if block

agent/agent.go Outdated
@@ -312,6 +312,7 @@ func toEnv(w *model.Work) map[string]string {
}
if w.Build.Event == model.EventDeploy {
envs["DRONE_DEPLOY_TO"] = w.Build.Deploy
envs["DRONE_DEPLOY_FROM"] = fmt.Sprintf("%d", w.Build.Parent)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to DRONE_PARENT_BUILD_NUMBER as suggested

@robertstettner robertstettner changed the title Expose the deployment build number (parent) as DRONE_DEPLOY_FROM Expose the parent build number as DRONE_PARENT_BUILD_NUMBER Feb 13, 2017
@robertstettner
Copy link
Author

robertstettner commented Feb 15, 2017

@bradrydzewski Changes have been implemented, this is ready to go 👍

@vtolstov
Copy link

vtolstov commented Mar 7, 2017

gentle ping...

@vtolstov
Copy link

@robertstettner can you fix pr ?

@robertstettner
Copy link
Author

robertstettner commented May 15, 2017

@vtolstov This was fixed a long time ago... delayed for merge for an unknown reason, and now the PR has been "stolen" by another. Quite sad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants