From b0fbd8edf6c376233f32e3aa2c2fe836bfefa0c7 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 13 Sep 2023 08:13:30 +0200 Subject: [PATCH] Add addiontal container image deployment targets (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### :book: Summary Adds additional deployment targets: - GitHub Container registry - Docker Hub - updates woddpecker workflow to version `>1.0.0 syntax` - fix workflow file names - update woodpecker/buildx plugin to version `2`. This enables multiple targets with one build step #### :bookmark_tabs: Test Plan > :bulb: Select your test plan for the code changes. | Choice | Test Method | | :----: | :----------- | | ✅ | CI pipeline tests | | | Custom test | | | No test plan | ##### Details / Justification #### :books: Additional Notes Co-authored-by: OCram85 Reviewed-on: https://gitea.ocram85.com/CodeServer/arkanum/pulls/63 --- .woodpecker/.deploy.yml | 49 -------------------- .woodpecker/.next.yml | 32 ------------- .woodpecker/deploy.yml | 71 +++++++++++++++++++++++++++++ .woodpecker/next.yml | 57 +++++++++++++++++++++++ .woodpecker/{.test.yml => test.yml} | 2 +- README.md | 15 ++++-- 6 files changed, 141 insertions(+), 85 deletions(-) delete mode 100644 .woodpecker/.deploy.yml delete mode 100644 .woodpecker/.next.yml create mode 100644 .woodpecker/deploy.yml create mode 100644 .woodpecker/next.yml rename .woodpecker/{.test.yml => test.yml} (97%) diff --git a/.woodpecker/.deploy.yml b/.woodpecker/.deploy.yml deleted file mode 100644 index a3dfa79..0000000 --- a/.woodpecker/.deploy.yml +++ /dev/null @@ -1,49 +0,0 @@ -depends_on: - - test - -pipeline: - buildImage: - image: woodpeckerci/plugin-docker-buildx - settings: - registry: gitea.ocram85.com - repo: gitea.ocram85.com/codeserver/arkanum - dockerfile: Dockerfile - auto_tag: true - username: - from_secret: gitea_user - password: - from_secret: gitea_passwd - build_args: - - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} - - TAG=${CI_COMMIT_TAG} - when: - event: push - branch: master - - buildTag: - image: woodpeckerci/plugin-docker-buildx - settings: - registry: gitea.ocram85.com - repo: gitea.ocram85.com/codeserver/arkanum - dockerfile: Dockerfile - auto_tag: true - username: - from_secret: gitea_user - password: - from_secret: gitea_passwd - build_args: - - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} - - TAG=${CI_COMMIT_TAG} - when: - event: tag - - GiteaRelease: - image: plugins/gitea-release - settings: - api_key: - from_secret: RENOVATE_TOKEN - base_url: https://gitea.ocram85.com - title: ${CI_COMMIT_TAG} - note: "> :bulb: **Note:** See [CHANGELOG.md](src/branch/master/CHANGELOG.md) for recent changes." - when: - event: tag diff --git a/.woodpecker/.next.yml b/.woodpecker/.next.yml deleted file mode 100644 index db5525b..0000000 --- a/.woodpecker/.next.yml +++ /dev/null @@ -1,32 +0,0 @@ -depends_on: - - test - -pipeline: - buildTestImage: - image: woodpeckerci/plugin-docker-buildx - settings: - #dry_run: true - registry: gitea.ocram85.com - repo: gitea.ocram85.com/codeserver/arkanum - platforms: linux/amd64 - dockerfile: Dockerfile - tags: next - username: - from_secret: gitea_user - password: - from_secret: gitea_passwd - build_args: - - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} - - TAG=${CI_COMMIT_TAG} - when: - event: pull_request - - triggerPortainer: - image: ocram85/portainer-serviceupdate - settings: - VERBOSE: true - URI: "https://portainer.ocram85.com" - TOKEN: - from_secret: NEXT_TOKEN - when: - event: pull_request diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml new file mode 100644 index 0000000..b125443 --- /dev/null +++ b/.woodpecker/deploy.yml @@ -0,0 +1,71 @@ +depends_on: + - test + +variables: + # deployment targets + - &publish_repos 'ocram85/arkanum,gitea.ocram85.com/codeserver/arkanum,ghcr.io/ocram85/arkanum,codeberg.org/codeserver/arkanum' + # logins for deployment targets + - publish_logins: &publish_logins + # Default DockerHub login + - registry: https://index.docker.io/v1/ + username: + from_secret: docker_user + password: + from_secret: docker_passwd + # Additional Quay.IO login + - registry: https://gitea.ocram85.com + username: + from_secret: gitea_user + password: + from_secret: gitea_passwd + # GitHub Container Registry + - registry: https://ghcr.io + username: + from_secret: github_user + password: + from_secret: github_passwd + # Codeberg + - registry: https://codeberg.org + username: + from_secret: codeberg_user + password: + from_secret: codeberg_passwd + +steps: + latest: + image: woodpeckerci/plugin-docker-buildx:2 + settings: + repo: *publish_repos + dockerfile: Dockerfile + auto_tag: true + logins: *publish_logins + build_args: + - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + - TAG=${CI_COMMIT_TAG} + when: + event: push + branch: master + + release: + image: woodpeckerci/plugin-docker-buildx:2 + settings: + repo: *publish_repos + dockerfile: Dockerfile + auto_tag: true + logins: *publish_logins + build_args: + - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + - TAG=${CI_COMMIT_TAG} + when: + event: tag + + GiteaRelease: + image: plugins/gitea-release + settings: + api_key: + from_secret: RENOVATE_TOKEN + base_url: https://gitea.ocram85.com + title: ${CI_COMMIT_TAG} + note: "> :bulb: **Note:** See [CHANGELOG.md](src/branch/master/CHANGELOG.md) for recent changes." + when: + event: tag diff --git a/.woodpecker/next.yml b/.woodpecker/next.yml new file mode 100644 index 0000000..91eba06 --- /dev/null +++ b/.woodpecker/next.yml @@ -0,0 +1,57 @@ +depends_on: + - test + +when: + event: pull_request + +variables: + # deployment targets + - &publish_repos 'ocram85/arkanum,gitea.ocram85.com/codeserver/arkanum,ghcr.io/ocram85/arkanum,codeberg.org/codeserver/arkanum' + # logins for deployment targets + - publish_logins: &publish_logins + # Default DockerHub login + - registry: https://index.docker.io/v1/ + username: + from_secret: docker_user + password: + from_secret: docker_passwd + # Additional Quay.IO login + - registry: https://gitea.ocram85.com + username: + from_secret: gitea_user + password: + from_secret: gitea_passwd + # GitHub Container Registry + - registry: https://ghcr.io + username: + from_secret: github_user + password: + from_secret: github_passwd + # Codeberg + - registry: https://codeberg.org + username: + from_secret: codeberg_user + password: + from_secret: codeberg_passwd + +steps: + buildTestImage: + image: woodpeckerci/plugin-docker-buildx:2 + settings: + #dry_run: true + repo: *publish_repos + dockerfile: Dockerfile + platforms: linux/amd64 + tag: next + logins: *publish_logins + build_args: + - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + - TAG=${CI_COMMIT_TAG} + + triggerPortainer: + image: ocram85/portainer-serviceupdate + settings: + VERBOSE: true + URI: "https://portainer.ocram85.com" + TOKEN: + from_secret: NEXT_TOKEN diff --git a/.woodpecker/.test.yml b/.woodpecker/test.yml similarity index 97% rename from .woodpecker/.test.yml rename to .woodpecker/test.yml index ad2f79b..d6b3551 100644 --- a/.woodpecker/.test.yml +++ b/.woodpecker/test.yml @@ -1,4 +1,4 @@ -pipeline: +steps: testDockerfile: image: woodpeckerci/plugin-docker-buildx settings: diff --git a/README.md b/README.md index 647814e..90e4ace 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,19 @@ You can download the image from the gitea embedded container registry: `gitea.oc - `latest` - Is based on the lasted master branch commit. - `next` - Is a test build based on the pull request -- `1`, `0.1`, `0.1.0` - tag based version. +- `1`, `0.1`, `0.1.0`, `1.0.0` - tag based version. > **💡 NOTE: See the [packages page](https://gitea.ocram85.com/CodeServer/-/packages/container/arkanum/latest) for latest version and all other available tags.** +The container images are also published to these registries: + +- [Docker Hub](https://hub.docker.com/r/ocram85/arkanum) + - Pull Endpoint: `ocram85/arkanum` +- [GitHub Container Registry](https://github.com/OCram85/arkanum/pkgs/container/arkanum) + - Pull Endpoint: `ghcr.io/ocram85/arkanum` +- [Codeberg Packages](https://codeberg.org/codeserver/-/packages/container/arkanum/next) +- Pull Endpoint: `codeberg.org/codeserver/arkanum` + ### 2.a Run as Docker Swarm Stack This example shows how to run arkanum as an additional swarm stack. @@ -246,9 +255,9 @@ following command: ```bash # restart the installation -arkanum --install-extensions +arkanum config install-extensions # Optional: reset the vscode user setting -arkanum --reset-codesetting +arkanum config reset-codesettings # Reload with command F1 + Developer: Reload Window ``` ## 😡 We're Using GitHub Under Protest