Replicate GitLab CI & Runner Functionality Locally? - gitlab

In absence of network, on-site we can commit to local git repo but can't have gitlab-ci to compile project and early trobuleshoot.
How to have a localized gitlab-ci and gitlab-runner which can compile commits offline (*or alternate means) ?

The gitlab runner has an exec command which allows you to run the gitlab runner on your local machine with your local .gitlab-ci.yml configuration file.
This command allows you to run builds locally, trying to replicate the CI
environment as much as possible. It doesn't need to connect to GitLab, instead
it reads the local .gitlab-ci.yml and creates a new build environment in
which all the build steps are executed.
Though if local network troubles are often you may consider installing the gitlab on premises and connect your own local gitlab runner to it so the work is automated.

Related

Jenkins - workspace for declarative Jenkins pipeline?

I am running a test job on Jenkins, using Jenkinsfile pipeline. The job targets the node ubuntu-node.
After the job is done, when I select the "Workspace" link, I get 2 entries, for example:
Workspaces for validation_my_proj #105
/home/jenkins/workspace/validation_my_proj#script on master
/home/jenkins/workspace/validation_my_proj on ubuntu-node
Could someone explain why do I have 2 workspaces? What does the first line validation_my_proj#script on master mean?
I am having some problems with linking executable produced by the build with a shared library (using Meson build system), and I am wandering does this Workspace setup have anything to do with it, because locally all works OK, only on Jenkins not.

Gitlab No repository

Gitlab all of sudden showing no repository message on different repo. I am using docker-compose to run docker ce. I can see on file system on host machine as well as on docker container repository contain data in #hashed folder. I am able to see my ci/cd pipeline and images in container registry. but I am not able to see all my source code in repository. I have try clearing cache and run the gitlab reconfigure command. but not solve the issue.
can anyone know what could be the reason of this kind of behavior.

GitLab's runner without GitLab local installation

Is it possible to use runner with project stored on GitLab.com?
Documentation says I need an 'admin' account in order to register a runner. On GitLab.com I can only set a 'Maintainer'. Beside that, it also says not to install runners on the same machine where GitLab is installed...

how to push my code to my VPS once I push to git repo?

I have a VPS (OS: centos/debian) now. What I want is to develop my own website (RoR/python) and write some functional programs like parser, email sever and so on. What I am doing now is to write code and use ftp to push my code then use the root shell (which is lag and slow) on vps to run and debug. This is killing me. Can anyone tell me how to deal with this? And use what to replace the root shell?
Try this.
On your VPS install git
Clone your repo and checkout a branch called production or something like that
On your dev machine commit all code you want to deploy
Merge it into production branch
Login to VPS and cd into folder you cloned in step 2
git pull should bring in all changes from git on production branch
All this can be automated but if you try this with a simple html file you will understand the process and feel comfortable doing gulp or grunt based automation of each step. Ideally you can have a task runner on development machine that will run deploy task and ssh to your vps, change directory to your git folder and pull changes, may have to stash existing changes and also backup last version somewhere else and run database migration if needed etc. But dont worry about all of this at this stage.

Gitlab CI multi runner won't clone from Gitlab

Issue:
Gitlab CI Multi Runner won't clone a repository correctly so I can't start my build process
gitlab-ci-multi-runner 1.3.2 (0323456)
Using Shell executor...
Running on tests-iMac.local...
Cloning repository for master with git depth set to 5...
Cloning into '/Users/test/builds/b16789d3/0/person/project'...
fatal: Remote branch master not found in upstream origin
ERROR: Build failed: exit status 1
How/Software?
Mac OS X El Capitan as the Runner/Builder (10.11)
gitlab-ci-multi-runner 1.3.2
Omnibus Gitlab CE 8.9.6 on Centos 6 (using external NGINX)
Git Depth set to 5 (can be bigger, but I wanted to make sure the default wasn't too shallow)
So, any thoughts on why this gitlab ci multi runner setup won't pull? I know its communicating between Gitlab and the Runner since we get build errors on Gitlab pipelines and I see the errors on the Mac. I've spent too much time on it and can't figure it out!

Resources