This repository has been archived by the owner on Jun 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
67 lines (67 loc) · 1.49 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
language: ruby
cache: bundler
services:
- docker
env:
global:
- WASH_VERSION=0.19.0
before_script:
- curl -sfL https://github.com/puppetlabs/wash/releases/download/${WASH_VERSION}/wash-${WASH_VERSION}-x86_64-unknown-linux.tgz | tar -xzC ~/bin
# Run a custom Dockerfile with locale and several users for testing
- docker build spec -t sshd
- docker run -d -p 22 --name test_sshd sshd
script:
- PORT=$(docker port test_sshd 22 | cut -f2 -d:)
- CWD=$(pwd)
# Test user Boltdir with v1 inventory
- mkdir -p ~/.puppetlabs/bolt
- touch ~/.puppetlabs/bolt/bolt.yaml
- |
cat << EOF > ~/.puppetlabs/bolt/inventory.yaml
version: 1
nodes:
- name: localhost
config:
transport: ssh
ssh:
port: ${PORT}
user: bolt
sudo-password: bolt
run-as: root
private-key: ${CWD}/spec/fixtures/keys/id_rsa
host-key-check: false
EOF
- wash validate ./bolt
# Test local Boltdir with v2 inventory
- touch bolt.yaml
- |
cat << EOF > inventory.yaml
version: 2
targets:
- uri: localhost
config:
transport: ssh
ssh:
port: ${PORT}
user: root
password: root
host-key-check: false
EOF
- |
cat << EOF > wash.yaml
external-plugins:
- script: ${CWD}/bolt
bolt:
dir: ${CWD}
EOF
- wash validate bolt --config-file wash.yaml
# Test Docker transport
- |
cat << EOF > inventory.yaml
version: 2
targets:
- uri: test_sshd
config:
transport: docker
EOF
- wash validate bolt --config-file wash.yaml