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
555f51c1
Verified
Commit
555f51c1
authored
2 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Switch to shared pipeline
parent
b24cb788
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#82368
failed
2 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+3
-147
3 additions, 147 deletions
.gitlab-ci.yml
with
3 additions
and
147 deletions
.gitlab-ci.yml
+
3
−
147
View file @
555f51c1
---
variables
:
CI_FOREMAN_PLUGIN
:
$CI_PROJECT_NAME
CI_FOREMAN_WEB
:
'
false'
POSTGRES_DB
:
test
POSTGRES_USER
:
postgres
POSTGRES_PASSWORD
:
postgres
services
:
-
name
:
postgres:13-alpine
alias
:
db
image
:
ruby:2.7
lint
:
cache
:
paths
:
-
vendor/ruby
when
:
always
script
:
-
gem install bundler -N
-
bundle config set path vendor
-
bundle install -j $(nproc) --retry=3
-
bundle exec rubocop app/ config/ db/ lib/ -f p -f ju -o junit.xml
artifacts
:
reports
:
junit
:
junit.xml
test
:
parallel
:
matrix
:
-
FOREMAN_VERSION
:
# - 2.5-stable
-
3.0-stable
# - 3.1-stable
# - 3.2-stable
# - 3.3-stable
-
3.4-stable
cache
:
key
:
foreman-$FOREMAN_VERSION
paths
:
-
vendor/ruby
when
:
always
variables
:
RAILS_ENV
:
test
DATABASE_URL
:
postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@db/$POSTGRES_DB
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL
:
"
true"
before_script
:
-
|
# Set up Foreman for tests
if [ -d "$CI_PROJECT_DIR/test" ]; then
# Set up Ruby build dependencies
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
FOREMAN_DIR="$(dirname "$CI_PROJECT_DIR")/foreman"
git clone -b "$FOREMAN_VERSION" --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 sqlite vmware
bundle install -j $(nproc) --retry=3
# Configure database
bundle exec rake db:create
bundle exec rake db:migrate
# Install plugin
"echo \"gem '$CI_FOREMAN_PLUGIN', path: '$CI_PROJECT_DIR'\" > bundler.d/local.rb"
bundle install -j $(nproc) --retry=3
bundle exec rake db:migrate
if [ "$CI_FOREMAN_WEB" = "true" ]; then
mkdir -p "$CI_PROJECT_DIR/node_modules"
ln -s "$CI_PROJECT_DIR/node_modules" node_modules
npm install --legacy-peer-deps
bundle exec rake webpack:compile
fi
fi
script
:
# Foreman-side tasks
-
cd "$FOREMAN_DIR"
-
|
if [ -d "$CI_PROJECT_DIR/test" ]; then
bundle exec rake "test:$CI_FOREMAN_PLUGIN"
[ -d 'jenkins/reports' ] && mv jenkins/reports "$CI_PROJECT_DIR"
fi
artifacts
:
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
artifacts
:
paths
:
-
'
*.gem'
-
'
public'
include
:
-
project
:
ITI/ci-pipelines
file
:
'
/foreman-module.yaml'
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