Skip to content

Commit

Permalink
Merge branch 'shelleg-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
samherve committed Apr 26, 2017
2 parents 803e853 + 3d702af commit 676d350
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 2 deletions.
10 changes: 8 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
nexus_version: '3.2.1-01'
nexus_version: '3.3.0-01'
nexus_package: "nexus-{{ nexus_version }}-unix.tar.gz"
nexus_download_dir: '/tmp'
nexus_backup_dir: '/var/nexus-backup'
Expand Down Expand Up @@ -208,9 +208,15 @@ nexus_repos_raw_proxy:
- name: ubuntu-archive
remote_url: 'http://archive.ubuntu.com/ubuntu/'

nexus_repos_raw_hosted:
- name: raw-internal
version_policy: release
write_policy: allow_once

nexus_repos_raw_group:
- name: raw-all
member_repos:
- raw-internal
- ubuntu-archive

# Docker support
Expand Down Expand Up @@ -303,4 +309,4 @@ nexus_repos_npm_group:
nexus_repos_npm_proxy:
- name: npm-proxy
blob_store: "{{ nexus_blob_names.npm.blob }}"
remote_url: https://registry.npmjs.org
remote_url: https://registry.npmjs.org
28 changes: 28 additions & 0 deletions files/groovy/create_repo_raw_hosted.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import groovy.json.JsonSlurper
import org.sonatype.nexus.repository.config.Configuration

parsed_args = new JsonSlurper().parseText(args)

configuration = new Configuration(
repositoryName: parsed_args.name,
recipeName: 'raw-hosted',
online: true,
attributes: [
storage: [
writePolicy: parsed_args.write_policy.toUpperCase(),
blobStoreName: parsed_args.blob_store,
strictContentTypeValidation: Boolean.valueOf(parsed_args.strict_content_validation)
]
]
)

def existingRepository = repository.getRepositoryManager().get(parsed_args.name)

if (existingRepository != null) {
existingRepository.stop()
configuration.attributes['storage']['blobStoreName'] = existingRepository.configuration.attributes['storage']['blobStoreName']
existingRepository.update(configuration)
existingRepository.start()
} else {
repository.getRepositoryManager().create(configuration)
}
5 changes: 5 additions & 0 deletions tasks/create_repo_raw_hosted_each.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- include: call_script.yml
vars:
script_name: create_repo_raw_hosted
args: "{{ _nexus_repos_raw_defaults|combine(item) }}"
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
- include: create_repo_raw_proxy_each.yml
with_items: "{{ nexus_repos_raw_proxy }}"

- include: create_repo_raw_hosted_each.yml
with_items: "{{ nexus_repos_raw_hosted }}"

- include: create_repo_raw_group_each.yml
with_items: "{{ nexus_repos_raw_group }}"
when: nexus_config_raw
Expand Down
1 change: 1 addition & 0 deletions tasks/nexus_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
- create_repo_pypi_hosted
- create_repo_pypi_proxy
- create_repo_pypi_group
- create_repo_raw_hosted
- create_repo_raw_proxy
- create_repo_raw_group
- create_repo_rubygems_hosted
Expand Down

0 comments on commit 676d350

Please sign in to comment.