Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffbs-website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ffbs
ffbs-website
Commits
f597add9
Commit
f597add9
authored
May 08, 2019
by
chrissi^
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix branch detection
Signed-off-by:
Chris Fiege
<
chris@tinyhost.de
>
parent
6372223b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
.gitlab-ci.yml
.gitlab-ci.yml
+6
-4
flamingo/plugins/git.py
flamingo/plugins/git.py
+6
-1
No files found.
.gitlab-ci.yml
View file @
f597add9
...
...
@@ -2,11 +2,13 @@ testbed:
stage
:
deploy
only
:
-
/^testbed*$/i
-
/^master*$/i
script
:
-
cd flamingo
-
echo $CI_COMMIT_REF_SLUG > REF_SLUG
-
make env
-
make html
-
touch /var/www/
testbed
/htdocs/foo
-
rm -r /var/www/
testbed
/htdocs/*
-
cp -r output/* /var/www/
testbed
/htdocs/
-
chmod go+r -R /var/www/
testbed
/htdocs/*
-
touch /var/www/
$CI_COMMIT_REF_SLUG
/htdocs/foo
-
rm -r /var/www/
$CI_COMMIT_REF_SLUG
/htdocs/*
-
cp -r output/* /var/www/
$CI_COMMIT_REF_SLUG
/htdocs/
-
chmod go+r -R /var/www/
$CI_COMMIT_REF_SLUG
/htdocs/*
flamingo/plugins/git.py
View file @
f597add9
...
...
@@ -12,7 +12,12 @@ class Git:
updated
=
subprocess
.
getoutput
([
"git log -1 --pretty=format:'%aI' {}"
.
format
(
path
)])
content
[
"git_update"
]
=
updated
branch
=
subprocess
.
getoutput
([
"git branch | grep \* | cut -d ' ' -f2"
])
try
:
with
open
(
"REF_SLUG"
)
as
fh
:
branch
=
fh
.
readlines
()[
0
].
strip
()
except
:
branch
=
subprocess
.
getoutput
([
"git branch | grep \* | cut -d ' ' -f2"
])
if
"HEAD"
in
branch
:
branch
=
"master"
content
[
"git_branch"
]
=
branch
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment