gitlab-ci-runner

How can I securely push from a GitLab Runner KubernetesExecutor pod to a private container registry?

旧城冷巷雨未停 提交于 2020-03-23 12:04:21
问题 Goal Build a CI/CD pipeline multiple GitLab repositories with a certain project structure can make use of. For this, a Docker container with Python code is built and subsequently securely pushed to Google Cloud's Container Registry. Set up KubernetesExecutor is installed on Kubernetes Engine using the Helm chart as provided by GitLab. The base image for the build process ( runners.image in the values.yaml ) is a custom one as this helps automatically containerising the provided repository.

Gitlab Runner Image with GCP credentials

三世轮回 提交于 2020-03-22 08:23:27
问题 I am trying to teach my Gitlab Runner image to get custom builder images from my private Docker Registry (GCR running in the Google Cloud). What did not work out? I created a custom Gitlab Runner image with the ServiceAccount properly set. I started in in non-privileged mode but the wormhole pattern (via docker.sock ). On exec-ing into that container (which is based on gitlab/gitlab-runner:v11.3.0 ) I had to recognise that I cannot do any docker commands in there (neither as root nor as

Why is Create React App build failing in Gitlab CI Runner?

不羁的心 提交于 2020-03-04 23:10:53
问题 The contents of my Dockerfile: FROM node:alpine as builder WORKDIR /usr/src/app COPY package.json . RUN npm install COPY . . RUN npm run build || cat /root/.npm/_logs/*.log FROM nginx COPY --from=builder /usr/src/app/build /usr/share/nginx/html I've configured this to run with my own gitlab runner. This was working fine until the last time I attempted a build. On my own machine it builds without issue. Only when the gitlab runner attempts to build it does it fail. Only changes I made were to

Why is Create React App build failing in Gitlab CI Runner?

旧巷老猫 提交于 2020-03-04 23:10:46
问题 The contents of my Dockerfile: FROM node:alpine as builder WORKDIR /usr/src/app COPY package.json . RUN npm install COPY . . RUN npm run build || cat /root/.npm/_logs/*.log FROM nginx COPY --from=builder /usr/src/app/build /usr/share/nginx/html I've configured this to run with my own gitlab runner. This was working fine until the last time I attempted a build. On my own machine it builds without issue. Only when the gitlab runner attempts to build it does it fail. Only changes I made were to

How to reattach a detached HEAD in GIT

寵の児 提交于 2020-02-23 09:49:09
问题 (I can see there are many questions about this but I haven't found one that solves my exact problem). I'm running gitlab-ci and when the runner checks out my code it does so as a detached head. Here is what I get when running a git status command in the runners directory. git status # HEAD detached at 847fe59 nothing to commit, working directory clean What I need to do for what I am working on is to re-attach this head back to my develop branch and then git pull in the full repo for use in a

Gitlab docker executor - cache image after before_script

可紊 提交于 2020-02-20 07:01:48
问题 In gitlab-ci there's an option in the .gitlab-ci.yml file to execute commands before any of the actual script runs, called before_script . .gitlab-ci.yml examples illustrate installing ancillary programs here. However, what I've noticed is that these changes are not cached in Docker when using a docker executor. I had naively assumed that after running these commands, docker would cache the image, so for the next run or test, docker would just load the cached image produced after before

How can I deploy something to a k8s cluster via a k8s gitlab-ci runner?

巧了我就是萌 提交于 2020-02-02 13:31:26
问题 cat /etc/redhat-release: CentOS Linux release 7.2.1511 (Core) docker version: Client: Version: 1.13.1 API version: 1.26 Package version: <unknown> Go version: go1.8.3 Git commit: 774336d/1.13.1 Built: Wed Mar 7 17:06:16 2018 OS/Arch: linux/amd64 Server: Version: 1.13.1 API version: 1.26 (minimum version 1.12) Package version: <unknown> Go version: go1.8.3 Git commit: 774336d/1.13.1 Built: Wed Mar 7 17:06:16 2018 OS/Arch: linux/amd64 Experimental: false kubectl version: Client Version: version

Configure runner to run multiple jobs at the same time

▼魔方 西西 提交于 2020-01-31 09:35:30
问题 When having one gitlab runner serving multiple projects, it can only run one CI pipeline while the other project pipelines have to queue. Is it possible to make a gitlab runner run pipelines from all projects in parallel? I don't seem to find anywhere a configuration explanation for this. 回答1: I believe the configuration options you are looking for is concurrent and limit , which you'd change in the GitLab Runners config.toml file. From the documentation: concurrent : limits how many jobs

How do I fix bash in gitlab ci :bad substitution

Deadly 提交于 2020-01-24 20:38:17
问题 package.json script block in file: "scripts": { ... "test:schema": "./src/schemas/schema-test.sh" } .gitlab-ci.yml file contents: image: node:12 stages: - lint - test # - build .yarn_install: before_script: - yarn config set @private:registry https://npm.private.io - echo "//npm.private.io/:_authToken=${NPM_TOKEN}" > ~/.npmrc - yarn install - export PATH="./node_modules/.bin:${PATH}" prettier: stage: lint script: - yarn config set @private:registry https://npm.private.io - echo "//npm.private

gitlab-runner x509: certificate signed by unknown authority

风流意气都作罢 提交于 2020-01-23 02:17:10
问题 I'm trying to register a new runner on gitlab following these steps : https://docs.gitlab.com/runner/register/index.html but when I enter the url, token and tags. A error message pops-up saying: ERROR: Registering runner... failed runner=CS-XXX status=couldn't execute POST against https://example.com/api/v4/runners: Post https://example.com/api/v4/runners: x509: certificate signed by unknown authority I'm working on a new server and already installed the gitlab-runner 回答1: you need to use tls