Hot answers tagged

29

Yes, there is: If your commit message contains [ci skip] or [skip ci], using any capitalization, the commit will be created but the pipeline will be skipped. Alternatively, one can pass the ci.skip Git push option if using Git 2.10 or newer: git push -o ci.skip From: GitLab CI YAML documentation - "Skip Pipeline"


13

You can only view text/source code files, Markdown files and images. Gitlab doesn't have a preview option for other files such as proprietary word processors.


12

I tried to change docker image and added couple steps for git tag. Below is the answer worked for me, image: maven stages: - build - deploy - tag maven_build: stage: build script: - mvn clean package artifacts: paths: - target/*.jar after_script: - ls -a - cd target && ls -a - git --version - git remote remove origin ...


9

Conceptually, this approach is not the way to go; the build directory is not a deployment directory, it's a temporary directory, to build or to deploy from, whereas on a shell executor this could be fixed. So what you need is to deploy from that directory with a script as per gitlab-ci.yml below, to the correct directory of deployment. stages: - deploy ...


9

In my automatic jenkins job, launched daily, if there are no changes the git commit command returns 1. That will mark the build as failed. To solve this problem I use these two commands in my shell build step: git add -A git diff-index --quiet HEAD || git commit -m "Jenkins automatic update commit" the first will eventually add all unstaged files in the ...


8

No, you can't have multiple gitlab-ci files per repository. You can see more information in the following links : https://gitlab.com/gitlab-org/gitlab-foss/issues/18157 https://gitlab.com/gitlab-org/gitlab-foss/issues/28592 Now, there are some work in progress about this, but it's not available yet. For example, you can see here ( https://gitlab.com/...


8

I might have skipped the optional installation of docker in my Ubuntu instance, so if the gitlab runner is going to use Docker, remember to install it: curl -sSL https://get.docker.com/ | sh I got back to this issue and seem to have partially fixed it by checking it the gitlab runner is running gitlab-runner status systemctl is-enabled gitlab-runner ...


7

To me the easiest route to this would be to have an instance of an artifactory running. There are several choices out there many of which have an open-source, community or free version that would support maven repositories. Most options will support caching remote repositories (maven central for example) which can then be curated to enforce specific ...


7

As described in the documentation you are following to install on the first paragraph: You can download a binary for every available version as described in Bleeding Edge - download any other tagged release. Following the link in this sentence allow your to find the tag list page Last version in 1.X (Hence compatible with 8.X versions of Gitlab is 1....


7

Here's the way I do it: no plugin required, just triggering Jenkins api from gitlab-ci. Gitlab-CI I will assume you have a gitlab-ci runner installed and configured. First, you need to have a .gitlab-ci.yml file in your project having a basic structure such as: stages: - my-jenkins-trigger variables: MY_VARIABLE: "EVERYTHING_IS_AWESOME" my-jenkins-...


6

In order to get a success, you need to avoid non-zero exit codes. A simple solution would be to change the last line of your script to git commit -a -m 'Changes pushed by Jenkins' || true, but better solutions would parse the output of git-add and only run git-commit when there is something to commit.


6

Management Summary Set the pull_policy to "never" in the [runners.docker] section by calling: docker exec -it gitlab-runner \ vi /etc/gitlab-runner/config.toml Detailed Description It seemed the problem was a confusion with images and mounted volumes. The documentation says to configure runners in: /etc/gitlab-runner/config.toml Which I did, but on ...


6

There are lots of bad examples on the Internet. Doing a git pull to distribute code is fabulous for development, but prone to all sorts of issues in practice. It should not be used for production deploys without careful consideration of the negative consequences. What happens when somebody checks out a different branch? You'll be sad when you keep git ...


6

Since .gitlab-ci.yml is a Yaml file, then just use it's syntax. For example, you may use >: image: ubuntu before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client rsync git -y )' - mkdir -p ~/.ssh - chmod 700 ~/.ssh - echo -e "$PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - '[[ -...


5

I think the major deciding factor is the expertise of you and the rest of your company in the chosen OS. If you are a Windows shop, and your company is willing to leverage the cost of the node, it's probably best choice to host it on a Windows VM. For choosing a Linux distro, I would see what is most common across your company. In my opinion, it is not worth ...


5

This has been answered over on SO using a work around seeing as it doesn't seem possible according to the documents. Basically, this can be done in 3 stages. Stage 1: Build and store all artifacts. build_stage: script: - build artifacts: paths: - build/*.dmg - build/test1 - build/test2 - build/test3 expire_in: 15 mins ...


5

Looks like you are using the Gitlab plugin for jenkins? if so this link should be of help https://github.com/jenkinsci/gitlab-plugin#declarative-pipeline-jobs


4

The error looks like you're using a non-existent reference (branch/tag). Try specifying the correct branch and tag using the branch/tag options. You can also use the commit hash directly using ref option. Also ensure that your git URL is correct (your code does not contain the xxx.git part).


4

Monorepos are nice because it eliminates the technical constraints between multiple projects. This does however open the door to other complications within your repository (naming conventions, cross-team dependencies, merge conflict increases, etc.). I do not have any experience with CircleCI, but I will provide some input based on other CI tools I have used....


4

stages are required stages: - stage1 stage1: stage: stage1 script: - echo hello Could you try the following: before_script: - pushd . && uru 233 && popd && set HOME=c:\ && ruby -v && bundle install stages: - rspec - rubocop - flay rspec: stage: rspec script: - bundle exec rspec rubocop: ...


4

After some research i found out that shared runners are good for the projects that are very much the same, and specific runners are better for the projects that are not like any project. Shared runners can eat all resources available in the end with its queue's which makes specific runners more interesting. My choice now is more like a little bit of both, ...


4

A word document is not a source document that is fit for version control, it's a proprietary binary file. For version control, try to learn a real source document like e.g. Markdown or AsciiDoc. In this way you'll be able to preview in Gitlab or Github, even with Windows. While still being able to publish it after rendering it with e.g. Pandoc to a .docx ...


4

In the error message you presented your system is reporting port 443 is already in use. You need to confirm which ports you have in use for other services. listen tcp 0.0.0.0:443: bind: address already in use For what it is worth I recommend you use a nginx reverse proxy. Please reference https://stackoverflow.com/questions/46195852/how-to-run-gitlab-in-...


4

Caching of layers with buildkit in an external registry requires an extra step or two depending on how you want to cache your layers. The easy option is to include a build arg that enables the inline cache: docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ${LATEST} -t ${LATEST} -t ${IMAGE_COMMIT_TAG} . Note that the inline cache only caches ...


4

It seems to me that you're looking for an artifact store such as Nexus or Artifactory. Both solutions have Jenkins plugins which will simplify the process of uploading your artifacts to them. You can find an example as to how to upload artifacts from your Jenkins pipeline to Nexus in this link and an example for Artifactory in this link. Both solutions are ...


3

FWIW, the trigger you referenced originates from Gitlab repository events, not from a GitlabCI execution. The only possibility (that crosses my mind) of triggering a jenkins job from inside a GitlabCI execution is by having a (custom?) script invoked as part of the GitlabCI execution which remotely activates a Parameterized Trigger Plugin configured for ...


3

You're missing the --non-interactive tag to your registration command. Full command should be: gitlab-runner register --non-interactive --locked false --run-untagged true --tag-list java --name foo --registration-token %token% --url https://myurl --executor shell Relevant documentation for non-interactive registration.


3

Weird Docker. I changed the WORKDIR in the Dockerfile and it worked: FROM postgres:9.6 WORKDIR /builds/user/ ADD repo/script.sql /docker-entrypoint-initdb.d/ EDIT The /builds folder does not exist on the host system. I thought that adding it to the runner's config would create a volume container that would be shared between containers. But no. So I ...


3

It seems you're trying to define the artifacts globally, that won't work with multiple paths since you're overwriting the definition of the key. Instead you should define the paths per job. artifacts: expire_in: 1 week build:buildjob paths: - build/test1 - build/test2 - build/test3 expire_in: 15 mins test:testjob paths: ...


3

Gitlab CI supports running all of your builds inside Docker containers so you have a clean build environment every time. I'd recommend starting with the basic Docker executor but there is also an opportunity to autoscale your runners using Docker Machine or to execute the runners on a Kubernetes pod. If you need to use Docker as part of your build (such as ...


Only top voted, non community-wiki answers of a minimum length are eligible