|
696 | 696 | expectMockArgs "" |
697 | 697 | } |
698 | 698 |
|
| 699 | +@test "it respects no_push when building multiple platforms" { |
| 700 | + export GITHUB_REF='refs/heads/main' |
| 701 | + export INPUT_PLATFORMS='linux/amd64,linux/arm64' |
| 702 | + export INPUT_NO_PUSH='true' |
| 703 | + |
| 704 | + cat <<EOT >> metadata.json |
| 705 | +{ |
| 706 | + "containerimage.buildinfo/linux/amd64": { |
| 707 | + "frontend": "dockerfile.v0", |
| 708 | + "attrs": { |
| 709 | + "filename": "Dockerfile" |
| 710 | + }, |
| 711 | + "sources": [ |
| 712 | + { |
| 713 | + "type": "docker-image", |
| 714 | + "ref": "docker.io/library/alpine:latest", |
| 715 | + "pin": "sha256:7580ece7963bfa863801466c0a488f11c86f85d9988051a9f9c68cb27f6b7872" |
| 716 | + } |
| 717 | + ] |
| 718 | + }, |
| 719 | + "containerimage.buildinfo/linux/arm64": { |
| 720 | + "frontend": "dockerfile.v0", |
| 721 | + "attrs": { |
| 722 | + "filename": "Dockerfile" |
| 723 | + }, |
| 724 | + "sources": [ |
| 725 | + { |
| 726 | + "type": "docker-image", |
| 727 | + "ref": "docker.io/library/alpine:latest", |
| 728 | + "pin": "sha256:7580ece7963bfa863801466c0a488f11c86f85d9988051a9f9c68cb27f6b7872" |
| 729 | + } |
| 730 | + ] |
| 731 | + }, |
| 732 | + "containerimage.descriptor": { |
| 733 | + "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", |
| 734 | + "digest": "sha256:aa2c7631cc1bbf588192ec7e55b428ad92fe63834200303f28e93444d7fc114a", |
| 735 | + "size": 741 |
| 736 | + }, |
| 737 | + "containerimage.digest": "sha256:aa2c7631cc1bbf588192ec7e55b428ad92fe63834200303f28e93444d7fc114a", |
| 738 | + "image.name": "my/repository:latest" |
| 739 | +} |
| 740 | +EOT |
| 741 | + |
| 742 | + run /entrypoint.sh |
| 743 | + |
| 744 | + expectMockCalledContains "/usr/local/mock/docker login -u USERNAME --password-stdin |
| 745 | +/usr/local/mock/docker buildx build --metadata-file metadata.json --platform linux/amd64,linux/arm64 -t my/repository:latest . |
| 746 | +/usr/local/mock/docker logout" |
| 747 | + expectMockArgs "" |
| 748 | +} |
| 749 | + |
699 | 750 | expectStdOutIs() { |
700 | 751 | local expected=$(echo "${1}" | tr -d '\n') |
701 | 752 | local got=$(echo "${output}" | tr -d '\n') |
|
0 commit comments