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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
e85aa424
Commit
e85aa424
authored
May 09, 2017
by
Balasankar C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move triggering build logic to separate script
parent
c44680d1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
.gitlab-ci.yml
.gitlab-ci.yml
+1
-12
scripts/trigger-build
scripts/trigger-build
+18
-0
No files found.
.gitlab-ci.yml
View file @
e85aa424
...
...
@@ -149,18 +149,7 @@ build-package:
stage
:
build
when
:
manual
script
:
# If no branch in omnibus is specified, trigger pipeline against master
-
if [ -z "$OMNIBUS_BRANCH" ] ; then export OMNIBUS_BRANCH=master ;fi
-
echo "token=${BUILD_TRIGGER_TOKEN}" > version_details
-
echo "ref=${OMNIBUS_BRANCH}" >> version_details
-
echo "variables[ALTERNATIVE_SOURCES]=true" >> version_details
-
echo "variables[GITLAB_VERSION]=${CI_COMMIT_SHA}" >> version_details
# Collect version details of all components
-
for f in *_VERSION; do echo "variables[$f]=$(cat $f)" >> version_details; done
# Trigger the API and pass values collected above as parameters to it
-
pipeline_id=$(cat version_details | tr '\n' '&' | curl -s -X POST https://gitlab.com/api/v4/projects/20699/trigger/pipeline --data-binary @- | ruby -e "require 'json'; puts JSON.parse(STDIN.read)['id']") > /dev/null
-
echo "Triggered pipeline can be found at https://gitlab.com/gitlab-org/omnibus-gitlab/pipelines/${pipeline_id}"
-
rm version_details
-
scripts/trigger-build
# Prepare and merge knapsack tests
knapsack
:
...
...
scripts/trigger-build
0 → 100755
View file @
e85aa424
#!/usr/bin/env ruby
require
'net/http'
require
'json'
uri
=
URI
(
'https://gitlab.com/api/v4/projects/20699/trigger/pipeline'
)
params
=
{
"token"
=>
ENV
[
'BUILD_TRIGGER_TOKEN'
],
"variables[GITLAB_VERSION]"
=>
ENV
[
'CI_COMMIT_SHA'
],
"variables[ALTERNATIVE_SOURCES]"
=>
true
,
}
params
[
'ref'
]
=
ENV
[
'OMNIBUS_BRANCH'
]
||
"master"
Dir
.
glob
(
"*_VERSION"
).
each
do
|
version_file
|
params
[
"variables[
#{
version_file
}
]"
]
=
File
.
read
(
version_file
).
strip
end
res
=
Net
::
HTTP
.
post_form
(
uri
,
params
)
pipeline_id
=
JSON
.
parse
(
res
.
body
)[
'id'
]
puts
"Triggered pipeline can be found at https://gitlab.com/gitlab-org/omnibus-gitlab/pipelines/
#{
pipeline_id
}
"
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