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
8bf58d36
Commit
8bf58d36
authored
Oct 27, 2018
by
Philippe Lafoucrière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explain how to use custom setup cmd
parent
3d1c2c26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
doc/ci/examples/license_management.md
doc/ci/examples/license_management.md
+34
-4
No files found.
doc/ci/examples/license_management.md
View file @
8bf58d36
...
...
@@ -7,8 +7,7 @@ is needed.
This example shows how to run the License Management tool on your
project's dependencies by using GitLab CI/CD.
First, you need GitLab Runner with
[
docker-in-docker executor
](
../docker/using_docker_build.md#use-docker-in-docker-executor
)
.
You can then add a new job to
`.gitlab-ci.yml`
, called
`license_management`
:
You can add a new job to
`.gitlab-ci.yml`
, called
`license_management`
:
```
yaml
license_management
:
...
...
@@ -23,10 +22,41 @@ license_management:
paths
:
[
gl-license-management-report.json
]
```
The above example will create a
`license_management`
job in the
`test`
stage and will create the required report artifact. Check the
[
Auto-DevOps template
](
https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/Auto-DevOps.gitlab-ci.yml
)
The above example will create a
`license_management`
job in the
`test`
stage
and will create the required report artifact. Check the
[
Auto-DevOps
template
](
https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/Auto-DevOps.gitlab-ci.yml
)
for a full reference.
## Install custom project dependencies
The
`license_management`
image already embeds many auto-detection scripts, languages,
and packages. Nevertheless, it's almost impossible to cover all cases, for all projects.
That's why sometimes it's necessary to install extra packages, or to have extra steps
in the project automated setup, like the download and installation of a certificate.
For that, a
`SETUP_CMD`
environment variable can be passed to the container,
with the required commands to run before license detection.
If present, this variable will override the setup step necessary to install all the packages
of your application (ex: for a project with a
`Gemfile`
, the setup step will be
`bundle install`
).
Example:
```
yaml
license_management
:
image
:
name
:
"
registry.gitlab.com/gitlab-org/security-products/license-management:$CI_SERVER_VERSION_MAJOR-$CI_SERVER_VERSION_MINOR-stable"
entrypoint
:
[
"
"
]
stage
:
test
variables
:
SETUP_CMD=./my-custom-install-script.sh
allow_failure
:
true
script
:
-
/run.sh analyze .
artifacts
:
paths
:
[
gl-license-management-report.json
]
```
In this example,
`my-custom-install-script.sh`
is a shell script at the root of the project.
TIP:
**Tip:**
Starting with
[
GitLab Ultimate
][
ee
]
11.0, this information will
...
...
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