Compare commits
1 Commits
1138d35eeb
...
be0a31a525
| Author | SHA1 | Date | |
|---|---|---|---|
| be0a31a525 |
@@ -1 +0,0 @@
|
|||||||
# Workflow test
|
|
||||||
@@ -32,12 +32,12 @@ RUN go install github.com/swaggo/swag/cmd/swag@latest && \
|
|||||||
go install golang.org/x/tools/cmd/goimports@latest && \
|
go install golang.org/x/tools/cmd/goimports@latest && \
|
||||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||||
|
|
||||||
# Simple build environment - source code is mounted at runtime
|
|
||||||
WORKDIR /build
|
|
||||||
|
|
||||||
# Copy only go.mod and go.sum first for dependency caching
|
# Copy only go.mod and go.sum first for dependency caching
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download && go mod verify
|
RUN go mod download && go mod verify
|
||||||
|
|
||||||
|
# Simple build environment - source code is mounted at runtime
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
# Pre-download common Go tools (already installed in base)
|
# Pre-download common Go tools (already installed in base)
|
||||||
# RUN go install github.com/swaggo/swag/cmd/swag@latest
|
# RUN go install github.com/swaggo/swag/cmd/swag@latest
|
||||||
@@ -2,13 +2,9 @@
|
|||||||
# Minimal image using pre-built binary from CI cache
|
# Minimal image using pre-built binary from CI cache
|
||||||
# Template: Replace {{DEPS_HASH}} with actual dependency hash
|
# Template: Replace {{DEPS_HASH}} with actual dependency hash
|
||||||
|
|
||||||
# Use the build cache image as base for building
|
# Use the build cache image as base
|
||||||
FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:{{DEPS_HASH}} AS builder
|
FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:{{DEPS_HASH}} AS builder
|
||||||
|
|
||||||
# Set working directory and build the binary
|
|
||||||
WORKDIR /workspace
|
|
||||||
RUN go build -o dance-lessons-coach ./cmd/server
|
|
||||||
|
|
||||||
# Final minimal image
|
# Final minimal image
|
||||||
FROM alpine:3.18
|
FROM alpine:3.18
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
{"title": "Move Docker push steps to separate job", "body": "The current CI/CD workflow has Docker push steps in the second job that runs in a container. The container doesn't have Docker commands available. Need to move these steps to a new third job that runs on ubuntu-latest-ca without using a container."}
|
|
||||||
@@ -48,5 +48,3 @@ func (s *Service) Greet(ctx context.Context, name string) string {
|
|||||||
}
|
}
|
||||||
return "Hello " + name + "!"
|
return "Hello " + name + "!"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test workflow trigger
|
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Test Docker push workflow locally using act
|
|
||||||
# Usage: scripts/test-docker-push.sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "🧪 Testing Docker Push Workflow Locally"
|
|
||||||
echo "======================================"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Check requirements
|
|
||||||
if ! command -v act >/dev/null 2>&1; then
|
|
||||||
echo "❌ act not found. Please install act first."
|
|
||||||
echo " brew install act"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v docker >/dev/null 2>&1; then
|
|
||||||
echo "❌ Docker not found. Please install Docker first."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "✅ Requirements met"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Test the Docker push workflow
|
|
||||||
echo "1. Testing Docker push workflow with act..."
|
|
||||||
echo " This may take a few minutes..."
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Run act with the docker-push workflow
|
|
||||||
act \
|
|
||||||
-W .gitea/workflows/docker-push.yaml \
|
|
||||||
--job docker-push \
|
|
||||||
--secret GITEA_TOKEN=dummy_token \
|
|
||||||
--secret PACKAGES_TOKEN=dummy_token \
|
|
||||||
--env GITEA_INTERNAL=https://gitea.arcodange.lab/ \
|
|
||||||
--env GITEA_EXTERNAL=https://gitea.arcodange.fr/ \
|
|
||||||
--env GITEA_ORG=arcodange \
|
|
||||||
--env GITEA_REPO=dance-lessons-coach \
|
|
||||||
--env CI_REGISTRY=gitea.arcodange.lab
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "✅ Local testing complete!"
|
|
||||||
echo ""
|
|
||||||
echo "💡 If the test failed, check:"
|
|
||||||
echo " - Dockerfile.prod.template syntax"
|
|
||||||
echo " - Dependency hash calculation"
|
|
||||||
echo " - Docker build context"
|
|
||||||
echo " - Go module dependencies"
|
|
||||||
echo ""
|
|
||||||
echo "💡 To test specific scenarios:"
|
|
||||||
echo " act -W .gitea/workflows/docker-push.yaml --list"
|
|
||||||
echo " act -W .gitea/workflows/docker-push.yaml --job docker-push --dryrun"
|
|
||||||
Reference in New Issue
Block a user