-
Notifications
You must be signed in to change notification settings - Fork 74
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
Draft: completely scripted activation #6
Comments
Hey thanks Alex, that is some amazing work and I just discovered puppeteer! There's definitely place for this in the project. I'm wondering what would be the best way to include this;
I think the best solutions are 2 or 3. I really like this as it makes it much easier and reliable for supporting any CI. And cool thing, this can be in a separate image (we don't need node in the base image). |
Yeah, puppeteer is great with a lot of documentation and resources out there. I remember scripting with "plain" phantomjs in async way, which was a painful experience. Cache would be an idea, but you'd have to keep in mind that the license can only be used if the docker container wasn't rebuilt and has the same machine name. I've incorporated this activation into the container build process, so when the container is ready, unity is already activated. On a side note: while intensive testing and building I've noticed that some load balancer or application firewall blocks your attempt to authenticate/create new auth sessions with unity id. It worked again after a day or so. But you should be able to easily get ~20 license files until it stops working... |
oh, I'm bookmarking this issue. Thanks Alex! |
@alexanderbuhler, thanks for sharing your approach! I tried it in my test project (https://github.com/KonH/UnityCiPipeline) but faced with request verification code issue, unfortunately.
I got an email with that code, but I obviously can't use it, because the build is running on CI env. Now I think that only two options are working for CI with Unity:
It's sad. I don't use Unity for commercial projects at home, so I don't want to buy a subscription. And Cloud Build isn't a good solution for CI, it's slow and has its own issues. |
@KonH I never faced this Enter your code issue when running on gitlab-ci, but I did the license technique explained in the repository's readme, not the above script. I don't exactly know what leads to the error you just shared, but maybe you can give a try with manually obtaining the xml license and set it in the environment variable as documented. I don't really like it, but it did work for me |
Thanks, I will try it (have problems with it and decided to use this approach before digging into a variable usage) |
Don't hesitate to open an issue if you hit a problem with the procedure described in the documentation :) The main repo is on gitlab so you'll find more details there, I've tagged issues related to unity activation. |
@KonH I was running this script either from within my local docker or a server roughly at the same place where I live. I could imagine unity having some security mechanism in place e.g. if you used to login from EU and suddenly trigger a login from the USA. Where's your machine running the script located? |
It's strange, but I got this error even if I just run it locally, on the same machine, when I can log in correctly in a browser. |
@KonH Just tried creating a fresh container, license generation still works perfectly fine. (Sorry it took so long, was on vacation and stuff) |
It's strange. Anyway, I fall back to manual activation inside container now. |
I just tried the script today and it's failing with the following error:
I updated the script a little, but that's basically the step where it presses the login button. I also noticed an email which shows the following content:
Funny thing is that I use my license in random servers from CIs runners in many locations, but this time, I just ran it locally only for testing. Anyway, I logged in manually in my browser locally, but I'm wondering if this is just going to also happen on a random CI runner. I'll update here with more details, but I still think this is possible. Here's what could be done even if it's totally insane:
Overkill, but hey, I wish unity did something better about it like exposing an api for doing activation instead. This would work ^^. |
I'm happy the script still "works" for me, since the verification step seems to be based on some random logic and didn't appear for me yet. But yeah, I've kinda went though necessary steps here aswell @GabLeRoux. You've summerized them precisely there. Insane indeed. |
Yes, worked for me too after filling the form once 🎉 I bundled this in a docker image locally, I will publish this somewhere so we can use it as a docker image in any pipeline with no efforts shortly. Thanks again for this amazing work 🍰 |
Hi there, @alexanderbuhler, thanks for sharing your approach. I solved the problem with code verification! You just need account with enabled Two-Factor Authentication by Authenticator App. Verification code can be generated using authenticator key. You can find the details in my activate-unity action. @GabLeRoux I think you can use my solution in your docker images because I have no plan to support Gitlab CI. |
Hey there,
since all your content has helped me alot with setting up dockerized unity I wanted to share my working approach to activating unity by script.
node/puppeteer script:
And then there's just a small shell script handling the rest. Please note that (only?) Unity 2018.3 cli supports manual generation of activation file, which comes in handy here.
Involved env vars:
You might want to take a look at how to implement this into your images 👍
Best
Alex
The text was updated successfully, but these errors were encountered: