Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
foreman_vmware_advanced
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
foreman_vmware_advanced
Commits
4ec69b0c
Verified
Commit
4ec69b0c
authored
2 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Pipeline work
parent
812bdfbb
No related branches found
No related tags found
No related merge requests found
Pipeline
#82357
failed
2 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+83
-36
83 additions, 36 deletions
.gitlab-ci.yml
with
83 additions
and
36 deletions
.gitlab-ci.yml
+
83
−
36
View file @
4ec69b0c
---
---
variables
:
variables
:
CI_FOREMAN_PLUGIN
:
foreman_vmware_advanced
CI_FOREMAN_PLUGIN
:
$CI_PROJECT_NAME
#
CI_FOREMAN_WEB:
tru
e
CI_FOREMAN_WEB
:
fals
e
POSTGRES_DB
:
test
POSTGRES_DB
:
test
POSTGRES_USER
:
postgres
POSTGRES_USER
:
postgres
...
@@ -23,7 +23,11 @@ lint:
...
@@ -23,7 +23,11 @@ lint:
-
gem install bundler -N
-
gem install bundler -N
-
bundle config set path vendor
-
bundle config set path vendor
-
bundle install -j $(nproc) --retry=3
-
bundle install -j $(nproc) --retry=3
-
bundle exec rubocop app/ lib/
-
bundle exec rubocop app/ config/ db/ lib/ -f p -f ju -o junit.xml
artifacts
:
reports
:
junit
:
junit.xml
test
:
test
:
parallel
:
parallel
:
...
@@ -40,7 +44,6 @@ test:
...
@@ -40,7 +44,6 @@ test:
key
:
foreman-$FOREMAN_VERSION
key
:
foreman-$FOREMAN_VERSION
paths
:
paths
:
-
vendor/ruby
-
vendor/ruby
-
node_modules
when
:
always
when
:
always
variables
:
variables
:
...
@@ -49,53 +52,97 @@ test:
...
@@ -49,53 +52,97 @@ test:
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL
:
"
true"
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL
:
"
true"
before_script
:
before_script
:
# Set up Ruby build dependencies
-
|
-
apt-get update -yqq
# Set up Foreman for tests
-
apt-get install -yqq build-essential libcurl4-openssl-dev postgresql-client-13 zlib1g-dev libpq-dev
if [ -d "$CI_PROJECT_DIR/test" ]; then
-
apt-get install -yqq --no-install-recommends npm
# Set up Ruby build dependencies
-
gem install bundler -N
apt-get update -yqq
apt-get install -yqq build-essential libcurl4-openssl-dev postgresql-client-13 zlib1g-dev libpq-dev
apt-get install -yqq --no-install-recommends npm
gem install bundler -N
# Install foreman
# Install foreman
-
FOREMAN_DIR="$(dirname "$CI_PROJECT_DIR")/foreman"
FOREMAN_DIR="$(dirname "$CI_PROJECT_DIR")/foreman"
-
git clone -b "$FOREMAN_VERSION" --depth=1 -- https://github.com/theforeman/foreman "$FOREMAN_DIR"
git clone -b "$FOREMAN_VERSION" --depth=1 -- https://github.com/theforeman/foreman "$FOREMAN_DIR"
-
cd "$FOREMAN_DIR"
cd "$FOREMAN_DIR"
-
bundle config set path "$CI_PROJECT_DIR/vendor"
bundle config set path "$CI_PROJECT_DIR/vendor"
-
bundle config set without console development ec2 gce journald libvirt openstack ovirt sqlite vmware
bundle config set without console development ec2 gce journald libvirt openstack ovirt sqlite vmware
-
bundle install -j $(nproc) --retry=3
bundle install -j $(nproc) --retry=3
# Configure database
# Configure database
-
bundle exec rake db:create
bundle exec rake db:create
-
bundle exec rake db:migrate
bundle exec rake db:migrate
# Install plugin
# Install plugin
-
"
echo
\"
gem
'$CI_FOREMAN_PLUGIN',
path:
'$CI_PROJECT_DIR'
\"
>
bundler.d/local.rb"
"echo \"gem '$CI_FOREMAN_PLUGIN', path: '$CI_PROJECT_DIR'\" > bundler.d/local.rb"
-
bundle install -j $(nproc) --retry=3
bundle install -j $(nproc) --retry=3
-
bundle exec rake db:migrate
bundle exec rake db:migrate
-
|
if [ "$CI_FOREMAN_WEB" = "true" ]; then
if [
-
n
"$CI_
FOREMAN_WEB" ]; then
mkdir
-
p
"$CI_
PROJECT_DIR/node_modules"
mkdir
-
p
"$CI_PROJECT_DIR/node_modules"
ln
-
s
"$CI_PROJECT_DIR/node_modules"
node_modules
ln -s "$CI_PROJECT_DIR/node_modules" node_module
s
npm install --legacy-peer-dep
s
npm install --legacy-peer-deps
bundle exec rake webpack:compile
bundle exec rake webpack:compile
fi
fi
fi
script
:
script
:
# Foreman-side tasks
# Foreman-side tasks
-
cd "$FOREMAN_DIR"
-
cd "$FOREMAN_DIR"
-
|
-
|
if [ -d "$CI_PROJECT_DIR/test" ]; then
if [ -d "$CI_PROJECT_DIR/test" ]; then
bundle exec rake "test:$CI_FOREMAN_PLUGIN"
bundle exec rake "test:$CI_FOREMAN_PLUGIN"
[ -d 'jenkins/reports' ] && mv jenkins/reports "$CI_PROJECT_DIR"
[ -d 'jenkins/reports' ] && mv jenkins/reports "$CI_PROJECT_DIR"
fi
fi
-
'
[
-d
"$CI_PROJECT_DIR/app/assets"
]
&&
RAILS_ENV=production
bundle
exec
rake
"plugin:assets:precompile[$CI_FOREMAN_PLUGIN]"'
# Plugin-side tasks
artifacts
:
-
cd "$CI_PROJECT_DIR"
reports
:
junit
:
reports/unit/*.xml
package
:
cache
:
key
:
foreman-package
paths
:
-
vendor/ruby
-
node_modules
when
:
always
services
:
[]
before_script
:
-
|
# Install asset building dependencies if necessary
if [ -d "$CI_PROJECT_DIR/app/assets" ]; then
# Set up Ruby build dependencies
apt-get update -yqq
apt-get install -yqq build-essential libcurl4-openssl-dev zlib1g-dev
apt-get install -yqq --no-install-recommends npm
gem install bundler -N
# Install foreman
FOREMAN_DIR="$(dirname "$CI_PROJECT_DIR")/foreman"
git clone --depth=1 -- https://github.com/theforeman/foreman "$FOREMAN_DIR"
cd "$FOREMAN_DIR"
bundle config set path "$CI_PROJECT_DIR/vendor"
bundle config set without console development ec2 gce journald libvirt openstack ovirt postgresql sqlite vmware
bundle install -j $(nproc) --retry=3
# Install plugin
echo "gem '$CI_FOREMAN_PLUGIN', path: '$CI_PROJECT_DIR'" > bundler.d/local.rb
bundle install -j $(nproc) --retry=3
cd "$CI_PROJECT_DIR"
fi
script
:
-
|
# Precompile any existing assets
if [ -d "$CI_PROJECT_DIR/app/assets" ]; then
cd "$FOREMAN_DIR"
RAILS_ENV=production bundle exec rake "plugin:assets:precompile[$CI_FOREMAN_PLUGIN]"
cd "$CI_PROJECT_DIR"
fi
-
gem build $CI_FOREMAN_PLUGIN.gemspec
-
gem build $CI_FOREMAN_PLUGIN.gemspec
artifacts
:
artifacts
:
paths
:
paths
:
-
'
*.gem'
-
'
*.gem'
-
'
public'
-
'
public'
reports
:
junit
:
reports/unit/*.xml
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