From 6fbd74c617d7dd1491b4b64e20e99e4d95110d84 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Wed, 20 Dec 2023 23:18:01 -0800 Subject: [PATCH] Add config to publish Snapcraft packages --- .github/workflows/ci.yml | 9 +++++++++ .goreleaser.yml | 15 +++++++++++++++ README.md | 10 ++++++++++ 3 files changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bb7330b..f810ddb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,14 @@ jobs: uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3.0 if: github.ref_type == 'tag' + - name: Setup Snapcraft + run: | + sudo apt-get update + sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft + mkdir -p $HOME/.cache/snapcraft/download + mkdir -p $HOME/.cache/snapcraft/stage-packages + if: github.ref_type == 'tag' + - name: Build binaries uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 with: @@ -110,3 +118,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GOPATH: ${{ steps.go.outputs.go_path }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }} + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 937aafe4..34a50b53 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -116,3 +116,18 @@ milestones: snapshot: name_template: 'edge' + +snapcrafts: + - summary: NGINX Plus Integration with Cloud Autoscaling + description: | + This package contains software that integrates NGINX Plus + with AWS Auto Scaling groups and Azure Virtual Machine Scale Set + grade: devel + confinement: strict + publish: true + license: 'BSD 2-Clause' + apps: + nginx-asg-sync: + command: nginx-asg-sync + plugs: ["network", "network-bind"] + disable: "{{ if .IsSnapshot }}true{{ end }}" diff --git a/README.md b/README.md index f50bed6e..9a3cdc0f 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ Support for other operating systems or architectures can be added. ## Installation +### Manual Installation + 1. Get a software package for your OS: - For a stable release, download a package from the [releases page](https://github.com/nginxinc/nginx-asg-sync/releases). - For the latest source code from the main branch, build a software package by following [these @@ -73,6 +75,14 @@ Support for other operating systems or architectures can be added. - For CentOS/RHEL based OSs, run: `sudo rpm -i .rpm` - For Debian based OSs, run: `sudo dpkg -i .deb` +### Snap Installation + +You can install the NGINX Plus Integration with Cloud Autoscaling from the [Snap Store](https://snapcraft.io/nginx-asg-sync). + +```console +sudo snap install nginx-asg-sync +``` + ### NGINX Plus Configuration As an example, we configure NGINX Plus to load balance two groups of instances -- backend-group-one and