Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.admin
Commits
ca33177a
Commit
ca33177a
authored
7 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Use array variable containig doc uploads
parent
5813e43a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gitlab/after_docs.sh
+0
-6
0 additions, 6 deletions
gitlab/after_docs.sh
gitlab/before_docs.sh
+4
-49
4 additions, 49 deletions
gitlab/before_docs.sh
gitlab/docs.sh
+4
-28
4 additions, 28 deletions
gitlab/docs.sh
with
8 additions
and
83 deletions
gitlab/after_docs.sh
+
0
−
6
View file @
ca33177a
#!/usr/bin/env bash
#!/usr/bin/env bash
# Thu 22 Sep 2016 18:23:57 CEST
# Thu 22 Sep 2016 18:23:57 CEST
# unset vars exported in before_docs.sh
unset
IS_MASTER
unset
MASTER_UPLOAD_PATH
unset
TAG_UPLOAD_PATH
unset
STABLE_UPLOAD_PATH
This diff is collapsed.
Click to expand it.
gitlab/before_docs.sh
+
4
−
49
View file @
ca33177a
...
@@ -3,52 +3,7 @@
...
@@ -3,52 +3,7 @@
source
$(
dirname
${
0
}
)
/functions.sh
source
$(
dirname
${
0
}
)
/functions.sh
# decide whether this is master
# Deletes all existing dav folders that will be overwritten
# assume it's being ran on master by default
for
k
in
"
${
DOC_UPLOADS
[@]
}
"
;
do
IS_MASTER
=
true
dav_delete
"
${
k
}
"
# if its a tag build, it might not be master
done
if
[[
-n
$CI_BUILD_TAG
]]
;
then
IS_MASTER
=
false
# fetch repo & check if tag came from master
git fetch origin
for
p
in
$(
git branch
-a
--quiet
--contains
tags/
"
$CI_BUILD_TAG
"
)
;
do
[[
$p
==
'remotes/origin/master'
]]
&&
IS_MASTER
=
true
done
fi
# prefix differs between private & public repos
if
[[
"
${
VISIBILITY
}
"
==
"public"
]]
;
then
DOCS_SERVER_PREFIX
=
"public-upload/
$CI_PROJECT_PATH
/docs"
else
DOCS_SERVER_PREFIX
=
"private-upload/
$CI_PROJECT_PATH
/docs"
fi
# define possible upload paths
# folder for master branch
MASTER_UPLOAD_PATH
=
"
$DOCS_SERVER_PREFIX
/master/"
# folder for a tag
TAG_UPLOAD_PATH
=
"
$DOCS_SERVER_PREFIX
/
$CI_BUILD_TAG
/"
# folder for new stable version
STABLE_UPLOAD_PATH
=
"
$DOCS_SERVER_PREFIX
/stable/"
# rm already existing folders if necessary
# folder for HEAD of master
if
[[
$IS_MASTER
==
true
]]
;
then
dav_delete
"
$MASTER_UPLOAD_PATH
"
fi
# upload to the tag folder if this build is tagged
if
[[
-n
$CI_BUILD_TAG
]]
;
then
dav_delete
"
$TAG_UPLOAD_PATH
"
fi
# upload to the stable folder if this build is tagged and on master
if
[[
-n
$CI_BUILD_TAG
&&
$IS_MASTER
==
true
]]
;
then
dav_delete
"
$STABLE_UPLOAD_PATH
"
fi
# export vars for docs script to use
export_env IS_MASTER
export_env MASTER_UPLOAD_PATH
export_env TAG_UPLOAD_PATH
export_env STABLE_UPLOAD_PATH
This diff is collapsed.
Click to expand it.
gitlab/docs.sh
+
4
−
28
View file @
ca33177a
...
@@ -3,31 +3,7 @@
...
@@ -3,31 +3,7 @@
source
$(
dirname
${
0
}
)
/functions.sh
source
$(
dirname
${
0
}
)
/functions.sh
check_env IS_MASTER
# Deletes all existing dav folders that will be overwritten
check_env MASTER_UPLOAD_PATH
for
k
in
"
${
DOC_UPLOADS
[@]
}
"
;
do
check_env TAG_UPLOAD_PATH
dav_upload_folder
"
${
k
}
"
check_env STABLE_UPLOAD_PATH
done
info
=
sphinx/.gitlab-ci.info
echo
"repo=
${
CI_PROJECT_PATH
}
"
>
${
info
}
echo
"branch=
${
CI_BUILD_REF_NAME
}
"
>>
${
info
}
echo
"tag=
${
CI_BUILD_TAG
}
"
>>
${
info
}
echo
"build=
${
CI_BUILD_ID
}
"
>>
${
info
}
echo
"commit=
${
CI_BUILD_REF
}
"
>>
${
info
}
echo
"runner=
${
CI_RUNNER_DESCRIPTION
}
"
>>
${
info
}
# folder for HEAD of master
if
[[
$IS_MASTER
==
true
]]
;
then
dav_upload_folder sphinx
"
$MASTER_UPLOAD_PATH
"
fi
# upload to the tag folder if this build is tagged
if
[[
-n
$CI_BUILD_TAG
]]
;
then
dav_upload_folder sphinx
"
$TAG_UPLOAD_PATH
"
fi
# upload to the stable folder if this build is tagged and on master
if
[[
-n
$CI_BUILD_TAG
&&
$IS_MASTER
==
true
]]
;
then
dav_upload_folder sphinx
"
$STABLE_UPLOAD_PATH
"
fi
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