Skip to content

Commit

Permalink
feat: Release artifacts to OCI registry (#2259)
Browse files Browse the repository at this point in the history
* feat: Release artifacts to OCI registry

* chore: Addressing Alex' review
  • Loading branch information
mikolajb authored Jun 7, 2024
1 parent f8c0ed0 commit 3205744
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .exclude-airgapped
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
common/helm-repositories/ai-navigator-repos.yaml
services/ai-navigator-app
services/ai-navigator-cluster-info-agent
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ jobs:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
GIT_TAG: ${{ env.GIT_TAG }}
run: devbox run -- make release

- name: Release OCI artifact
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: devbox run -- just release-oci ${{ env.GIT_TAG }}
3 changes: 3 additions & 0 deletions .include-airgapped
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
./common
./services
./charts
3 changes: 3 additions & 0 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
"go": "1.22",
"gojq": "latest",
"golangci-lint": "latest",
"just": "latest",
"kubernetes-helm": "latest",
"kustomize": "latest",
"oras": "latest",
"pre-commit": "latest",
"rsync": "latest",
"yq-go": "latest"
},
"shell": {
Expand Down
180 changes: 180 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,90 @@
}
}
},
"just@latest": {
"last_modified": "2024-05-22T06:18:38Z",
"resolved": "github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e#just",
"source": "devbox-search",
"version": "1.26.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8vfd79m7pf8a0nc5c3yd0nf8idjnxkpr-just-1.26.0",
"default": true
},
{
"name": "man",
"path": "/nix/store/58anr0974j698srd2sgajl5f0vg18gh3-just-1.26.0-man",
"default": true
},
{
"name": "doc",
"path": "/nix/store/2snzjdjq2lghwn342827d3vzindigq3b-just-1.26.0-doc"
}
],
"store_path": "/nix/store/8vfd79m7pf8a0nc5c3yd0nf8idjnxkpr-just-1.26.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8sxppckai1jyy8psjzgkhmq3mwz4riww-just-1.26.0",
"default": true
},
{
"name": "man",
"path": "/nix/store/9bpvcgx27r0j54j460f0kiznlvcc0bii-just-1.26.0-man",
"default": true
},
{
"name": "doc",
"path": "/nix/store/lxnqvqzm8dp93pqlk074chghjgysq9a6-just-1.26.0-doc"
}
],
"store_path": "/nix/store/8sxppckai1jyy8psjzgkhmq3mwz4riww-just-1.26.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/1qyp420z5zkhbmzs9rnmmc4alrx0zz5d-just-1.26.0",
"default": true
},
{
"name": "man",
"path": "/nix/store/lyylsapjs9lzmb5mgs93dw32vqg82vh1-just-1.26.0-man",
"default": true
},
{
"name": "doc",
"path": "/nix/store/01kcg7ki1s5jhy94lsyjcaxvfqb61l6z-just-1.26.0-doc"
}
],
"store_path": "/nix/store/1qyp420z5zkhbmzs9rnmmc4alrx0zz5d-just-1.26.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/vl9pf2j6a0rld8flcw00c7mibbg0avwn-just-1.26.0",
"default": true
},
{
"name": "man",
"path": "/nix/store/g5j844iink42jw1yv2z1rksi3rxf6dr1-just-1.26.0-man",
"default": true
},
{
"name": "doc",
"path": "/nix/store/4wqnjk4rs68fmxgmdrb8wbk3bs6s9crj-just-1.26.0-doc"
}
],
"store_path": "/nix/store/vl9pf2j6a0rld8flcw00c7mibbg0avwn-just-1.26.0"
}
}
},
"kubernetes-helm@latest": {
"last_modified": "2024-01-14T03:55:27Z",
"resolved": "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538#kubernetes-helm",
Expand Down Expand Up @@ -266,6 +350,54 @@
}
}
},
"oras@latest": {
"last_modified": "2024-05-22T06:18:38Z",
"resolved": "github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e#oras",
"source": "devbox-search",
"version": "1.1.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/f9y12pd3xm7vjw12b5c37hghlnicr6il-oras-1.1.0",
"default": true
}
],
"store_path": "/nix/store/f9y12pd3xm7vjw12b5c37hghlnicr6il-oras-1.1.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/9q4l03y029mldcf9rp96anl2fjldaryi-oras-1.1.0",
"default": true
}
],
"store_path": "/nix/store/9q4l03y029mldcf9rp96anl2fjldaryi-oras-1.1.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/hnhi35hy3vl2n8833aymp16qy6ywa4ck-oras-1.1.0",
"default": true
}
],
"store_path": "/nix/store/hnhi35hy3vl2n8833aymp16qy6ywa4ck-oras-1.1.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/dnyw16g8xngg3k1zv0540azr3iz4sky0-oras-1.1.0",
"default": true
}
],
"store_path": "/nix/store/dnyw16g8xngg3k1zv0540azr3iz4sky0-oras-1.1.0"
}
}
},
"pre-commit@latest": {
"last_modified": "2024-01-14T03:55:27Z",
"resolved": "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538#pre-commit",
Expand All @@ -286,6 +418,54 @@
}
}
},
"rsync@latest": {
"last_modified": "2024-05-22T06:18:38Z",
"resolved": "github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e#rsync",
"source": "devbox-search",
"version": "3.3.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/26bv7fghqxnrr8i0hsv0ql5bvwxl2clk-rsync-3.3.0",
"default": true
}
],
"store_path": "/nix/store/26bv7fghqxnrr8i0hsv0ql5bvwxl2clk-rsync-3.3.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/c592zqv4xj8mc3rdp9d5vwr6m4mhlhvh-rsync-3.3.0",
"default": true
}
],
"store_path": "/nix/store/c592zqv4xj8mc3rdp9d5vwr6m4mhlhvh-rsync-3.3.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/rsncrpxaapgnml9sp3qxync31c0slydd-rsync-3.3.0",
"default": true
}
],
"store_path": "/nix/store/rsncrpxaapgnml9sp3qxync31c0slydd-rsync-3.3.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/mccr31lihzfldyxxifdbj56chadlrhs3-rsync-3.3.0",
"default": true
}
],
"store_path": "/nix/store/mccr31lihzfldyxxifdbj56chadlrhs3-rsync-3.3.0"
}
}
},
"yq-go@latest": {
"last_modified": "2024-01-14T03:55:27Z",
"resolved": "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538#yq-go",
Expand Down
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
registry := "registry-1.docker.io"
org_name := "mesosphere"
repository := org_name / "kommander-applications"
include_file := justfile_directory() / ".include-airgapped"
exclude_file := justfile_directory() / ".exclude-airgapped"

release-oci tag tmp_dir=`mktemp --directory`:
rsync --info=name --archive --recursive --files-from={{ include_file }} --exclude-from={{ exclude_file }} {{ justfile_directory() }} {{ tmp_dir }}
cd {{ tmp_dir }} && echo "${DOCKER_PASSWORD}" | oras push --password-stdin --username "${DOCKER_USERNAME}" --verbose {{ registry }}/{{ repository }}:{{ tag }} .

0 comments on commit 3205744

Please sign in to comment.