## PREREQUISITE AKA SETTING UP A FRESH VM OR DEV COMPUTER # # Install your Win7/Win10 VM # Install VirtualBox additions in your VM # # (optional) add build user # Make user an admin, give it service privs # ... Local Security Policy -> Local Policies -> User Rights Assignment -> Log on as a service # # install Cygwin # add cygwin bin dir to env path # # install git for windows w/ git bash http://git-scm.com/download/win git config --global user.name "Dagen Brock" git config --global user.email "dagenbrock@gmail.com" # (set up your key(s)) # Add your ~/.ssh/id_rsa using git bash (or cygwin) so that # gitlab runner can check out your project # # The project is currently being build in Cygwin. # I install Cygwin with all "Devel" and "Perl" packages. # I also search for and add any SDL2 or FreeType libs just in case. # UPDATE FOR PROPER SDL2 BUILDS ON WINDOWS!!! # I used to link the libraries that were installed with all this environment, # but I had problems with it ever having a working driver. Now we download # the devel libraries for SDL2 and link to them directly. # Latest is something like: SDL2-devel-2.0.8-mingw.tar.gz # Unpack that where CI can see it on the builder, our standard is c:\mingw # So something like: tar -xvzf SDL2-devel-2.0.8-mingw.tar.gz cd SDL2-2.0.8 mkdir /cygdrive/c/mingw mv x86_64-w64-mingw32/* /cygdrive/c/mingw/ ## SOME NOTES ON SETTING UP GITLAB RUNNER TO BUILD ON WINDOWS ## STEP 1 - Install Gitlab Runner # https://docs.gitlab.com/runner/install/windows.html # Download from page above, run CMD prompt as Administrator and then run the runner exe in there ## STEP 2 - Register it with your server # First open Administrator CMD prompt then run the following commands. # REGISTER: Enter your Gitlab CI details - (Token is in Gitlab->Admin-Runners) gitlab-ci-multi-runner-windows-386.exe register # enter gitlab url # enter gitlab runner token # enter tag of "windows" gitlab-runner-windows-386.exe register -n \ --url http://yourgitlab.com/ci \ --registration-token UqGC2qvJmU1QBK3mx4b \ --executor shell \ --description "WinBuild" --tag-list "windows" ## STEP 3 - Install Service # Note the use of ".\IEUser" to indicate local account! gitlab-ci-multi-runner-windows-386.exe install --user .\IEUser --password Passw0rd! gitlab-ci-multi-runner-windows-386.exe install --user .\Builder --password Bu1ld3r! gitlab-runner-windows-386.exe install --user .\builder --password builder ## STEP 4 - Start service gitlab-ci-multi-runner-windows-386.exe start ## STEP 4.5 - if you get a "failed due to logon" message above, you may need to grant "logon as a service" privs #To add the "Log on as a service" right to an account on your local computer #To open Local Security Policy, click Start, point to Control Panel, point to Administrative Tools, and then double-click Local Security Policy. #In the console tree, double-click Local Policies, and then click User Rights Assignment. #In the details pane, double-click Log on as a service. #Click Add User or Group, and then add the appropriate account to the list of accounts that possess the Log on as a service right. # If you have any other problems with the service not starting due to: # "Failed to start gitlab-runner: The service did not start due to a logon failure." # Try going to Services and edit the properties of the gitlab-runner service. # Go to the "Log On" tab and re-enter the password/credentials and see if # that helps. ## STEP 5 - Make sure gitlab-runner is using the correct shell # It defaults to CMD, go to the directory where the gitlab-runner # commands were run and edit the "config.toml" file. Under the line # that says: executor = "shell" # add: shell = "bash" # # Also, make sure that if you type "bash" from a CMD prompt, # that it runs the Cygwin shell. If it can't find the bash command, # go to the Environment Variables Control Panel for your computer and # add "c:\cygwin\bin" to your PATH variable.