GithubHelp home page GithubHelp logo

houssoli / sonar-ansible-upgrade Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nortal/sonar-ansible-upgrade

0.0 1.0 0.0 34 KB

Ansible role for automating Sonar upgrade procedure

License: Apache License 2.0

Shell 54.03% Dockerfile 45.97%

sonar-ansible-upgrade's Introduction

Ansible role for Sonar Upgrade

This role has been tested with Sonar upgrade on Centos 6 with MySQL database for following versions:

  • 5.1.12 -> 5.4
  • 5.4 -> 6.0
  • 6.0 -> 6.4
  • 6.4 -> 6.7.5
  • 6.7.5 -> 7.3

Upgrade process

Sonar describes the upgrade process like this:

  1. Stop the old SonarQube server
  2. Download and unzip the new SonarQube distribution in a fresh directory, let's say NEW_SONARQUBE_HOME.
  3. Start it using the default H2 database and use the update center to install the plugins you need.
  4. Manually install any custom plugins.
  5. Stop the new server.
  6. Update the content of the sonar.properties and wrapper.conf files located in the NEW_SONARQUBE_HOME/conf directory with the content of the related files in the OLD_SONARQUBE_HOME/conf directory (web server URL, database settings, etc.). Do not copy-paste the old files.
  7. If a custom JDBC driver is used, copy it into NEW_SONARQUBE_HOME/extensions/jdbc-driver/.
  8. (warning) Back up your database.
  9. (warning) Remove the data/es directory.
  10. Start the new web server
  11. Browse to http://localhost:9000/setup (replace "localhost:9000" by your own URL) and follow the setup instructions.

After configuring given Ansible role this process will look like this:

  1. Set new version in playbook
  2. Run playbook for Sonar server
  3. Browse to http://localhost:9000/setup (replace "localhost:9000" by your own URL) and follow the setup instructions.

Ansible role will cover all the rest including MySQL database backup and applying custom configuration.

Variables

Following default variables have been defined:

Variable Value Comment
sonar_user sonar Under what user Sonar will be installed
sonar_home_root /home/sonar Root path hosting all Sonar versions
sonar_home {{ sonar_home_root }}/sonarqube-{{ sonar_target_version }} Home path of new Sonar version (upgrade target)
sonar_db_create_backup true Should backup be performed. Can be disabled for testing
sonar_db_name sonar Database name
sonar_db_port 3306 Database port
sonar_db_encoding utf8 Database encoding
mysql_connector_version 5.1.38 MySQL java connector version
sonar_plugins_url_file default-sonar-plugins.yml Additional yml file describing plugins that should be installed

Following parameters are required to be defined at the playbook:

Variable Comment
sonar_target_version Target version to upgrade to
sonar_db_host Database hostname
sonar_db_user Username for Sonar database
sonar_db_password Password for Sonar database
crowd_url Url for Atlassian Crowd
crowd_application Application name for Crowd access
crowd_password Application password for Crowd access

Current limitations

This was developed for use in Nortal so at the moment lacking bit of flexibility.

* sonar properties and rest of configuration (wrapper config) templates could be externalized.
* more database options could be added. Only MySQL at the moment.

sonar-ansible-upgrade's People

Contributors

priitliivak avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.