简单的gitlab-ci shell配置以获取服务器上的文件

时间:2020-02-26 16:11:23

标签: git shell gitlab gitlab-ci gitlab-ci-runner

我正在尝试设置将.py脚本部署到服务器上。

我的shell运行器具有以下设置:

check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "Scripts server"
  url = "..."
  token = "..."
  executor = "shell"
  shell = "bash"

我的gitlab-ci看起来像:

stages:
  - pull
  - cron

pull_from_git:
  stage: pull
  script:
    - sudo cd /home/alexey.panfilov@mo.msk/Scripts
    - sudo git checkout master && git pull origin master

replace_cron:
  stage: cron
  script:
    - sudo rm /etc/cron.d/clickhouse-upload
    - sudo cp /home/alexey.panfilov@mo.msk/Scripts/clickhouse-upload /etc/cron.d/

我唯一可以从gitlab中获得的东西是:

[0KRunning with gitlab-runner 12.8.0 (1b659122)
[0;m[0K  on Scripts server tmb8Ssxy
[0;msection_start:1582733020:prepare_executor
[0K[0KUsing Shell executor...
[0;msection_end:1582733020:prepare_executor
[0Ksection_start:1582733020:prepare_script
[0KRunning on awd2spt1...
section_end:1582733020:prepare_script
[0Ksection_start:1582733020:upload_artifacts_on_failure
[0Ksection_end:1582733020:upload_artifacts_on_failure
[0K[31;1mERROR: Job failed: exit status 1
[0;m

我应该怎么做才能开始工作?

0 个答案:

没有答案
相关问题