mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-30 09:41:11 -05:00
de0dbb8579
(cherry picked from commitc2a7aaeee8
) (cherry picked from commit6b6007fbce
) (cherry picked from commit63608a221e
) (cherry picked from commit5cfe60baa7
) (cherry picked from commit2af4c73d12
) (cherry picked from commit1985959bfe
) (cherry picked from commit880424c77e
) (cherry picked from commitc78a861d1b
) (cherry picked from commit25c1227011
) (cherry picked from commit7195e894ee
) (cherry picked from commitcf15153873
) (cherry picked from commit9bee773c95
) (cherry picked from commit581c3060da
) (cherry picked from commitbf550f9b2c
) (cherry picked from commitb570eca0b9
) [CI] implementation: Woodpecker based CI (squash) Upgrade xgo to Go v1.20 for building binaries (cherry picked from commit6308c776b6
) [CI] v1.20: switch PR check from Woodpecker CI to Forgejo Actions The PR checks for v1.19 still rely on Woodpecker CI. Keeping .woodpecker in v1.20 while both Woodpecker CI & Forgejo Actions are enabled would dupicate the checks. The release process in releases remains Woodpecker CI. (cherry picked from commit93e42f3f53
) (cherry picked from commit599c5162ad
) (cherry picked from commit6f8b723a55
) (cherry picked from commite238d7d72f
) (cherry picked from commit93e3ebff86
) (cherry picked from commit26bc89ed7b
) (cherry picked from commit8a9ff9b0a4
)
70 lines
2 KiB
Bash
Executable file
70 lines
2 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
set -ex
|
|
|
|
image_delete() {
|
|
curl -sS -H @$TOKEN_HEADER -X DELETE https://$DOMAIN/v2/$1/forgejo/manifests/$2
|
|
}
|
|
|
|
#
|
|
# Create the same set of images that buildx would
|
|
#
|
|
test_setup() {
|
|
dir=$(dirname $0)
|
|
|
|
for suffix in '' '-rootless' ; do
|
|
(
|
|
cd $dir
|
|
manifests=""
|
|
for arch in $ARCHS ; do
|
|
image=$(arch_image_name $PULL_USER $arch $suffix)
|
|
docker build -f Dockerfile$suffix --platform linux/$arch -t $image .
|
|
docker push $image
|
|
images="$images $image"
|
|
done
|
|
manifest=$(image_name $PULL_USER $suffix)
|
|
docker manifest rm $manifest || true
|
|
docker manifest create $manifest $images
|
|
image_put $PULL_USER $(image_tag $suffix) $manifest
|
|
)
|
|
done
|
|
}
|
|
|
|
test_teardown() {
|
|
authenticate
|
|
for suffix in '' '-rootless' ; do
|
|
image_delete $PULL_USER $(image_tag $suffix)
|
|
image_delete $PUSH_USER $(image_tag $suffix)
|
|
image_delete $PUSH_USER $(short_image_tag $suffix)
|
|
for arch in $ARCHS ; do
|
|
image_delete $PULL_USER $(arch_image_tag $arch $suffix)
|
|
image_delete $PUSH_USER $(arch_image_tag $arch $suffix)
|
|
done
|
|
done
|
|
}
|
|
|
|
#
|
|
# Running the test locally instead of within Woodpecker
|
|
#
|
|
# 1. Setup: obtain a token at https://codeberg.org/user/settings/applications
|
|
# 2. Run: RELEASETEAMUSER=<username> RELEASETEAMTOKEn=<apptoken> container-images-pull-verify-push-test.sh test_run
|
|
# 3. Verify: (optional) manual verification at https://codeberg.org/<username>/-/packages/container/forgejo/versions
|
|
# 4. Cleanup: RELEASETEAMUSER=<username> RELEASETEAMTOKEn=<apptoken> container-images-pull-verify-push-test.sh test_teardown
|
|
#
|
|
test_run() {
|
|
boot
|
|
test_teardown
|
|
test_setup
|
|
VERIFY_STRING=something
|
|
VERIFY_COMMAND="echo $VERIFY_STRING"
|
|
echo "================================ TEST BEGIN"
|
|
main
|
|
echo "================================ TEST END"
|
|
}
|
|
|
|
: ${CI_REPO_OWNER:=dachary}
|
|
: ${PULL_USER:=$CI_REPO_OWNER}
|
|
: ${PUSH_USER:=$CI_REPO_OWNER}
|
|
: ${CI_COMMIT_TAG:=v17.1.42-2}
|
|
|
|
. $(dirname $0)/container-images-pull-verify-push.sh
|