From a3209ce219a18f383b2b561b4383ae8ab55d1415 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 27 Mar 2018 10:52:51 +0200 Subject: [PATCH 1/2] gitlab-ci: securely pass CI_BUILD_TOKEN in to docker login --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23d3851..119f9e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ variables: RELEASE_IMAGE: registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:latest before_script: - - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com + - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com build: stage: build From fa6f64144fbe60983a1e71570ed2ae9cdf03986e Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 27 Mar 2018 11:40:26 +0200 Subject: [PATCH 2/2] gitlab-ci: add actual test of building a repo --- .gitlab-ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 119f9e8..499af32 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,18 @@ build: test: stage: test script: - - docker run $TEST_IMAGE + - 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 '