我正在为我的项目尝试Git实验室的CI CD。我在Angular中有一个项目要部署。我的服务器将使用VPN连接。
这是我尝试过的。
deploy:
image: dperson/openvpn-client
stage: deploy
before_script:
- which openvpn # Install openvpn if not available.
- cat <<< $CLIENT_OVPN > /etc/openvpn/client.conf # Move vpn config from gitlab variable to config file.
- cat <<< $VPN_U > /etc/openvpn/pass.txt # Move vpn user from gitlab variable to pass file.
- cat <<< $VPN_P >> /etc/openvpn/pass.txt # Move vpn password from gitlab variable to pass file.
- cat <<< "auth-user-pass /etc/openvpn/pass.txt" >> /etc/openvpn/client.conf # Tell vpn config to use password file.
- cat <<< "log /etc/openvpn/client.log" >> /etc/openvpn/client.conf # Tell vpn config to use log file.
- openvpn --config /etc/openvpn/client.conf --daemon # Start openvpn with config as a deamon.
- sleep 30s # Wait for some time so the vpn can connect before doing anything else.
- cat /etc/openvpn/client.log # Print the vpn log.
- ping -c 1 <IP> # Ping the server I want to deploy to. If not available this stops the deployment process.
script:
- echo "Trying to Deploy"
tags:
- docker
但是我遇到如下错误
$ openvpn --config /etc/openvpn/client.conf --daemon
ls: /vpn/*: No such file or directory
ls: /vpn/*: No such file or directory
ERROR: Job failed: exit code 1
有人可以帮我吗?
谢谢。