-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from hagzag/master
Adding Docker,Pypi, Raw, NPM, Bower repository options [ false by default ], move templates/groovy -> files/groovy
- Loading branch information
Showing
55 changed files
with
955 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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: 'bower-group', | ||
online: true, | ||
attributes: [ | ||
group : [ | ||
memberNames: parsed_args.member_repos | ||
], | ||
storage: [ | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 'bower-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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import groovy.json.JsonSlurper | ||
import org.sonatype.nexus.repository.config.Configuration | ||
|
||
parsed_args = new JsonSlurper().parseText(args) | ||
|
||
authentication = parsed_args.remote_username == null ? null : [ | ||
type: 'username', | ||
username: parsed_args.remote_username, | ||
password: parsed_args.remote_password | ||
] | ||
|
||
configuration = new Configuration( | ||
repositoryName: parsed_args.name, | ||
recipeName: 'bower-proxy', | ||
online: true, | ||
attributes: [ | ||
bower: [ | ||
rewritePackageUrls: true | ||
], | ||
proxy: [ | ||
remoteUrl: parsed_args.remote_url, | ||
contentMaxAge: 1440.0, | ||
metadataMaxAge: 1440.0 | ||
], | ||
httpclient: [ | ||
blocked: false, | ||
autoBlock: true | ||
], | ||
storage: [ | ||
blobStoreName: parsed_args.blob_store, | ||
strictContentTypeValidation: Boolean.valueOf(parsed_args.strict_content_validation) | ||
], | ||
negativeCache: [ | ||
enabled: true, | ||
timeToLive: 1440.0 | ||
] | ||
] | ||
) | ||
|
||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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: 'docker-group', | ||
online: true, | ||
attributes: [ | ||
docker: [ | ||
httpPort: parsed_args.http_port, | ||
v1Enabled : parsed_args.v1_enabled | ||
], | ||
group: [ | ||
memberNames: [ | ||
"private-registry", | ||
"proxy-registry" | ||
] | ||
], | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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: 'docker-hosted', | ||
online: true, | ||
attributes: [ | ||
docker: [ | ||
httpPort: parsed_args.http_port, | ||
v1Enabled : parsed_args.v1_enabled | ||
], | ||
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) | ||
} |
Oops, something went wrong.