image: debian:buster stages: - lint - build - checking - deploy run-lint: stage: lint allow_failure: true tags: - debian before_script: - apt-get update - apt-get install -y rubocop script: - rubocop # Build package using dpkg-buildpackage run-build: stage: build tags: - debian - generic script: - echo 'Acquire::http { Proxy "http://rapperswil:3142"; };' > /etc/apt/apt.conf.d/02proxy - apt-get update -qy - apt-get install -y dpkg-dev debhelper - dpkg-buildpackage -us -uc - mkdir build-artifacts - mv ../mlmmj-ldap-sync_* build-artifacts/ artifacts: paths: - build-artifacts # Check built package using lintian. run-checking: stage: checking tags: - debian - generic script: - echo 'Acquire::http { Proxy "http://rapperswil:3142"; };' > /etc/apt/apt.conf.d/02proxy - apt-get update -qy - apt-get install -y lintian - lintian -i build-artifacts/mlmmj-ldap-sync*.changes # Deploy the built package to rapperswil run-deploy: stage: deploy variables: only: - tags tags: - debian - generic before_script: - 'which ssh-agent || (apt-get update -qy && apt-get install openssh-client -y)' - eval $(ssh-agent -s) - echo "$CD_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh - echo "$CD_SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts script: - apt-get update -qy - apt-get install -y dput - 'echo "$CD_MINIDINSTALL_CONFIG" > ~/.dput.cf' - 'dput -u gnugen build-artifacts/mlmmj-ldap-sync*.changes'