-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.appveyor.yml
61 lines (52 loc) · 2.14 KB
/
.appveyor.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
shallow_clone: true
# turn of support for MS project build support (not needed)
build: off
environment:
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
matrix:
- job_name: sshd
- job_name: httpd
cache:
- $(job_name).dockerimg.gz -> recipes/$(job_name)/*
artifacts:
- path: $(job_name).dockerimg.gz
name: $(job_name) Docker image
type: File
- path: recipes/sshd/id_rsa
name: SSH private key
type: File
- path: recipes/sshd/id_rsa.pub
name: SSH public key
type: File
init:
# needs APPVEYOR_SSH_KEY defined in project settings (or environment)
- curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
build_script:
- echo ${APPVEYOR_JOB_NAME}
- export DOCKER_CONTAINER_NAME="${APPVEYOR_JOB_NAME}"
- export DOCKER_CONTAINER_SPECPATH="recipes/${APPVEYOR_JOB_NAME}"
- export DOCKER_IMAGE_FILE="${APPVEYOR_JOB_NAME}.dockerimg.gz"
# if there is no image cached already, build one, and write it out in
# compressed from (to save on cache quota and network IO)
- "[ ! -f \"${DOCKER_IMAGE_FILE}\" ] && ( docker build -t \"${DOCKER_CONTAINER_NAME}\" \"${DOCKER_CONTAINER_SPECPATH}\" && docker save \"${DOCKER_CONTAINER_NAME}\" | gzip -9 > \"${DOCKER_IMAGE_FILE}\" ) || true"
# job-specific configurations
for:
- matrix:
only:
- job_name: sshd
before_test:
# mount point to be shared with the container
- mkdir -p mnt-in-docker
# deploy docker container
- gzip -c -d "${APPVEYOR_JOB_NAME}.dockerimg.gz" | docker load
- docker run --rm -dit --name "${APPVEYOR_JOB_NAME}" -p 2222:22 -v "$(pwd)/mnt-in-docker:/mnt/" "${APPVEYOR_JOB_NAME}"
# establish expected permission setup for SSH key
- chmod 600 recipes/sshd/id_rsa
# wipe any other known host keys
- ssh-keygen -f "/home/appveyor/.ssh/known_hosts" -R "[localhost]:2222"
# ingest actual host key
- ssh-keyscan -t ecdsa -p 2222 -H localhost >> ~/.ssh/known_hosts
test_script:
# check working SSH login and mounts of the docker containers
- touch mnt-in-docker/probe
- ssh -i recipes/sshd/id_rsa -p 2222 sshuser@localhost test -f /mnt/probe