马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
请问,ci/cd 报错tags不匹配,怎么解决此问题?但是注册的runner的tags标签/etc/gitlab-runner/config.toml,再加上job脚本里面的tags标签都是一样的,但是始终报错没有对应的tags,无法构建流水发版


脚本内容如下:
stages:
build_vue_project:
stage: build
tags:
- xi-admin
script:
- ls -al
- npm install
- npm run build:prod
artifacts:
paths:
- dist
expire_in: 1 hour
deploy_to_server:
stage: deploy
tags:
- xi-admin
before_script:
- which rsync || (apt update && apt install -y rsync openssh-client)
- mkdir -p ~/.ssh |
if [ "$DEPLOY_ENV" = "prod" ]; then |
echo "$SSH_PRIVATE_KEY_PROD" > ~/.ssh/id_rsa |
export SERVER_IP=192.168.1.200 |
export SERVER_USER=emma |
else |
echo "$SSH_PRIVATE_KEY_TEST" > ~/.ssh/id_rsa |
export SERVER_IP=192.168.190.61 |
export SERVER_USER=emma |
fi |
- chmod 600 ~/.ssh/id_rsa |
- ssh-keyscan -p 7490 $SERVER_IP >> ~/.ssh/known_hosts |
script: |
- rsync -avz --delete -e "ssh -p 7490" dist/$SERVER_USER@$SERVER_IP:/usr/share/nginx/html/xi-admin |
only: |
- main |
其他的配置信息,以及runner服务状态:
root@gitlab:~# cat /etc/gitlab-runner/config.toml
concurrent = 2
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "xi-adminn"
url = "https://gib.3.com"
id = 11
token = "glrt-dibSzn2D9P_xox-BfqTa"
token_obtained_at = 2025-04-23T12:33:26Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "shell"
tags = ["xi-admin"]
[runners.cache]
MaxUploadedArchiveSize = 0
root@gitlab:~#
root@gitlab:~# gitlab-runner status
Runtime platform arch=amd64 os=linux pid=336303 revision=d89a789a version=16.4.1
gitlab-runner: Service is running
root@gitlab:~#
root@gitlab:~# gitlab-runner list
Runtime platform arch=amd64 os=linux pid=336311 revision=d89a789a version=16.4.1
Listing configured runners ConfigFile=/etc/gitlab-runner/config.toml
xi-adminn Executor=shell Token=glrt-dibSzn2D9P_xox-BfqTa URL=https://gib.w3.com
root@gitlab:~#
root@gitlab:~#
root@gitlab:~# systemctl status gitlab-runner | grep running
Active: active (running) since Wed 2025-04-23 20:36:59 CST; 14h ago
root@gitlab:~#
root@gitlab:~# |