Update the deploy pipeline and improve the dockerignore's
This commit is contained in:
@@ -1,18 +1,41 @@
|
|||||||
|
# Dependencies and build output (installed/generated in image)
|
||||||
node_modules
|
node_modules
|
||||||
build
|
build
|
||||||
|
|
||||||
|
# Git and CI
|
||||||
.git
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
*.md
|
.woodpecker
|
||||||
|
.woodpecker.yml
|
||||||
|
|
||||||
|
# Dev / IDE / tooling (not needed at build time)
|
||||||
.cursor
|
.cursor
|
||||||
.devcontainer
|
.devcontainer
|
||||||
|
.vscode
|
||||||
|
*.md
|
||||||
|
docs
|
||||||
|
test.txt
|
||||||
|
|
||||||
|
# Lint/format config (build does not need these)
|
||||||
.eslintrc.cjs
|
.eslintrc.cjs
|
||||||
|
.eslintignore
|
||||||
.prettierrc
|
.prettierrc
|
||||||
.prettierignore
|
.prettierignore
|
||||||
.eslintignore
|
|
||||||
|
# Test and E2E (Dockerfile only runs build + critical-css)
|
||||||
e2e
|
e2e
|
||||||
playwright.config.ts
|
playwright.config.ts
|
||||||
vitest.config.ts
|
vitest.config.ts
|
||||||
test.txt
|
playwright-report
|
||||||
docs
|
coverage
|
||||||
.woodpecker.yml
|
.nyc_output
|
||||||
.woodpecker
|
|
||||||
|
# Env and logs
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Local Docker (not needed inside image)
|
||||||
|
docker-compose.yml
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
|||||||
@@ -12,25 +12,41 @@ steps:
|
|||||||
image: docker:latest
|
image: docker:latest
|
||||||
environment:
|
environment:
|
||||||
REGISTRY_REPO: git.mifi.dev/mifi-holdings/mifi-links
|
REGISTRY_REPO: git.mifi.dev/mifi-holdings/mifi-links
|
||||||
|
DOCKER_API_VERSION: "1.43"
|
||||||
|
DOCKER_BUILDKIT: "1"
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
- set -e
|
- set -e
|
||||||
- echo "=== Building Docker image ==="
|
- echo "=== Building Docker image (BuildKit) ==="
|
||||||
- 'echo "Commit SHA: ${CI_COMMIT_SHA:0:8}"'
|
- 'echo "Commit SHA: ${CI_COMMIT_SHA:0:8}"'
|
||||||
- 'echo "Registry repo: $REGISTRY_REPO"'
|
- 'echo "Registry repo: $REGISTRY_REPO"'
|
||||||
- |
|
- |
|
||||||
docker build \
|
build() {
|
||||||
--tag $REGISTRY_REPO:${CI_COMMIT_SHA} \
|
docker build \
|
||||||
--tag $REGISTRY_REPO:latest \
|
--progress=plain \
|
||||||
--label "git.commit=${CI_COMMIT_SHA}" \
|
--tag $REGISTRY_REPO:${CI_COMMIT_SHA} \
|
||||||
--label "git.branch=${CI_COMMIT_BRANCH}" \
|
--tag $REGISTRY_REPO:latest \
|
||||||
.
|
--label "git.commit=${CI_COMMIT_SHA}" \
|
||||||
- echo "✓ Docker image built successfully"
|
--label "git.branch=${CI_COMMIT_BRANCH}" \
|
||||||
|
.
|
||||||
|
}
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
echo "Build attempt $attempt/3"
|
||||||
|
if build; then
|
||||||
|
echo "✓ Docker image built successfully"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Build attempt $attempt failed, retrying in 30s..."
|
||||||
|
sleep 30
|
||||||
|
done
|
||||||
|
echo "All build attempts failed"
|
||||||
|
exit 1
|
||||||
|
|
||||||
- name: Push to registry
|
- name: Push to registry
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
environment:
|
environment:
|
||||||
|
DOCKER_API_VERSION: "1.43"
|
||||||
REGISTRY_URL: git.mifi.dev
|
REGISTRY_URL: git.mifi.dev
|
||||||
REGISTRY_REPO: git.mifi.dev/mifi-holdings/mifi-links
|
REGISTRY_REPO: git.mifi.dev/mifi-holdings/mifi-links
|
||||||
REGISTRY_USERNAME:
|
REGISTRY_USERNAME:
|
||||||
|
|||||||
Reference in New Issue
Block a user