diff --git a/.drone.yml b/.drone.yml index 25e4f74..502c575 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,45 +1,84 @@ -# this is needed by the RPM build plugin -workspace: - base: /build - path: / +kind: pipeline +name: default -pipeline: - - create_targz: - image: libreschool-automation/rpm-pack:latest - files: - - root - - README.md - - COPYING +steps: + - name: create_targz + image: registry.libreschool.org/libreschool-automation/rpm-pack:latest + pull: always + settings: + files: + - root + - README.md + - COPYING when: - event: [ push, tag ] + event: [ push, tag, deployment ] - build: - image: libreschool-automation/rpm-build:latest + - name: build + image: registry.libreschool.org/libreschool-automation/rpm-build:6 + pull: always + working_dir: /build commands: - yum-builddep -y nethserver-usercsvimport.spec - rpmbuild -ba nethserver-usercsvimport.spec - mkdir out ; mv *.rpm noarch/*.rpm out/ when: - event: [ push, tag ] + event: [ push, tag, deployment ] - pkg_sign: - image: libreschool-automation/rpm-sign - files: out/*.rpm - secrets: [ gpg_key, passphrase ] + - name: sign + image: registry.libreschool.org/libreschool-automation/rpm-sign:latest + pull: always + working_dir: /build + settings: + files: out/*.rpm + gpg_key: + from_secret: gpg_key + passphrase: + from_secret: passphrase when: - event: tag - - gitea_release: - group: deploy + event: [ push, tag, deployment ] + + - name: gitea_release image: plugins/gitea-release - files: out/*.rpm - checksum: - - md5 - - sha1 - - sha256 - - sha512 - secrets: [ gitea_token ] - base_url: https://git.libreschool.org + settings: + files: out/*.rpm + checksum: + - md5 + - sha1 + - sha256 + - sha512 + api_key: + from_secret: gitea_token + base_url: https://git.libreschool.org + file_exists: skip when: event: tag + + - name: repo_upload + image: appleboy/drone-scp + settings: + source: out/*.noarch.rpm + target: /vhosts/repo.libreschool.org/https/nethserver/6/${DEPLOY_ENVIRONMENT}/x86_64/Packages/ + host: repo.libreschool.org + username: + from_secret: ssh_username + key: + from_secret: ssh_key + when: + event: deployment + repo: LibreSchool/nethserver-usercsvimport + environment: ${DEPLOY_ENVIRONMENT} + + - name: repo_upload_srpms + image: appleboy/drone-scp + settings: + source: out/*.src.rpm + target: /vhosts/repo.libreschool.org/https/nethserver/6/${DEPLOY_ENVIRONMENT}/Source/SPackages/ + host: repo.libreschool.org + username: + from_secret: ssh_username + key: + from_secret: ssh_key + when: + event: deployment + repo: LibreSchool/nethserver-usercsvimport + environment: ${DEPLOY_ENVIRONMENT} \ No newline at end of file