Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests in drone (dind) #131

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: pipeline
name: release

steps:
- name: build & push release
- name: build & push release image
image: thegeeklab/drone-docker-buildx:20.11@sha256:327b6fb15dc841cf80c7c429f60d695efd7c7a476fe363afac25a58befd4c203
settings:
auto_tag: true
Expand All @@ -21,13 +21,21 @@ trigger:
event:
exclude:
- pull_request
branch:
- master

---
kind: pipeline
name: pr

steps:
- name: build & push PR
- name: test
image: mazzolino/docker-shellspec
volumes:
- name: dockersock
path: /var/run

- name: build & push PR image
image: thegeeklab/drone-docker-buildx:20.11@sha256:327b6fb15dc841cf80c7c429f60d695efd7c7a476fe363afac25a58befd4c203
settings:
repo: mazzolino/restic
Expand All @@ -46,8 +54,21 @@ trigger:
event:
- pull_request

services:
- name: docker
image: docker:20.10-dind
commands:
- dockerd
privileged: true
volumes:
- name: dockersock
path: /var/run

volumes:
- name: dockersock
temp: {}
---
kind: signature
hmac: 979eb024a97a0673a421c496f9442193b3cbb401abdcd649a1d93e495b86601f
hmac: 053665109aca58a5bf25dcbc46f676367568d8ac9b3236b9dbb787332c6ab2f7

...
4 changes: 2 additions & 2 deletions spec/backup_spec.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
IMAGE=restic:dev
DOCKER="sudo -E docker"
DOCKER="docker"

Describe "backup script"
BeforeAll "setup"
Expand All @@ -24,7 +24,7 @@ Describe "backup script"
setup() {
$DOCKER build --build-arg ARCH="${ARCH:-amd64}" -t "$IMAGE" .
container=$($DOCKER run -d --entrypoint bash "$IMAGE" -c "sleep 10000")
extra_env="$(mktemp /tmp/extra.env.XXX)"
extra_env="$(mktemp /tmp/extra.env.XXXXXXXX)"
docker_exec restic init
docker_exec "mkdir -p /data && echo 123 >/data/dummy && mkdir -p /my\ data && echo 123 >/my\ data/dummy && echo 456 >/my\ data/dreck"
}
Expand Down