Skip to content

Commit

Permalink
Rename plugin
Browse files Browse the repository at this point in the history
Compatible with foreman-packaging
  • Loading branch information
tristanrobert committed Jul 13, 2018
1 parent 24306c1 commit 1e33264
Show file tree
Hide file tree
Showing 39 changed files with 189 additions and 189 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ addons:
install:
- docker build -t foreman/proxmox .
script:
- docker run foreman/proxmox /bin/sh -c "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter; ./cc-test-reporter before-build; bundle exec bin/rake test:the_foreman_proxmox; ./cc-test-reporter format-coverage -d -t simplecov -o tmp/codeclimate.backend.json coverage/backend/.resultset.json; ./cc-test-reporter sum-coverage tmp/codeclimate.*.json -p 1 -o tmp/codeclimate.total.json; ./cc-test-reporter upload-coverage -i tmp/codeclimate.total.json -r $CC_TEST_REPORTER_ID"
- docker run foreman/proxmox /bin/sh -c "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter; ./cc-test-reporter before-build; bundle exec bin/rake test:foreman_fog_proxmox; ./cc-test-reporter format-coverage -d -t simplecov -o tmp/codeclimate.backend.json coverage/backend/.resultset.json; ./cc-test-reporter sum-coverage tmp/codeclimate.*.json -p 1 -o tmp/codeclimate.total.json; ./cc-test-reporter upload-coverage -i tmp/codeclimate.total.json -r $CC_TEST_REPORTER_ID"
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Copyright 2018 Tristan Robert

# This file is part of ForemanProxmox.
# This file is part of ForemanFogProxmox.

# ForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# ForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with ForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

FROM ruby:2.3.7
LABEL MAINTAINER="tristan.robert.44@gmail.com"
Expand All @@ -27,11 +27,11 @@ WORKDIR /usr/local
RUN git clone https://github.com/theforeman/foreman.git
WORKDIR /usr/local/foreman
RUN git checkout tags/1.17.1
RUN echo "gem 'the_foreman_proxmox', :path => '/usr/local/foreman_proxmox'\n" > /usr/local/foreman/bundler.d/Gemfile.local.rb
RUN echo "gem 'foreman_fog_proxmox', :path => '/usr/local/foreman_proxmox'\n" > /usr/local/foreman/bundler.d/Gemfile.local.rb
RUN echo "gem 'simplecov'" >> /usr/local/foreman/bundler.d/Gemfile.local.rb
RUN cp /usr/local/foreman/config/settings.yaml.example /usr/local/foreman/config/settings.yaml
RUN cp /usr/local/foreman/config/database.yml.example /usr/local/foreman/config/database.yml
RUN bundle install --jobs 20
ENTRYPOINT ["bundle", "exec"]
RUN bundle exec bin/rake db:migrate
CMD ["bin/rake", "test:the_foreman_proxmox"]
CMD ["bin/rake", "test:foreman_fog_proxmox"]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
![ForemanProxmox](.github/images/foremanproxmox.png)
![ForemanFogProxmox](.github/images/foremanproxmox.png)

[![Build Status](https://travis-ci.com/tristanrobert/foreman_proxmox.svg?branch=master)](https://travis-ci.com/tristanrobert/foreman_proxmox)
[![Maintainability](https://api.codeclimate.com/v1/badges/922162c278e0fa9207ba/maintainability)](https://codeclimate.com/github/tristanrobert/foreman_proxmox/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/922162c278e0fa9207ba/test_coverage)](https://codeclimate.com/github/tristanrobert/foreman_proxmox/test_coverage)

# ForemanProxmox
# ForemanFogProxmox

[Foreman](http://theforeman.org/) plugin that adds [Proxmox](https://www.proxmox.com/en/proxmox-ve) compute resource: managing virtual machines and containers using the [fog-proxmox](https://github.com/fog/fog-proxmox) module.

Expand Down Expand Up @@ -39,7 +39,7 @@ sudo apt install -y foreman foreman-compute foreman-sqlite3 foreman-assets
* In /usr/share/foreman/bundler.d directory, add Gemfile.local.rb file and add this line in it:

```shell
echo "gem 'the_foreman_proxmox'" | sudo -u foreman tee /usr/share/foreman/bundler.d/Gemfile.local.rb
echo "gem 'foreman_fog_proxmox'" | sudo -u foreman tee /usr/share/foreman/bundler.d/Gemfile.local.rb
```

* Install the gem plugin:
Expand All @@ -51,7 +51,7 @@ sudo -u foreman /usr/bin/foreman-ruby /usr/bin/bundle install
* Precompile plugin assets:

```shell
/usr/bin/foreman-ruby /usr/bin/bundle exec bin/rake plugin:assets:precompile[the_foreman_proxmox]
/usr/bin/foreman-ruby /usr/bin/bundle exec bin/rake plugin:assets:precompile[foreman_fog_proxmox]
```

* Complete installation of foreman 1.17 with foreman-installer:
Expand Down Expand Up @@ -110,7 +110,7 @@ git checkout tags/1.17
* Add this line:

```ruby
gem 'the_foreman_proxmox', :path => '/your_path_to/foreman_proxmox'
gem 'foreman_fog_proxmox', :path => '/your_path_to/foreman_proxmox'
```

* In foreman directory, install dependencies:
Expand Down Expand Up @@ -139,10 +139,10 @@ bundle exec rake db:seed
bundle exec rake permissions:reset
```

* In foreman directory, after you modify the_foreman_proxmox specific assets (proxmox.js, etc) you have to precompile it:
* In foreman directory, after you modify foreman_fog_proxmox specific assets (proxmox.js, etc) you have to precompile it:

```shell
bundle plugin:assets:precompile[the_foreman_proxmox]
bundle plugin:assets:precompile[foreman_fog_proxmox]
```

* In foreman directory, run rails server:
Expand All @@ -162,7 +162,7 @@ See details in [foreman plugin development](https://projects.theforeman.org/proj
## Contributing

You can reach the [contributors](CONTRIBUTORS.md).
Bug reports and pull requests are welcome on GitHub at [ForemanProxmox](https://github.com/tristanrobert/foreman_proxmox). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
Bug reports and pull requests are welcome on GitHub at [ForemanFogProxmox](https://github.com/tristanrobert/foreman_proxmox). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

Please read [how to contribute](CONTRIBUTING.md).

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ end

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'TheForemanProxmox'
rdoc.title = 'ForemanFogProxmox'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
Expand Down
6 changes: 3 additions & 3 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Sponsor ForemanProxmox plugin development
# Sponsor ForemanFogProxmox plugin development

ForemanProxmox plugin is an [GPL-3](LICENSE) licensed open source project and completely free to use.
ForemanFogProxmox plugin is an [GPL-3](LICENSE) licensed open source project and completely free to use.

However, the amount of effort needed to maintain and develop the project could be support by donations.

You can support ForemanProxmox plugin development via the following methods:
You can support ForemanFogProxmox plugin development via the following methods:

* [Donate by PayPal](https://paypal.me/TristanRobert)
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Copyright 2018 Tristan Robert

// This file is part of TheForemanProxmox.
// This file is part of ForemanFogProxmox.

// TheForemanProxmox is free software: you can redistribute it and/or modify
// ForemanFogProxmox is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// TheForemanProxmox is distributed in the hope that it will be useful,
// ForemanFogProxmox is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
// along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

function cdromSelected(item) {
var selected = $(item).val();
Expand Down Expand Up @@ -60,7 +60,7 @@ function initOptions(name){
tfm.tools.showSpinner();
$.getJSON({
type: 'get',
url: '/the_foreman_proxmox/isos/'+storage,
url: '/foreman_fog_proxmox/isos/'+storage,
complete: function(){
tfm.tools.hideSpinner();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

# Copyright 2018 Tristan Robert

# This file is part of TheForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

module TheForemanProxmox
module ForemanFogProxmox
module Controller
module Parameters
module ComputeResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

# Copyright 2018 Tristan Robert

# This file is part of TheForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

module TheForemanProxmox
module ForemanFogProxmox
class ComputeResourcesController < ::ApplicationController
before_action :load_compute_resource

# GET the_foreman_proxmox/isos/:storage
# GET foreman_fog_proxmox/isos/:storage
def isos
volumes = @compute_resource.isos(params[:storage])
respond_to do |format|
Expand All @@ -32,7 +32,7 @@ def isos
private

def load_compute_resource
@compute_resource = ComputeResource.find_by(type: 'TheForemanProxmox::Proxmox')
@compute_resource = ComputeResource.find_by(type: 'ForemanFogProxmox::Proxmox')
end
end
end
8 changes: 4 additions & 4 deletions app/helpers/proxmox_compute_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

# Copyright 2018 Tristan Robert

# This file is part of TheForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

require 'fog/proxmox/helpers/disk_helper'
require 'fog/proxmox/helpers/nic_helper'
Expand Down
16 changes: 8 additions & 8 deletions app/helpers/proxmox_compute_selectors_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

# Copyright 2018 Tristan Robert

# This file is part of TheForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

module ProxmoxComputeSelectorsHelper
def proxmox_controllers_map
[TheForemanProxmox::OptionsSelect.new(id:'ide', name: 'IDE', range: 3),
TheForemanProxmox::OptionsSelect.new(id:'sata', name: 'SATA', range: 5),
TheForemanProxmox::OptionsSelect.new(id:'scsi', name: 'SCSI', range: 13),
TheForemanProxmox::OptionsSelect.new(name:'VirtIO Block', id: 'virtio', range: 15)]
[ForemanFogProxmox::OptionsSelect.new(id:'ide', name: 'IDE', range: 3),
ForemanFogProxmox::OptionsSelect.new(id:'sata', name: 'SATA', range: 5),
ForemanFogProxmox::OptionsSelect.new(id:'scsi', name: 'SCSI', range: 13),
ForemanFogProxmox::OptionsSelect.new(name:'VirtIO Block', id: 'virtio', range: 15)]
end

def proxmox_operating_systems_map
Expand Down
8 changes: 4 additions & 4 deletions app/models/concerns/fog_extensions/proxmox/disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

# Copyright 2018 Tristan Robert

# This file is part of ForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

module FogExtensions
module Proxmox
Expand Down
8 changes: 4 additions & 4 deletions app/models/concerns/fog_extensions/proxmox/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

# Copyright 2018 Tristan Robert

# This file is part of TheForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

module FogExtensions
module Proxmox
Expand Down
8 changes: 4 additions & 4 deletions app/models/concerns/fog_extensions/proxmox/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

# Copyright 2018 Tristan Robert

# This file is part of TheForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

require 'fog/proxmox/helpers/cpu_helper'

Expand Down
8 changes: 4 additions & 4 deletions app/models/concerns/fog_extensions/proxmox/volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

# Copyright 2018 Tristan Robert

# This file is part of TheForemanProxmox.
# This file is part of ForemanFogProxmox.

# TheForemanProxmox is free software: you can redistribute it and/or modify
# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# TheForemanProxmox is distributed in the hope that it will be useful,
# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TheForemanProxmox. If not, see <http://www.gnu.org/licenses/>.
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

module FogExtensions
module Proxmox
Expand Down
Loading

0 comments on commit 1e33264

Please sign in to comment.