Skip to content

Commit

Permalink
ci: build and publish e2e test image for negative testing with drone
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Chiu <[email protected]>
  • Loading branch information
yangchiu authored and innobead committed Mar 8, 2024
1 parent 8a208cc commit c742675
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 7 deletions.
140 changes: 134 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ steps:
- name: socket
path: /var/run/docker.sock

- name: "build image"
- name: "build longhorn-manager-test image"
image: plugins/docker
settings:
dry_run: true
Expand Down Expand Up @@ -56,7 +56,7 @@ steps:
event:
- push

- name: publish-tagged-image
- name: "publish tagged longhorn-manager-test image"
image: plugins/docker
settings:
build_args:
Expand All @@ -73,6 +73,52 @@ steps:
event:
- tag

- name: "build longhorn-e2e-test image"
image: plugins/docker
settings:
dry_run: true
build_args:
- ARCH=amd64
dockerfile: e2e/Dockerfile
repo: longhornio/longhorn-e2e-test
when:
event:
- pull_request

- name: "publish longhorn-e2e-test image"
image: plugins/docker
settings:
build_args:
- ARCH=amd64
custom_dns: 1.1.1.1
dockerfile: e2e/Dockerfile
password:
from_secret: docker_password
repo: longhornio/longhorn-e2e-test
tag: "${DRONE_BRANCH}-head-amd64"
username:
from_secret: docker_username
when:
event:
- push

- name: "publish tagged longhorn-e2e-test image"
image: plugins/docker
settings:
build_args:
- ARCH=amd64
custom_dns: 1.1.1.1
dockerfile: e2e/Dockerfile
password:
from_secret: docker_password
repo: longhornio/longhorn-e2e-test
tag: "${DRONE_TAG}-amd64"
username:
from_secret: docker_username
when:
event:
- tag

volumes:
- name: socket
host:
Expand Down Expand Up @@ -107,7 +153,7 @@ steps:
- name: socket
path: /var/run/docker.sock

- name: "build image"
- name: "build longhorn-manager-test image"
image: plugins/docker
settings:
dry_run: true
Expand Down Expand Up @@ -136,7 +182,7 @@ steps:
event:
- push

- name: publish-tagged-image
- name: "publish tagged longhorn-manager-test image"
image: plugins/docker
settings:
build_args:
Expand All @@ -153,6 +199,52 @@ steps:
event:
- tag

- name: "build longhorn-e2e-test image"
image: plugins/docker
settings:
dry_run: true
build_args:
- ARCH=arm64
dockerfile: e2e/Dockerfile
repo: longhornio/longhorn-e2e-test
when:
event:
- pull_request

- name: "publish longhorn-e2e-test image"
image: plugins/docker
settings:
build_args:
- ARCH=arm64
custom_dns: 1.1.1.1
dockerfile: e2e/Dockerfile
password:
from_secret: docker_password
repo: longhornio/longhorn-e2e-test
tag: "${DRONE_BRANCH}-head-arm64"
username:
from_secret: docker_username
when:
event:
- push

- name: "publish tagged longhorn-e2e-test image"
image: plugins/docker
settings:
build_args:
- ARCH=arm64
custom_dns: 1.1.1.1
dockerfile: e2e/Dockerfile
password:
from_secret: docker_password
repo: longhornio/longhorn-e2e-test
tag: "${DRONE_TAG}-arm64"
username:
from_secret: docker_username
when:
event:
- tag

volumes:
- name: socket
host:
Expand All @@ -172,7 +264,7 @@ trigger:
- v*

steps:
- name: manifest
- name: "publish longhorn-manager-test manifest"
image: plugins/manifest:1
settings:
username:
Expand All @@ -190,7 +282,7 @@ steps:
event:
- push

- name: manifest-tag
- name: "publish tagged longhorn-manager-test manifest"
image: plugins/manifest:1
settings:
username:
Expand All @@ -208,6 +300,42 @@ steps:
event:
- tag

- name: "publish longhorn-e2e-test manifest"
image: plugins/manifest:1
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
target: "longhornio/longhorn-e2e-test:${DRONE_BRANCH}-head"
template: "longhornio/longhorn-e2e-test:${DRONE_BRANCH}-head-ARCH"
when:
instance:
- drone-publish.longhorn.io
event:
- push

- name: "publish tagged longhorn-e2e-test manifest"
image: plugins/manifest:1
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
target: "longhornio/longhorn-e2e-test:${DRONE_TAG}"
template: "longhornio/longhorn-e2e-test:${DRONE_TAG}-ARCH"
when:
instance:
- drone-publish.longhorn.io
event:
- tag

depends_on:
- default-amd64
- default-arm64
2 changes: 1 addition & 1 deletion e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG YQ_VERSION=v4.24.2
ARG ARCH=amd64

RUN zypper ref -f
RUN zypper in -y vim-small nfs-client xfsprogs e2fsprogs util-linux-systemd gcc python39-devel gawk java-11-openjdk tar awk gzip wget && \
RUN zypper in -y vim-small nfs-client xfsprogs e2fsprogs util-linux-systemd gcc python311-devel gawk java-11-openjdk tar awk gzip wget && \
rm -rf /var/cache/zypp/*

RUN curl -sO https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/${ARCH}/kubectl && \
Expand Down

0 comments on commit c742675

Please sign in to comment.