Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Book
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUDE
Book
Commits
825cb3fb
Commit
825cb3fb
authored
3 months ago
by
Kwangjin Lee
Browse files
Options
Downloads
Patches
Plain Diff
combined build and deploy
parent
ff40e821
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#260157
failed
3 months ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+17
-14
17 additions, 14 deletions
.gitlab-ci.yml
with
17 additions
and
14 deletions
.gitlab-ci.yml
+
17
−
14
View file @
825cb3fb
...
...
@@ -44,22 +44,25 @@ build-and-deploy:
-
echo "Calculating build size..."
-
SIZE=$(du -sk book/_build/html | cut -f1)
-
echo "Build size is ${SIZE}KB"
-
echo $CI_JOB_ID > build_job_id.txt
# Create a minimal artifact set if size is too large
-
|
if [ "$SIZE" -lt 153600 ]; then # 150MB in KB
echo "Build size OK, proceeding with normal artifact upload"
echo $CI_JOB_ID > build_job_id.txt
# Deploy using artifacts
curl -X POST "${HOOK_URL}" \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \
-d "{\"object_kind\":\"pipeline\",\"object_attributes\":{\"status\":\"success\",\"ref\":\"${CI_COMMIT_BRANCH}\"},\"build_job_id\":$CI_JOB_ID}"
else
echo "Build too large for artifacts, deploying directly"
# Here you would add direct deployment logic
echo "Direct deployment not implemented yet"
exit 1
if [ "$SIZE" -gt 153600 ]; then # 150MB in KB
echo "Build size too large, creating minimal artifact set"
mkdir -p minimal_artifact
cp build_job_id.txt minimal_artifact/
cp stdout.log minimal_artifact/
cp stderr.log minimal_artifact/
fi
# Always proceed with deployment notification
-
|
curl -X POST "${HOOK_URL}" \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \
-d "{\"object_kind\":\"pipeline\",\"object_attributes\":{\"status\":\"success\",\"ref\":\"${CI_COMMIT_BRANCH}\"},\"build_job_id\":$CI_JOB_ID}"
# Debug info after build
-
echo "Directory sizes after build:"
-
du -sh book/_build/*
...
...
@@ -72,7 +75,7 @@ build-and-deploy:
-
stdout.log
-
stderr.log
-
build_job_id.txt
-
build_debug.log
-
minimal_artifact/
expire_in
:
1 week
environment
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment