Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f4329d15
Commit
f4329d15
authored
Nov 27, 2020
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add workhorse CI check
parent
f0e61d9b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
1 deletion
+73
-1
.gitlab-ci.yml
.gitlab-ci.yml
+1
-0
.gitlab/ci/workhorse.gitlab-ci.yml
.gitlab/ci/workhorse.gitlab-ci.yml
+9
-0
.rubocop.yml
.rubocop.yml
+1
-0
danger/commit_messages/Dangerfile
danger/commit_messages/Dangerfile
+9
-1
scripts/update-workhorse
scripts/update-workhorse
+53
-0
workhorse/.gitkeep
workhorse/.gitkeep
+0
-0
No files found.
.gitlab-ci.yml
View file @
f4329d15
...
...
@@ -109,3 +109,4 @@ include:
-
local
:
.gitlab/ci/releases.gitlab-ci.yml
-
local
:
.gitlab/ci/notify.gitlab-ci.yml
-
local
:
.gitlab/ci/dast.gitlab-ci.yml
-
local
:
.gitlab/ci/workhorse.gitlab-ci.yml
.gitlab/ci/workhorse.gitlab-ci.yml
0 → 100644
View file @
f4329d15
workhorse
:
image
:
golang:1.14
stage
:
test
needs
:
[]
script
:
-
rm .git/hooks/post-checkout
-
git checkout .
-
scripts/update-workhorse check
-
make -C workhorse
.rubocop.yml
View file @
f4329d15
...
...
@@ -32,6 +32,7 @@ AllCops:
-
'
builds/**/*'
-
'
plugins/**/*'
-
'
file_hooks/**/*'
-
'
workhorse/**/*'
CacheRootDirectory
:
tmp
MaxFilesInCache
:
18000
...
...
danger/commit_messages/Dangerfile
View file @
f4329d15
...
...
@@ -139,4 +139,12 @@ def warn_or_fail_commits(failed_linters, default_to_fail: true)
end
end
lint_commits
(
git
.
commits
)
# As part of https://gitlab.com/groups/gitlab-org/-/epics/4826 we are
# vendoring workhorse commits from the stand-alone gitlab-workhorse
# repo. There is no point in linting commits that we want to vendor as
# is.
def
workhorse_changes?
git
.
diff
.
any?
{
|
file
|
file
.
path
.
start_with?
(
'workhorse/'
)
}
end
lint_commits
(
git
.
commits
)
unless
workhorse_changes?
scripts/update-workhorse
0 → 100755
View file @
f4329d15
#!/bin/sh
set
-e
WORKHORSE_DIR
=
workhorse/
WORKHORSE_REF
=
"v
$(
cat
GITLAB_WORKHORSE_VERSION
)
"
if
[
$#
-gt
1
]
||
([
$#
=
1
]
&&
[
x
$1
!=
xcheck
])
;
then
echo
"Usage: update-workhorse [check]"
exit
1
fi
clean
=
"
$(
git status
--porcelain
)
"
if
[
-n
"
$clean
"
]
;
then
echo
'error: working directory is not clean:'
echo
"
$clean
"
exit
1
fi
git fetch https://gitlab.com/gitlab-org/gitlab-workhorse.git
"
$WORKHORSE_REF
"
git
rm
-rf
--quiet
--
"
$WORKHORSE_DIR
"
git read-tree
--prefix
=
"
$WORKHORSE_DIR
"
-u
FETCH_HEAD
status
=
"
$(
git status
--porcelain
)
"
if
[
x
$1
=
xcheck
]
;
then
if
[
-n
"
$status
"
]
;
then
cat
<<
MSG
error:
$WORKHORSE_DIR
does not match
$WORKHORSE_REF
During the transition period of https://gitlab.com/groups/gitlab-org/-/epics/4826,
the workhorse/ directory in this repository is read-only. To make changes:
1. Submit a MR to https://gitlab.com/gitlab-org/gitlab-workhorse
2. Once your MR is merged, have a new gitlab-workhorse tag made
by a maintainer
3. Update the GITLAB_WORKHORSE_VERSION file in this repository
4. Run scripts/update-workhorse to update the workhorse/ directory
MSG
exit
1
fi
exit
0
fi
if
[
-z
"
$status
"
]
;
then
echo
"warn:
$WORKHORSE_DIR
is already up to date, exiting without commit"
exit
0
fi
tree
=
$(
git write-tree
)
msg
=
"Update vendored workhorse to
$WORKHORSE_REF
"
commit
=
$(
git commit-tree
-p
HEAD
-p
FETCH_HEAD^
{
commit
}
-m
"
$msg
"
"
$tree
"
)
git update-ref HEAD
"
$commit
"
git log
-1
workhorse/.gitkeep
0 → 100644
View file @
f4329d15
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