GithubHelp home page GithubHelp logo

sonarqube-on-cf's Introduction

Deploying Sonarqube on Cloud.gov (Cloud Foundry)

Setup

You'll need the following:

Installation

Open your command line from this directory and follow these steps:

$ cf create-space sonarqube
$ cf create-app sonar

# Before the next step, review the service marketplace from the cloud.gov organization dashboard or use `cf marketplace` to find the mysql service(s) to target - suggest using `mysql-shared` for testing. 
$ cf marketplace

# To provision a new service instance for your app, you can use the dashboard GUI or use the cf-cli create-service command - the command looks like this: `cf create-service {{service}} {{plan}} {{service_name}}`. Example:

$ cf create-service aws-rds shared-mysql sonar-db
$ cf create-service-key sonar-db sonar
$ cf service-key sonar-db sonar

That's it you now run the cf push command which will take your manifest.yml file, pull down the docker container, and parse the service credentials (from VCAP_SERVICES) using the run.sh script.

cf push --random-route

Manually provide credentials

credentials.yml should be created via the run.sh script automatically. But, if you don't have access to the service broker for some odd reason; you can manually input values into the credentials.yml file directly and the manifest.yml file will inject them for you.

cp credentials.yml.sample credentials.yml

Installing additional plugins

Installing plugins via Marketplace doesn't work well since download files exist in the ephemeral disk and will disapper when the container is restarted. You can use Manual Installation. You need to have plugins before sonar starts and place them into /opt/sonarqube/extensions/plugins.

Here is an example to install GitHub Authentication Plugin.

cat <<EOF > manifest.yml
applications:
- name: sonar
  memory: 2g
  health-check-type: http
  health-check-http-endpoint: /
  command: |
    wget -q -P /opt/sonarqube/extensions/plugins/ https://binaries.sonarsource.com/Distribution/sonar-auth-github-plugin/sonar-auth-github-plugin-1.4.0.695.jar && \
    ./run.sh 
  docker:
    image: sonarqube:7.4-community
  env:
    SONARQUBE_JDBC_USERNAME: ((username))
    SONARQUBE_JDBC_PASSWORD: ((password))
    SONARQUBE_JDBC_URL: jdbc:mysql://((hostname)):((port))/((name))?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
EOF

sonarqube-on-cf's People

Contributors

jjediny avatar making avatar

Watchers

 avatar  avatar

Forkers

18f

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.