Student User
2019-08-05 2f2b2ecef98b569b745acd8aa61c3ad2b89fe75d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
%>