diff --git a/.drone.jsonnet b/.drone.jsonnet deleted file mode 100644 index addab7a..0000000 --- a/.drone.jsonnet +++ /dev/null @@ -1,148 +0,0 @@ -local PipelineBuild(arch='amd64') = { - kind: 'pipeline', - name: 'build-' + arch, - platform: { - os: 'linux', - arch: arch, - }, - steps: [ - { - name: 'dryrun', - image: 'plugins/docker', - settings: { - dry_run: true, - dockerfile: 'Dockerfile', - repo: 'xoxys/${DRONE_REPO_NAME}', - username: { from_secret: 'docker_username' }, - password: { from_secret: 'docker_password' }, - build_args: [ - 'BUILD_VERSION=${DRONE_TAG%-*}', - ], - }, - when: { - ref: [ - 'refs/pull/**', - ], - }, - }, - { - name: 'publish', - image: 'plugins/docker', - settings: { - auto_tag: true, - auto_tag_suffix: arch, - dockerfile: 'Dockerfile', - repo: 'xoxys/${DRONE_REPO_NAME}', - username: { from_secret: 'docker_username' }, - password: { from_secret: 'docker_password' }, - build_args: [ - 'BUILD_VERSION=${DRONE_TAG%-*}', - ], - }, - when: { - ref: [ - 'refs/heads/master', - 'refs/tags/**', - ], - }, - }, - { - name: 'publish-gitea', - image: 'plugins/gitea-release', - settings: { - api_key: { from_secret: 'gitea_token' }, - base_url: 'https://gitea.rknet.org', - overwrite: true, - title: '${DRONE_TAG}', - note: 'CHANGELOG.md', - }, - when: { - ref: ['refs/tags/**'], - }, - }, - ], -}; - -local PipelineNotifications(depends_on=[]) = { - kind: 'pipeline', - name: 'notifications', - platform: { - os: 'linux', - arch: 'amd64', - }, - steps: [ - { - image: 'plugins/manifest', - name: 'manifest', - settings: { - ignore_missing: true, - tags: [ - '${DRONE_TAG}', - '${DRONE_TAG%-*}', - '${DRONE_TAG%.*}', - '${DRONE_TAG%%.*}', - ], - username: { from_secret: 'docker_username' }, - password: { from_secret: 'docker_password' }, - spec: 'manifest.tmpl', - }, - when: { - status: [ - 'success', - ], - }, - }, - { - name: 'readme', - image: 'sheogorath/readme-to-dockerhub', - environment: { - DOCKERHUB_USERNAME: { from_secret: 'docker_username' }, - DOCKERHUB_PASSWORD: { from_secret: 'docker_password' }, - DOCKERHUB_REPO_PREFIX: 'xoxys', - DOCKERHUB_REPO_NAME: '${DRONE_REPO_NAME}', - README_PATH: 'README.md', - SHORT_DESCRIPTION: 'Molecule - Automated Ansible roles testing', - }, - when: { - status: [ - 'success', - ], - }, - }, - { - name: 'matrix', - image: 'plugins/matrix', - settings: { - homeserver: { from_secret: 'matrix_homeserver' }, - roomid: { from_secret: 'matrix_roomid' }, - template: 'Status: **{{ build.status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
Message: {{ build.message }}', - username: { from_secret: 'matrix_username' }, - password: { from_secret: 'matrix_password' }, - }, - when: { - status: [ - 'success', - 'failure', - ], - }, - }, - ], - trigger: { - ref: [ - 'refs/heads/master', - 'refs/tags/**', - ], - status: [ - 'success', - 'failure', - ], - }, - depends_on: depends_on, -}; - -[ - PipelineBuild(arch='amd64'), - PipelineNotifications(depends_on=[ - 'build-amd64', - ]), -] diff --git a/.drone.yml b/.drone.yml index e69fe89..5641d25 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: build-amd64 +name: build-container platform: os: linux @@ -23,11 +23,21 @@ steps: ref: - refs/pull/** +- name: tags + image: xoxys/docker-autotag + environment: + DOCKER_AUTOTAG_FORCE_LATEST: True + DOCKER_AUTOTAG_IGNORE_PRERELEASE: True + DOCKER_AUTOTAG_OUTPUT_FILE: .tags + DOCKER_AUTOTAG_VERSION: ${DRONE_TAG} + when: + ref: + - refs/heads/master + - refs/tags/** + - name: publish image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: amd64 build_args: - BUILD_VERSION=${DRONE_TAG%-*} dockerfile: Dockerfile @@ -63,24 +73,6 @@ platform: arch: amd64 steps: -- name: manifest - image: plugins/manifest - settings: - ignore_missing: true - password: - from_secret: docker_password - spec: manifest.tmpl - tags: - - ${DRONE_TAG} - - ${DRONE_TAG%-*} - - ${DRONE_TAG%.*} - - ${DRONE_TAG%%.*} - username: - from_secret: docker_username - when: - status: - - success - - name: readme image: sheogorath/readme-to-dockerhub environment: @@ -122,10 +114,10 @@ trigger: - failure depends_on: -- build-amd64 +- build-container --- kind: signature -hmac: 461d7541c6d7b1b46499d8d391ae5f9145845aa41e71787e0a79fea27803e4d1 +hmac: 481cc5c3443cd199617fc9418ffbe01ed478aafa8340d382f9f6e011a1c44671 ... diff --git a/CHANGELOG.md b/CHANGELOG.md index c5c6fd6..5e72199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ * ENHANCEMENT * upstream version update - * use python 3.8 base image - * update ansible to v2.9.6 +* INTERNAL + * simplify repo structure and ci diff --git a/manifest.tmpl b/manifest.tmpl deleted file mode 100644 index 52bcb85..0000000 --- a/manifest.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -image: xoxys/molecule:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} -{{#if build.tags}} -tags: -{{#each build.tags}} - {{#if this}} - - {{trimPrefix "v" this}} - - {{trimPrefix "v" this}}-amd64 - {{/if}} -{{/each}} -{{/if}} -manifests: - - image: xoxys/molecule:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64 - platform: - architecture: amd64 - os: linux