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

Support docker wrapper #6

Closed
dtretyakov opened this issue Dec 18, 2018 · 6 comments
Closed

Support docker wrapper #6

dtretyakov opened this issue Dec 18, 2018 · 6 comments
Labels
enhancement New feature or request

Comments

@dtretyakov
Copy link
Collaborator

We could provide support of building Unity projects in docker containers.

@dtretyakov dtretyakov added the enhancement New feature or request label Dec 18, 2018
@phearbot
Copy link

phearbot commented Dec 26, 2018

This would be nice, particularly if there were a docker image paired with this plugin.

I found this repo recently and installed it on a TC server in a container, but have been having issues getting my agent container (built off of the minimal agent) to recognize the installed path no matter where I install it or how I pass the environment variable. (Tried -e when running the container as well as ENV in the Dockerfile) and I get "Unmet requirements: Exists=>unity.path..+ exists"

EDIT: I was able to get it to find it, but I had to install Unity in /root/Unity to do so. The above attempts didn't work, and I wrongfully assumed it would be running as the buildagent user as the only directory in /home/ in the TC docker container is buildagent.

@dtretyakov
Copy link
Collaborator Author

dtretyakov commented Dec 27, 2018

@phearbot, thanks for feedback. Could you please share what was the original path to Unity Editor in your image based on teamcity-minimal-agent?

In the latest plugin update it will honor /opt/Unity* and ~/Unity* paths to detect Unity installation. If you're using custom installation path you define UNITY_HOME pointing to Unity editor path, e.g. "/opt/Unity_2018.2".

And yes it seems that currently TeamCity build agent is started under default "root" user instead of builduser. We'll consider switching to using buildagent user in further versions: JetBrains/teamcity-docker-minimal-agent#16

@phearbot
Copy link

@dtretyakov, thanks for the awesome work! The path I originally had Unity installed in was /opt/Unity/, and I've downloaded the latest update and reverted back to that location in my agent and can confirm it does see it out of the box now. I think I was running into an issue with my environment variables not persisting, which is a docker thing more than likely.

I'm still ironing out issues one at a time that aren't related to the plugin (activating Unity in the container, etc.) but I'll keep testing the plugin as I work out the Unity side issues. Thanks again!

@dtretyakov
Copy link
Collaborator Author

@phearbot, in the latest plugin version also was added Unity build feature (#2) which may help you with Unity activation before starting TeamCity build and with returning this license after build completion. You could also try using it and share your feedback.

dtretyakov added a commit that referenced this issue Dec 31, 2018
@AdamFrisby
Copy link

Being able to force the path in the build configuration, or via an environment variable which can be adjusted on a per-config basis would be useful.

We store all our Unity installs in C:\Unity* - it'd be nice if we could get the option to change the search directory from Program Files, et al - to there.

@lesley29
Copy link
Contributor

Closing as this was resolved by TW-79001 and is available since version 1.1.0 of the plugin (note that you should be running TeamCity 2023.09+). The documentation is still in progress, but essentially the wrapper works as it does in all other runners. Here is a short excerpt from a script performing a discovery:

# The following sources are checked:
1) UNITY_ROOT_PARAMETER environment variable (can be set from agent's process)
2) UNITY_HOME environment variable
3) UNITY_HINT_PATH environment variable
4) PATH environment variable
5) /opt directory (for Linux)
6) /Applications directory (for MacOS)

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

No branches or pull requests

4 participants