Able to access job executor registry login via variable (OD-579)
Closed
bofa1ex opened 2 years ago

When define Docker Registry Login on Docker#Job Executor, it was have any variables to fetch registry_url? such as @executor_registry_url@

when i wrote script like below

docker build -t xxxx/yy .
docker tag xxx/yy @docker_registry_url@/xxx/yy
docker push @docker_registry_url@/xxx/yy
bofa1ex commented 2 years ago

From docker job executor it was defined registry_url && username && password

so i just don't wanna defined the same variable on scirpt repeatly

set -e
private_repo=192.168.x.x:yyyy

docker tag xxx/yy $private_repo/xxx/yy 
docker push $private_repo/xx/yy
Robin Shen commented 2 years ago

This is supported. Will make this info available as variable in future releases.

Robin Shen changed fields 2 years ago
Name Previous Value Current Value
Type
Discussion
New Feature
Robin Shen changed title 2 years ago
Previous Value Current Value
[QUESTION] About Job Executor Variable Support
Able to access job executor registry login via variable
bofa1ex commented 2 years ago

Thanks for reply, BTW docs about variable could be more completly. 🙁 maybe i just not found it where could explain that like @build_number@, @ref, @commit_hash , etc(know from hint complete)

Robin Shen commented 2 years ago

Thanks for the feedback.

@build_number@ represents the number you see for a build in the title line. @ref@ represents git reference the build is fired off, for instance ref/heads/main represents the main branch... commit_hash represents the git commit hash the build is currently running against.

Will find appropriate place to doc them though.

Robin Shen commented 2 years ago

Refer to this doc for a complete list of variables: https://code.onedev.io/projects/162/blob/main/pages/job-variables.md

Robin Shen changed state to 'Closed' 5 months ago
Previous Value Current Value
Open
Closed
issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Issue Votes (0)
Watchers (4)
Reference
OD-579
Please wait...
Page is in error, reload to recover