У меня есть сценарий gitlab-ci-yml для развертывания на моем удаленном сервере, но у меня возникла проблема при установке ssh, я уже принудительно назначил DNS, но проблема все та же, и попробовал другой образ в докере, но ничего не работает.< /p>
бегун gitlab:
[[runners]]
name = "deployment_runner"
url = "http://mygitlab-url/"
id = 9
token = "aFcyz1PhKjE1CcPvg8E3"
token_obtained_at = 2024-12-09T02:53:50Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
image = "ubuntu:20.04"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
network_mtu = 0
extra_hosts = ["host"]
dns = ["8.8.8.8", "8.8.4.4"]
gitlab-ci-yml:
stages:
- deploy
deploy:
image: ubuntu:20.04
stage: deploy
tags:
- deployment_runner
only:
- development
before_script:
- echo "nameserver 8.8.8.8" > /etc/resolv.conf
- echo "nameserver 8.8.4.4" >> /etc/resolv.conf
- cat /etc/resolv.conf
- apt-get clean
- apt-get update
- apt-get install -y dnsutils
- nslookup archive.ubuntu.com
- apt-get install -y openssh-client
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts
script:
- ssh $SSH_USER@$SSH_HOST "cd $WORK_DIR && git pull origin development && sudo docker compose restart && exit"
after_script:
- rm -rf ~/.ssh
ошибка:
20 $ echo "nameserver 8.8.8.8" > /etc/resolv.conf
21 $ echo "nameserver 8.8.4.4" >> /etc/resolv.conf
22 $ cat /etc/resolv.conf
23 nameserver 8.8.8.8
24 nameserver 8.8.4.4
25 $ apt-get clean
26 $ apt-get update
27 Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
28 Temporary failure resolving 'archive.ubuntu.com'
29 Err:2 http://security.ubuntu.com/ubunty focal-security InRelease
30 Temporary failure resolving 'security.ubuntu.com'
31 Err: 3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
32 Temporary failure resolving 'archive.ubuntu.com'
53 Err:4 http:archive.ubuntu.com/ubuntu focal-backports InRelease
34 Temporary failure resolving 'archive.ubuntu.com'
55 Reading package lists...
36 W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/focal/InRelease Temporary failure resolving 'archive.ubuntu.com'
37 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/ ... /InRelease Temporary failure resolving 'archive.ubuntu.com'
38 W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
39 W: Failed to fetch http://security.ubuntu.com/ubuntu/dists ... /InRelease Temporary failure resolving 'security.ubuntu.com'
40 W: Some index files failed to download. They have been ignored, or old ones used instead.
41 $ apt-get install -y dnsutils
42 Reading package lists...
43 Building dependency tree...
44 Reading state information...
45 E: Unable to locate package dnsutils
47 Running after_script
48 Running after_script...
49 $ rm -rf ~/.ssh
51 ERROR: Job failed: exit code 1
Подробнее здесь: https://stackoverflow.com/questions/792 ... lab-ci-yml
Невозможно установить и обновить пакеты в gitlab-ci-yml ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Невозможно установить атрибут проекта gitlab с помощью python-gitlab 4.11.1
Anonymous » » в форуме Python - 0 Ответы
- 37 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как указать на Application-local.yml вместо Application-dev.yml в IntelliJ?
Anonymous » » в форуме JAVA - 0 Ответы
- 1 Просмотры
-
Последнее сообщение Anonymous
-