サーバ

Updated 2 years ago by Admin

serverセクションを使用して、リモートsshサーバを構成します。ランナーはこのサーバに接続し、sshプロトコルを使用してパイプラインコマンドを実行します。

1   kind: pipeline
2 type: ssh
3 name: default
4
5 server:
6 host: 1.2.3.4
7 user: root
8 password: correct-horse-battery-staple
9
10 steps:
11 - name: build
12 commands:
13 - go build
14 - go test


シークレット

上記の例では、サーバアドレスとログイン資格情報をハードコーディングしました。セキュリティ上の理由から、これらの値はシークレットから取得する必要があります。

5   server:
6 host:
7 from_secret: host
8 user:
9 from_secret: username
10 password:
11 from_secret: password
12
13 steps:
14 - name: build
15 commands:
16 - go build
17 - go test


SSHキー

5   server:
6 host:
7 from_secret: host
8 user:
9 from_secret: username
10 ssh_key:
11 from_secret: ssh_key


How did we do?