Skip to content

Commit

Permalink
Add sonic-vs image (#573)
Browse files Browse the repository at this point in the history
Just an import of the gz archive.

Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored Nov 4, 2024
1 parent 9dd6daa commit 93b25cd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/build-sonic-vs-container-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: Build sonic-vs container image

"on":
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
push:
paths:
- .github/workflows/build-sonic-vs-container-image.yml
- sonic-vs/**
branches:
- main
pull_request:
paths:
- .github/workflows/build-sonic-vs-container-image.yml
- sonic-vs/**

jobs:

build-sonic-vs-container-image:
runs-on: ubuntu-latest
strategy:
matrix:
version:
- latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup docker
uses: docker/setup-buildx-action@v3

- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: github.ref == 'refs/heads/main'

- name: Build container image
run: scripts/build.sh
env:
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
IMAGE: sonic-vs
REPOSITORY: osism/sonic-vs
VERSION: ${{ matrix.version }}

- name: Push container image
run: |
scripts/push.sh
env:
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
IMAGE: sonic-vs
REPOSITORY: osism/sonic-vs
VERSION: ${{ matrix.version }}
if: |
github.repository == 'osism/container-images' &&
github.ref == 'refs/heads/main'
7 changes: 6 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ if [[ -n $DOCKER_REGISTRY ]]; then
fi

pushd $IMAGE
if [[ $IMAGE == "cephclient" ]]; then
if [[ $IMAGE == "sonic-vs" ]]; then
# URL from https://sonic.software/
wget -q -O docker-sonic-vs.gz "https://artprodcus3.artifacts.visualstudio.com/Af91412a5-a906-4990-9d7c-f697b81fc04d/be1b070f-be15-4154-aade-b1d3bfb17054/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL21zc29uaWMvcHJvamVjdElkL2JlMWIwNzBmLWJlMTUtNDE1NC1hYWRlLWIxZDNiZmIxNzA1NC9idWlsZElkLzY4NTMzNi9hcnRpZmFjdE5hbWUvc29uaWMtYnVpbGRpbWFnZS52cw2/content?format=file&subpath=/target/docker-sonic-vs.gz"
docker load --input docker-sonic-vs.gz
docker tag docker-sonic-vs:latest $DOCKER_REGISTRY/$REPOSITORY:$VERSION
elif [[ $IMAGE == "cephclient" ]]; then
if [[ $VERSION == "quincy" ]]; then
DEBIAN_VERSION=bullseye
else
Expand Down
Empty file added sonic-vs/.gitkeep
Empty file.

0 comments on commit 93b25cd

Please sign in to comment.