docker-executable-fdroidserver/.gitlab-ci.yml
2022-02-20 14:38:04 +01:00

48 lines
1.1 KiB
YAML

image: docker:git
services:
- docker:dind
stages:
- build
- test
- release
variables:
TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
before_script:
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
build:
stage: build
script:
- docker build -t $TEST_IMAGE .
- docker push $TEST_IMAGE
test:
stage: test
script:
- docker run $TEST_IMAGE --version
- test -d fdroid || mkdir fdroid
- cd fdroid
- docker run -v $(pwd):/repo $TEST_IMAGE init --verbose
- apk add --no-cache wget
- wget -O repo/test.apk
https://gitlab.com/fdroid/fdroidserver/raw/1.0.3/tests/repo/info.zwanenburg.caffeinetile_4.apk
- docker run -v $(pwd):/repo $TEST_IMAGE update --verbose --create-metadata
- test -e repo/index-v1.jar
- test -e repo/index.jar
- test -e repo/index.xml
- grep -F '<application id=' repo/index.xml > /dev/null
release:
stage: release
script:
- docker pull $TEST_IMAGE
- docker tag $TEST_IMAGE $RELEASE_IMAGE
- docker push $RELEASE_IMAGE
only:
- master
except:
- schedules