Hot answers tagged

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.


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 ...


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 ...


6

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....


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 ...


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

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 ...


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

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 ...


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

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.


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

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 - "Skipping jobs"


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

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

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

Neil, it's because the = sign in your /etc/gitlab/gitlab.rb file. When you'll look on the full comment before the external_url line, you'll see a link to the documentation: ## GitLab URL ##! URL on which GitLab will be reachable. ##! For more details on configuring external_url see: ##! https://docs.gitlab.com/omnibus/settings/configuration.html#...


3

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


3

Consider to substitute the version in POM by the git describe upon build without hardcoding the version in your repository, you could do this with e.g. sed from below version_slug. export git_version=`git describe --tags --always` export version_slug="$(sed s/-/\./g <<<$git_version)" and then substitute the version_slug in pom. In that way for ...


3

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/...


2

I'm going to assume that you have a way to know if the commit is empty or not. You can use the following code to mark the job as a success instead of relying on error codes. if( some use case ) { currentBuild.result = 'SUCCESS' echo "Job succeeded." return } You have two options for placement. Putting this inside a stage will exit only that ...


2

Looks like this is actually an issue


2

On GitHub - you can't. Basically, their PRs are temporary branches, and there's no check if base commit is HEAD of branch to merge in. This problem is solved with gating systems like Zuul, which puts all PRs into queue to run tests. You are talking about systems for managing and storing code, while the issue is in CI scope (i.e. Gitlab flow has this issue ...


2

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 ...


2

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 ...


2

There currently isn't a solution for building on a specific runner in GitLab, but there is an issue open for Sticky Runners, which hopefully will be out in the next 3-6 months according to the Milestones! The work around I've done so far to build a project on a specific runner is to use the GitLab Runner API, in a rather hacky way, along the lines of: Get ...


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