Skip to content

Commit

Permalink
.gitlab-ci.yml: added docker cross-platform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alesmrazek committed Nov 12, 2024
1 parent 44cb652 commit 2d97f44
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,20 @@ build:macOS:
- amd64
- dind

# docker:build:
# <<: *docker
# <<: *multi_platform
# stage: build
# variables:
# DOCKER_IMAGE_NAME: knot-resolver:${PLATFORM}
# script:
# - docker buildx build --no-cache -t ${DOCKER_IMAGE_NAME} .
# after_script:
# - docker rmi ${DOCKER_IMAGE_NAME}
# - docker rmi $(docker images -f "dangling=true" -q)
# tags:
# - ${PLATFORM}
# - dind

docker:build:
docker:build:native:
<<: *docker
<<: *multi_platform
stage: build
script:
- docker buildx build --no-cache -t knot-resolver:${PLATFORM} .
after_script:
- docker rmi knot-resolver:${PLATFORM}
- docker rmi $(docker images -f "dangling=true" -q)
tags:
- ${PLATFORM}
- dind

docker:build:cross-platform:
<<: *docker
stage: build
# only:
Expand All @@ -246,14 +244,29 @@ docker:build:
--tag ${GITLAB_REGISTRY}:${CI_COMMIT_REF_NAME}
.
docker:test:
<<: *docker
<<: *multi_platform
image: debian:12-slim
# needs:
# - docker:build:native
# - docker:build:cross-platform
services:
- name: ${GITLAB_REGISTRY}:${CI_COMMIT_REF_NAME}
alias: knot-resolver
before_script:
- apt-get -y install dnsutils
script:
- dig nic.cz @knot-resolver

docker:deploy:
<<: *docker
stage: deploy
when: manual
# only:
# - tags
needs:
- docker:build
- docker:test
before_script:
- echo "$DOCKER_HUB_TOKEN" | docker login -u $DOCKER_HUB_USER --password-stdin
script:
Expand Down

0 comments on commit 2d97f44

Please sign in to comment.