diff --git a/.drone.jsonnet b/.drone.jsonnet index 17fe699..fcf4275 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -64,6 +64,24 @@ local gen_pipeline(distro) = }, }; +local gen_release() = + {kind: 'pipeline', + type: 'docker', + name: 'Generate Release' + commands: [ + 'sleep 10', // give docker enough time to start + 'mkdir ${DRONE_REPO_NAME}', + 'rsync -a . ${DRONE_REPO_NAME} --exclude ${DRONE_REPO_NAME}', + 'cd ${DRONE_REPO_NAME}', + 'tar -czf ../${DRONE_REPO_NAME}.${DRONE_TAG}.tar.gz ./*', // Create an archive of the role + 'curl --user ${GITEA_USER}:${GITEA_TOKEN} --upload-file ../${DRONE_REPO_NAME}.${DRONE_TAG}.tar.gz \ + https://${GITEA_URL}/api/packages/${GITEA_REPOUSER}/generic/ansible-role-common/${DRONE_TAG}/${DRONE_REPO_NAME}.${DRONE_TAG}.tar.gz', + ], + when: + { event: {include: ['tag']}, + }, + }, + // Generate the output [ gen_pipeline('centos7'), @@ -72,10 +90,12 @@ local gen_pipeline(distro) = gen_pipeline('debian11'), {kind: 'pipeline', type: 'docker', - name: 'Notify', + name: 'Notify normal', steps: [email_notification()], when: - { status: [ 'success', 'failure' ] }, + { status: [ 'success', 'failure' ] , + event: {exclude: ['tag']}, + }, depends_on: ['Test on %(distro)s' % { distro: distro } for distro in distros]