From 2f2b2ecef98b569b745acd8aa61c3ad2b89fe75d Mon Sep 17 00:00:00 2001
From: Student User <student@workstation.lab.example.com>
Date: Mon, 05 Aug 2019 17:42:18 +0200
Subject: [PATCH] add Docker build file

---
 nexus3/solo.json.erb |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/nexus3/solo.json.erb b/nexus3/solo.json.erb
new file mode 100644
index 0000000..ebe57e6
--- /dev/null
+++ b/nexus3/solo.json.erb
@@ -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
+%>

--
Gitblit v1.9.3