diff --git a/.drone.jsonnet b/.drone.jsonnet index 138cf7a..7a0d6bb 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,100 +1,144 @@ -local PipelineBuild(os='linux', arch='amd64') = { - local tag = os + '-' + arch, - local file_suffix = std.strReplace(tag, '-', '.'), - kind: "pipeline", - name: tag, +local PipelineBuild(arch='amd64') = { + kind: 'pipeline', + name: 'build-' + arch, platform: { - os: os, + os: 'linux', arch: arch, }, steps: [ { name: 'dryrun', - image: 'plugins/docker:' + tag, - pull: 'always', + image: 'plugins/docker', settings: { dry_run: true, - tags: tag, - dockerfile: 'docker/Dockerfile.' + file_suffix, - repo: ' xoxys/rpmbuild', - username: { from_secret: "docker_username" }, - password: { from_secret: "docker_password" }, + dockerfile: 'Dockerfile', + repo: 'xoxys/${DRONE_REPO_NAME}', + username: { from_secret: 'docker_username' }, + password: { from_secret: 'docker_password' }, + build_args: [], + }, + when: { + ref: [ + 'refs/pull/**', + ], }, }, { name: 'publish', - image: 'plugins/docker:' + tag, - pull: 'always', + image: 'plugins/docker', settings: { auto_tag: true, - auto_tag_suffix: tag, - dockerfile: 'docker/Dockerfile.' + file_suffix, - repo: ' xoxys/rpmbuild', - username: { from_secret: "docker_username" }, - password: { from_secret: "docker_password" }, + auto_tag_suffix: arch, + dockerfile: 'Dockerfile', + repo: 'xoxys/${DRONE_REPO_NAME}', + username: { from_secret: 'docker_username' }, + password: { from_secret: 'docker_password' }, + build_args: [], }, when: { - branch: [ "master" ], + 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", + kind: 'pipeline', + name: 'notifications', platform: { - os: "linux", - arch: "amd64", + os: 'linux', + arch: 'amd64', }, steps: [ { - image: "plugins/manifest", - name: "manifest", - pull: "always", + image: 'plugins/manifest', + name: 'manifest', settings: { ignore_missing: true, - username: { from_secret: "docker_username" }, - password: { from_secret: "docker_password" }, - spec: "docker/manifest.tmpl", + tags: [ + '${DRONE_TAG}', + '${DRONE_TAG%-*}', + '${DRONE_TAG%.*}', + '${DRONE_TAG%%.*}', + ], + username: { from_secret: 'docker_username' }, + password: { from_secret: 'docker_password' }, + spec: 'manifest.tmpl', }, when: { - branch: [ "master" ], + status: [ + 'success', + ], }, }, { - name: "microbadger", - image: "plugins/webhook", - pull: "always", - settings: { - urls: { from_secret: "microbadger_url" }, + 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: 'Rootless NGINX - High-performance HTTP server and reverse proxy', + }, + when: { + status: [ + 'success', + ], }, }, { - image: "plugins/matrix", - name: "matrix", - pull: 'always', + name: 'matrix', + image: 'plugins/matrix', settings: { - homeserver: "https://matrix.rknet.org", - roomid: "MtidqQXWWAtQcByBhH:rknet.org", - 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" }, + 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" ], + status: [ + 'success', + 'failure', + ], }, }, ], trigger: { - status: [ "success", "failure" ], + ref: [ + 'refs/heads/master', + 'refs/tags/**', + ], + status: [ + 'success', + 'failure', + ], }, depends_on: depends_on, }; [ - PipelineBuild(os='linux', arch='amd64'), + PipelineBuild(arch='amd64'), PipelineNotifications(depends_on=[ - "linux-amd64" - ]) + 'build-amd64', + ]), ] diff --git a/.drone.yml b/.drone.yml index 50bf3ee..64acfb4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: linux-amd64 +name: build-amd64 platform: os: linux @@ -8,33 +8,47 @@ platform: steps: - name: dryrun - pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker settings: - dockerfile: docker/Dockerfile.linux.amd64 + dockerfile: Dockerfile dry_run: true password: from_secret: docker_password - repo: xoxys/rpmbuild - tags: linux-amd64 - username: - from_secret: docker_username - -- name: publish - pull: always - image: plugins/docker:linux-amd64 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - dockerfile: docker/Dockerfile.linux.amd64 - password: - from_secret: docker_password - repo: xoxys/rpmbuild + repo: xoxys/${DRONE_REPO_NAME} username: from_secret: docker_username when: - branch: - - master + ref: + - refs/pull/** + +- name: publish + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: amd64 + dockerfile: Dockerfile + password: + from_secret: docker_password + repo: xoxys/${DRONE_REPO_NAME} + username: + from_secret: docker_username + 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 + note: CHANGELOG.md + overwrite: true + title: ${DRONE_TAG} + when: + ref: + - refs/tags/** --- kind: pipeline @@ -46,34 +60,47 @@ platform: steps: - name: manifest - pull: always image: plugins/manifest settings: ignore_missing: true password: from_secret: docker_password - spec: docker/manifest.tmpl + spec: manifest.tmpl + tags: + - ${DRONE_TAG} + - ${DRONE_TAG%-*} + - ${DRONE_TAG%.*} + - ${DRONE_TAG%%.*} username: from_secret: docker_username when: - branch: - - master + status: + - success -- name: microbadger - pull: always - image: plugins/webhook - settings: - urls: - from_secret: microbadger_url +- name: readme + image: sheogorath/readme-to-dockerhub + environment: + DOCKERHUB_PASSWORD: + from_secret: docker_password + DOCKERHUB_REPO_NAME: ${DRONE_REPO_NAME} + DOCKERHUB_REPO_PREFIX: xoxys + DOCKERHUB_USERNAME: + from_secret: docker_username + README_PATH: README.md + SHORT_DESCRIPTION: Rootless NGINX - High-performance HTTP server and reverse proxy + when: + status: + - success - name: matrix - pull: always image: plugins/matrix settings: - homeserver: https://matrix.rknet.org + homeserver: + from_secret: matrix_homeserver password: from_secret: matrix_password - roomid: MtidqQXWWAtQcByBhH:rknet.org + 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 @@ -83,11 +110,18 @@ steps: - failure trigger: + ref: + - refs/heads/master + - refs/tags/** status: - success - failure depends_on: -- linux-amd64 +- build-amd64 + +--- +kind: signature +hmac: 7a2b31b7decc0bb838efc3daa40e12d3bd6e07da4cbe48b6472546781b83eabe ... diff --git a/docker/Dockerfile.linux.amd64 b/Dockerfile similarity index 100% rename from docker/Dockerfile.linux.amd64 rename to Dockerfile index 0e7276a..ab537c7 100644 --- a/docker/Dockerfile.linux.amd64 +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN yum-config-manager --add-repo http://www.nasm.us/nasm.repo && \ yum install -y \ gcc gcc-c++ \ libtool libtool-ltdl \ + gnutls \ gnutls-devel \ pam-devel \ dbus-devel \ @@ -26,7 +27,6 @@ RUN yum-config-manager --add-repo http://www.nasm.us/nasm.repo && \ nasm \ perl \ python \ - gnutls \ yasm \ which \ libva-devel \ diff --git a/docker/manifest.tmpl b/manifest.tmpl similarity index 100% rename from docker/manifest.tmpl rename to manifest.tmpl