我有一个gitlab ci设置,我想在其中启动本地npm服务器以在后台进行测试。我.gitlab-ci.yml就像:
stages:
- setup
- build
- test
cache:
paths:
- venv/
- node_modules/
setup_nvm:
stage: setup
script:
- "echo installing npm and phantomJS via nvm"
- "git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`"
- ". ~/.nvm/nvm.sh"
- "nvm install 5.0"
- "nvm use 5.0"
- "npm install"
- "nohup npm run dev &" # HERE I TRY TO RUN THE SERVER IN THE BACKGROUND
setup_python:
stage: setup
script:
- …Run Code Online (Sandbox Code Playgroud) 我gitlab-ci.yml安装了python-pandas,但是无法从python使用它。
$ cat .gitlab-ci.yml
image: python:2
test:
script:
- apt-get update -qy
- apt-get install -y python-pip python-pandas
- ls /usr/local/lib/python2.7/site-packages
- python -c 'import pandas'
Run Code Online (Sandbox Code Playgroud)
跑步者失败,并显示以下消息:
$ python -c 'import pandas'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named pandas
ERROR: Build failed: exit code 1
Run Code Online (Sandbox Code Playgroud)
我尝试不按要求安装带有pip的熊猫(旧的熊猫lib足够用了)而且非常想了解为什么不暴露python软件包?这看起来像一个隐式的virtualenv!?
我希望Gitlab CI可以获取另一个项目的源代码。有没有比添加只读部署密钥并在.gitlab-ci.yml中进行设置更好的方法?
我想使用 GitLab CI 构建 docker 镜像并将其推送到我的本地 nexus 存储库
这是我当前的 CI 文件:
image: docker:latest
services:
- docker:dind
before_script:
- docker info
- docker login -u some_user -p nexus-rfit some_host
stages:
- build
build-deploy-ubuntu-image:
stage: build
script:
- docker build -t some_host/dev-image:ubuntu ./ubuntu/
- docker push some_host/dev-image:ubuntu
only:
- master
when: manual
Run Code Online (Sandbox Code Playgroud)
也有一个 alpin docker 的工作,但是当我想运行它时,它失败并出现以下错误:
检出 13102ac4 作为主...跳过 Git 子模块设置 $ docker info 无法连接到 unix:///var/run/docker.sock 上的 Docker 守护进程。docker 守护进程是否正在运行?错误:作业失败:退出代码 1
所以从技术上讲,镜像中的 docker 守护进程没有运行,但我不知道为什么?
我在解析 a 时遇到问题 build使用 Gitlab-CI 在阶段之间目录时。
Gitlab-CI 会在看起来很奇怪的阶段之间擦除创建的构建工件。我试图在构建和测试阶段之间存储构建工件,但是构建阶段也有我想要保留的构建工件以及运行下一阶段所需的构建工件。
是否可以使用该artifacts选项在不同路径下设置多个到期时间?
我尝试了以下方法,它只保留paths(构建/测试* 路径)的第二个定义,而不是paths声明的第一个(.dmg)。
artifacts:
paths:
- build/*.dmg
expire_in: 1 week
paths:
- build/test1
- build/test2
- build/test3
expire_in: 15 mins
Run Code Online (Sandbox Code Playgroud)
我曾尝试使用caches但似乎无法使其正常工作......任何建议将不胜感激!
当我在作业日志中将 gitlab 与 docker 一起使用时,我可以获得以下信息:
Running with gitlab-ci-multi-runner 9.5.0 (413da38)
on platform-docker-orc (2c06225e)
Using Docker executor with image registry:5000/local_image: ...
Using docker image sha256:db4434f2a9c3529af30397031df5bc1277f13882e0f6613a8c8f9c059645c04d for predefined container...
Pulling docker image registry:5000/local_image ...
Using docker image registry:5000/local_image ID=sha256:8d1cac8ae6371b01505e9cd3aaf654696cc144117a9c89dcd21cf4c0d9cfa709 for build container...
Running on runner-2c06225e-project-99-concurrent-0 via a96c0c765ce7...
Run Code Online (Sandbox Code Playgroud)
如何获取执行 gitlab 作业的容器 ID?
在 .gitlab-ci.yml 中运行此命令:
task:
script:
- yes | true
- yes | someOtherCommandWhichNeedsYOrN
Run Code Online (Sandbox Code Playgroud)
返回:
$ yes | true
ERROR: Job failed: exit status 1
Run Code Online (Sandbox Code Playgroud)
任何线索,为什么会发生这种情况或如何调试的想法?
设置:在 docker 中运行 Gitlab
由于mysql 8中的新哈希算法,我无法在gitlab中针对此mysql版本成功运行CI测试.
我相信这也适用于其他CI引擎.
让我们假设我.gitlab-ci.yml就像那样简单:
build:
stage: build
image: chilio/laravel-dusk-ci:stable
services:
- mysql:8.0
script:
- cp .env.example .env
- composer install
- php artisan migrate
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
Run Code Online (Sandbox Code Playgroud)
我找到了不同的帖子,关于重新配置mysql实例,但这个图像是官方的mysql docker,我相信它应该以相同的方式工作,跨不同的版本......
来自mysql的图片:5.5到5.7没有引入任何问题,但是使用mysql:8.0我收到错误,如前所述......
到目前为止,我还没有找到任何解决方案来解决这个问题.
有任何想法吗?
When I run my job on Gitlab CI/CD, after a while I obtain the following error message:
Job's log exceeded limit of 4194304 bytes.
Run Code Online (Sandbox Code Playgroud)
How to change this limit?