Skip to content

Commit

Permalink
add Docker build file
Browse files Browse the repository at this point in the history
  • Loading branch information
Student User committed Aug 5, 2019
1 parent eb776d8 commit 2f2b2ec
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions nexus3/solo.json.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) 2016-present Sonatype, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

<%=
require 'json'

raise RuntimeError, 'environment variable DOCKER_TYPE is required' if ENV['DOCKER_TYPE'].nil? || ENV['DOCKER_TYPE'].empty?
raise RuntimeError, 'environment variable SONATYPE_DIR is required' if ENV['SONATYPE_DIR'].nil? || ENV['SONATYPE_DIR'].empty?
raise RuntimeError, 'environment variable NEXUS_HOME is required' if ENV['NEXUS_HOME'].nil? || ENV['NEXUS_HOME'].empty?
raise RuntimeError, 'environment variable NEXUS_DATA is required' if ENV['NEXUS_DATA'].nil? || ENV['NEXUS_DATA'].empty?

{
:run_list => [ "recipe[nexus_repository_manager::#{ENV['DOCKER_TYPE']}]" ],
:java => {
:install_flavor => 'openjdk',
:accept_license_agreement => true
},
:nexus_repository_manager => {
:version => ENV['NEXUS_VERSION'],
:nexus_download_url => ENV['NEXUS_DOWNLOAD_URL'],
:nexus_download_sha256 => ENV['NEXUS_DOWNLOAD_SHA256_HASH'],
:sonatype => {
:path => ENV['SONATYPE_DIR'],
},
:sonatype_work => {
:path => ENV['SONATYPE_DIR'] + '/sonatype-work'
},
:nexus_home => {
:path => ENV['SONATYPE_DIR'] + '/nexus'
},
:nexus_data => {
:path => ENV['NEXUS_DATA']
},
:properties => {
# Set the context_path to the NEXUS_CONTEXT environment variable
# that may be passed into the docker run command.
:context_path => "/${NEXUS_CONTEXT}"
}
}
}.to_json
%>

0 comments on commit 2f2b2ec

Please sign in to comment.