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

Figure out replacement for DRONE_JOB_NUMBER for Drone 1.0.0 #23

Open
jhasse opened this issue Mar 20, 2019 · 5 comments
Open

Figure out replacement for DRONE_JOB_NUMBER for Drone 1.0.0 #23

jhasse opened this issue Mar 20, 2019 · 5 comments

Comments

@jhasse
Copy link
Contributor

jhasse commented Mar 20, 2019

Now that Drone 1.0.0 is released I've tried to port my 0.8 configs to it. I've noticed that DRONE_JOB_NUMBER is no longer available. I think a good replacement would be DRONE_STAGE_NAME or DRONE_STAGE_NUMBER (see https://github.com/drone/drone/blob/master/operator/runner/env.go#L65). But when I'm using that via

    cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_STAGE_NAME ]

I'm getting:

Warning! Environment variable 'DRONE_STAGE_NAME' does not contain a value, it will be ignored! 

Any idea why that variable doesn't get passed to the plugin?

@mjwwit
Copy link
Collaborator

mjwwit commented Mar 25, 2019

The message you see is only printed when the given variable does not contain a value, so it may be that DRONE_STAGE_NAME is not a good variable to use by default. The removal of DRONE_JOB_NUMBER does warrant an update to this plugin though. When I migrate my projects to Drone 1.0 I'll take a look at the options. Meanwhile I'm open to other suggestions if anyone has them.

@jhasse
Copy link
Contributor Author

jhasse commented Apr 11, 2019

It was a Drone bug (see referenced issue), now fixed in 1.0.1! DRONE_STAGE_NUMBER is the equivalent replacement and works :)

@mjwwit
Copy link
Collaborator

mjwwit commented May 13, 2019

So it now works when using cache_key: [ DRONE_REPO_OWNER, DRONE_REPO_NAME, DRONE_STAGE_NUMBER ]?

I think we can eventually start using this as the default cache_key, but I'd like to wait for 1.0 to settle properly before I break all the 0.8 installations.

@jhasse
Copy link
Contributor Author

jhasse commented May 13, 2019

Yes :)

@ptman
Copy link

ptman commented Aug 23, 2019

Is drone-volume-cache compatible with drone 1.0+? How would one use it instead of travis caching like https://evilmartians.com/chronicles/speeding-up-go-modules-for-docker-and-ci ?

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

No branches or pull requests

3 participants