Skip to content

Commit 5b95211

Browse files
committed
WIP
1 parent 046b176 commit 5b95211

File tree

4 files changed

+287
-278
lines changed

4 files changed

+287
-278
lines changed

.github/workflows/docker-build.yml

Lines changed: 153 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -91,159 +91,162 @@ jobs:
9191
VCS_REF=${{ github.sha }}
9292
VERSION=${{ steps.meta.outputs.version }}
9393
94-
build-slim:
95-
name: Build Slim Image
96-
runs-on: ubuntu-latest
97-
permissions:
98-
contents: read
99-
packages: write
100-
101-
steps:
102-
- name: Checkout repository
103-
uses: actions/checkout@v4
104-
105-
- name: Set up QEMU
106-
uses: docker/setup-qemu-action@v3
107-
108-
- name: Set up Docker Buildx
109-
uses: docker/setup-buildx-action@v3
110-
111-
- name: Log in to Nexus Registry
112-
if: github.event_name != 'pull_request'
113-
uses: docker/login-action@v3
114-
with:
115-
registry: ${{ env.REGISTRY }}
116-
username: ${{ secrets.NEXUS_USERNAME }}
117-
password: ${{ secrets.NEXUS_PASSWORD }}
118-
119-
- name: Extract metadata
120-
id: meta
121-
uses: docker/metadata-action@v5
122-
with:
123-
images: |
124-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
125-
tags: |
126-
type=ref,event=branch,suffix=-slim
127-
type=ref,event=pr,suffix=-slim
128-
type=semver,pattern={{version}},suffix=-slim
129-
type=semver,pattern={{major}}.{{minor}},suffix=-slim
130-
type=raw,value=latest-slim,enable={{is_default_branch}}
131-
type=raw,value=daily-slim,enable={{is_default_branch}}
132-
type=sha,prefix={{branch}}-,suffix=-slim
133-
134-
- name: Build and push Slim image
135-
uses: docker/build-push-action@v5
136-
with:
137-
context: .
138-
file: ./Dockerfile.slim
139-
platforms: linux/amd64
140-
push: ${{ github.event_name != 'pull_request' }}
141-
tags: ${{ steps.meta.outputs.tags }}
142-
labels: ${{ steps.meta.outputs.labels }}
143-
cache-from: type=gha
144-
cache-to: type=gha,mode=max
145-
build-args: |
146-
BUILD_DATE=${{ github.event.head_commit.timestamp }}
147-
VCS_REF=${{ github.sha }}
148-
VERSION=${{ steps.meta.outputs.version }}
94+
# TEMPORARILY DISABLED FOR TESTING
95+
# build-slim:
96+
# name: Build Slim Image
97+
# runs-on: ubuntu-latest
98+
# permissions:
99+
# contents: read
100+
# packages: write
101+
#
102+
# steps:
103+
# - name: Checkout repository
104+
# uses: actions/checkout@v4
105+
#
106+
# - name: Set up QEMU
107+
# uses: docker/setup-qemu-action@v3
108+
#
109+
# - name: Set up Docker Buildx
110+
# uses: docker/setup-buildx-action@v3
111+
#
112+
# - name: Log in to Nexus Registry
113+
# if: github.event_name != 'pull_request'
114+
# uses: docker/login-action@v3
115+
# with:
116+
# registry: ${{ env.REGISTRY }}
117+
# username: ${{ secrets.NEXUS_USERNAME }}
118+
# password: ${{ secrets.NEXUS_PASSWORD }}
119+
#
120+
# - name: Extract metadata
121+
# id: meta
122+
# uses: docker/metadata-action@v5
123+
# with:
124+
# images: |
125+
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
126+
# tags: |
127+
# type=ref,event=branch,suffix=-slim
128+
# type=ref,event=pr,suffix=-slim
129+
# type=semver,pattern={{version}},suffix=-slim
130+
# type=semver,pattern={{major}}.{{minor}},suffix=-slim
131+
# type=raw,value=latest-slim,enable={{is_default_branch}}
132+
# type=raw,value=daily-slim,enable={{is_default_branch}}
133+
# type=sha,prefix={{branch}}-,suffix=-slim
134+
#
135+
# - name: Build and push Slim image
136+
# uses: docker/build-push-action@v5
137+
# with:
138+
# context: .
139+
# file: ./Dockerfile.slim
140+
# platforms: linux/amd64
141+
# push: ${{ github.event_name != 'pull_request' }}
142+
# tags: ${{ steps.meta.outputs.tags }}
143+
# labels: ${{ steps.meta.outputs.labels }}
144+
# cache-from: type=gha
145+
# cache-to: type=gha,mode=max
146+
# build-args: |
147+
# BUILD_DATE=${{ github.event.head_commit.timestamp }}
148+
# VCS_REF=${{ github.sha }}
149+
# VERSION=${{ steps.meta.outputs.version }}
149150

150-
test-images:
151-
name: Test Docker Images
152-
needs: [build-ubuntu, build-slim]
153-
runs-on: ubuntu-latest
154-
if: github.event_name == 'pull_request'
155-
156-
steps:
157-
- name: Checkout repository
158-
uses: actions/checkout@v4
159-
160-
- name: Set up Docker Buildx
161-
uses: docker/setup-buildx-action@v3
162-
163-
- name: Build test image (Ubuntu)
164-
uses: docker/build-push-action@v5
165-
with:
166-
context: .
167-
file: ./Dockerfile
168-
load: true
169-
tags: openspp:test-ubuntu
170-
cache-from: type=gha
171-
172-
- name: Build test image (Slim)
173-
uses: docker/build-push-action@v5
174-
with:
175-
context: .
176-
file: ./Dockerfile.slim
177-
load: true
178-
tags: openspp:test-slim
179-
cache-from: type=gha
180-
181-
- name: Test Ubuntu image
182-
run: |
183-
echo "Testing Ubuntu image..."
184-
docker run --rm openspp:test-ubuntu openspp-server --version
185-
docker run --rm openspp:test-ubuntu openspp-server --help | grep -q "OpenSPP"
186-
187-
- name: Test Slim image
188-
run: |
189-
echo "Testing Slim image..."
190-
docker run --rm openspp:test-slim openspp-server --version
191-
docker run --rm openspp:test-slim openspp-server --help | grep -q "OpenSPP"
192-
193-
- name: Test health endpoint
194-
run: |
195-
echo "Starting container for health check..."
196-
docker run -d --name openspp-test -p 8069:8069 openspp:test-ubuntu
197-
sleep 60
198-
curl -f http://localhost:8069/web/health || (docker logs openspp-test && exit 1)
199-
docker stop openspp-test
200-
docker rm openspp-test
151+
# TEMPORARILY DISABLED FOR TESTING
152+
# test-images:
153+
# name: Test Docker Images
154+
# needs: [build-ubuntu]
155+
# runs-on: ubuntu-latest
156+
# if: github.event_name == 'pull_request'
157+
#
158+
# steps:
159+
# - name: Checkout repository
160+
# uses: actions/checkout@v4
161+
#
162+
# - name: Set up Docker Buildx
163+
# uses: docker/setup-buildx-action@v3
164+
#
165+
# - name: Build test image (Ubuntu)
166+
# uses: docker/build-push-action@v5
167+
# with:
168+
# context: .
169+
# file: ./Dockerfile
170+
# load: true
171+
# tags: openspp:test-ubuntu
172+
# cache-from: type=gha
173+
#
174+
# - name: Build test image (Slim)
175+
# uses: docker/build-push-action@v5
176+
# with:
177+
# context: .
178+
# file: ./Dockerfile.slim
179+
# load: true
180+
# tags: openspp:test-slim
181+
# cache-from: type=gha
182+
#
183+
# - name: Test Ubuntu image
184+
# run: |
185+
# echo "Testing Ubuntu image..."
186+
# docker run --rm openspp:test-ubuntu openspp-server --version
187+
# docker run --rm openspp:test-ubuntu openspp-server --help | grep -q "OpenSPP"
188+
#
189+
# - name: Test Slim image
190+
# run: |
191+
# echo "Testing Slim image..."
192+
# docker run --rm openspp:test-slim openspp-server --version
193+
# docker run --rm openspp:test-slim openspp-server --help | grep -q "OpenSPP"
194+
#
195+
# - name: Test health endpoint
196+
# run: |
197+
# echo "Starting container for health check..."
198+
# docker run -d --name openspp-test -p 8069:8069 openspp:test-ubuntu
199+
# sleep 60
200+
# curl -f http://localhost:8069/web/health || (docker logs openspp-test && exit 1)
201+
# docker stop openspp-test
202+
# docker rm openspp-test
201203

202-
update-manifests:
203-
name: Update Kubernetes Manifests
204-
needs: [build-ubuntu, build-slim]
205-
runs-on: ubuntu-latest
206-
if: startsWith(github.ref, 'refs/tags/')
204+
# TEMPORARILY DISABLED FOR TESTING
205+
# update-manifests:
206+
# name: Update Kubernetes Manifests
207+
# needs: [build-ubuntu]
208+
# runs-on: ubuntu-latest
209+
# if: startsWith(github.ref, 'refs/tags/')
207210

208-
steps:
209-
- name: Checkout repository
210-
uses: actions/checkout@v4
211-
212-
- name: Update deployment manifests
213-
run: |
214-
TAG=${GITHUB_REF#refs/tags/}
215-
echo "Updating manifests for tag: $TAG"
211+
# steps:
212+
# - name: Checkout repository
213+
# uses: actions/checkout@v4
214+
215+
# - name: Update deployment manifests
216+
# run: |
217+
# TAG=${GITHUB_REF#refs/tags/}
218+
# echo "Updating manifests for tag: $TAG"
216219

217-
# Update image tags in deployment files
218-
find deployments -name "*.yaml" -type f -exec \
219-
sed -i "s|image: .*openspp:.*|image: ${{ env.PUBLIC_REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG}|g" {} \;
220-
221-
- name: Commit and push changes
222-
run: |
223-
git config --local user.email "action@github.com"
224-
git config --local user.name "GitHub Action"
225-
git add deployments/
226-
git diff --staged --quiet || git commit -m "Update deployment manifests for ${GITHUB_REF#refs/tags/}"
227-
git push
220+
# # Update image tags in deployment files
221+
# find deployments -name "*.yaml" -type f -exec \
222+
# sed -i "s|image: .*openspp:.*|image: ${{ env.PUBLIC_REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG}|g" {} \;
223+
224+
# - name: Commit and push changes
225+
# run: |
226+
# git config --local user.email "action@github.com"
227+
# git config --local user.name "GitHub Action"
228+
# git add deployments/
229+
# git diff --staged --quiet || git commit -m "Update deployment manifests for ${GITHUB_REF#refs/tags/}"
230+
# git push
228231

229-
notify:
230-
name: Send Notifications
231-
needs: [build-ubuntu, build-slim]
232-
runs-on: ubuntu-latest
233-
if: always() && github.event_name != 'pull_request'
232+
# notify:
233+
# name: Send Notifications
234+
# needs: [build-ubuntu, build-slim]
235+
# runs-on: ubuntu-latest
236+
# if: always() && github.event_name != 'pull_request'
234237

235-
steps:
236-
- name: Notify Slack
237-
uses: 8398a7/action-slack@v3
238-
if: always()
239-
continue-on-error: true
240-
with:
241-
status: ${{ job.status }}
242-
text: |
243-
OpenSPP Docker Build ${{ job.status }}
244-
Branch: ${{ github.ref }}
245-
Commit: ${{ github.sha }}
246-
Images pushed to: ${{ env.PUBLIC_REGISTRY }}/${{ env.IMAGE_NAME }}
247-
webhook_url: ${{ secrets.SLACK_WEBHOOK }}
248-
env:
249-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
238+
# steps:
239+
# - name: Notify Slack
240+
# uses: 8398a7/action-slack@v3
241+
# if: always()
242+
# continue-on-error: true
243+
# with:
244+
# status: ${{ job.status }}
245+
# text: |
246+
# OpenSPP Docker Build ${{ job.status }}
247+
# Branch: ${{ github.ref }}
248+
# Commit: ${{ github.sha }}
249+
# Images pushed to: ${{ env.PUBLIC_REGISTRY }}/${{ env.IMAGE_NAME }}
250+
# webhook_url: ${{ secrets.SLACK_WEBHOOK }}
251+
# env:
252+
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)