gitlab代码仓库提交监控,含有远端仓库提交脚本时,因为路径、脚本问题出现“未成功提交到远端仓库时”,如果程序无法解决,需要手动PostgreSQL数据库,找到记录并修改其状态为成功。修改步骤如下:
1.
进入postgresql命令所在目录
cd /opt/gitlab/embedded/postgresql/9.6.5/bin/
运行以下命令进入 postgresql 命令行交互模式
./psql -h 127.0.0.1 -d gitlabhq_production -U gitlab
2.
将以下 projects.name 字段的 值 换成你要修改的项目的名字,执行后看是不是你要找的 未成功提交代码到 Bitbucket 仓库 的记录:
select ci_pipelines.id, ref, sha, before_sha, ci_pipelines.created_at, ci_pipelines.updated_at, tag, yaml_errors, committed_at, project_id, status, started_at, finished_at, duration, user_id, lock_version, auto_canceled_by_id, pipeline_schedule_id, source, protected, config_source, ci_pipelines.failure_reason, projects.name from ci_pipelines right join projects on project_id = projects.id where projects.name = ‘base_auto_service’ and status = ‘failed’;
3.
确认没错的话,记录下 ci_pipelines.id 的值,将一下命令的 ci_pipelines.id 字段的值换成你记录的值,执行:
update ci_pipelines set status = ‘success’ where ci_pipelines.id = ‘10627’ (10627 是你记录下的值)
4.
执行以下命令,看status字段是不是已经修改成功:
select ci_pipelines.id, ref, sha, before_sha, ci_pipelines.created_at, ci_pipelines.updated_at, tag, yaml_errors, committed_at, project_id, status, started_at, finished_at, duration, user_id, lock_version, auto_canceled_by_id, pipeline_schedule_id, source, protected, config_source, ci_pipelines.failure_reason, projects.name from ci_pipelines right join projects on project_id = projects.id where projects.name = ‘base_auto_service’ and ci_pipelines.id = “你记录的值”;