diff --git a/shared-ci.yml b/shared-ci.yml index a72d04752f1c00758e14c3c8da70aede79184edd..df7b27d0b60dbb112320980140d4a3490c7e5512 100644 --- a/shared-ci.yml +++ b/shared-ci.yml @@ -11,3 +11,65 @@ stages: - package - publish - autoupdate + +image: registry.git.cccv.de/infra/packages/docker-images/utility + +.autoupdate:github:release-tags: + stage: autoupdate + rules: + - if: '$RUN_AUTOUPDATE == "1"' + when: always + - when: manual + dependencies: [] + needs: [] + script: + - git clone "https://${GITLAB_ACCESS_USER}:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" autoupdate-checkout + - cd autoupdate-checkout + - wget "${SHARED_CI_SCRIPTS_URL_PREFIX}/filter-versions-from-github.py" + - chmod 555 filter-versions-from-github.py + - ./filter-versions-from-github.py + - | + git config --global user.email "infra+packages-autoupdate@cccv.de" + git config --global user.name "autoupdater" + for version in $(./filter-versions-from-github.py); do + printf "variables:\n UPSTREAM_VERSION: ${version}" > gitlabci-version.yml + git commit -m "[autoupdate] Bump version to ${version}" gitlabci-version.yml + git tag "${version}" + done + git tag --list + - git push + - git push --tags + +.build: + rules: + - if: '$RUN_AUTOUPDATE != "1"' + stage: build + dependencies: [] + needs: [] + +.package: + rules: + - if: '$RUN_AUTOUPDATE != "1"' + stage: package + +.package:apt: + extends: .package + script: + - wget "${SHARED_CI_SCRIPTS_URL_PREFIX}/create_debian-changelog-from-git.py" + - chmod 555 create_debian-changelog-from-git.py + - ./create_debian-changelog-from-git.py ${PACKAGE_NAME} > debian/changelog + - ls -lahtr + - dpkg-buildpackage -us -uc + - mv ../*.deb ./ + - cp debian/changelog ./changelog.txt + - dpkg-deb -I *.deb + - dpkg-deb -c *.deb + artifacts: + paths: + - ./*.deb + - changelog.txt + +.publish: + stage: publish + rules: + - if: '$RUN_AUTOUPDATE != "1" && $CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'