Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add a simple groovy that shows how to delete a DBB collection #29

Open
RegiBrazil opened this issue Apr 17, 2020 · 0 comments
Open

Comments

@RegiBrazil
Copy link

It may sound easy for experts, but customers might need to delete "old left" collections at DBB repo.
@drbruce-github showed a nice simple example at
https://ibm-systems-z.slack.com/archives/C2TBPA725/p1587140011114100?thread_ts=1586352800.067200&cid=C2TBPA725
Here for people that do not have slack:
``//Delete a collection XXX
//repositoryClient.deleteCollection("XXX")
@groovy.transform.BaseScript com.ibm.dbb.groovy.ScriptLoader baseScript
import com.ibm.dbb.build.*
import com.ibm.dbb.repository.*
//Set up repository client
BuildProperties properties = BuildProperties.getInstance()
properties.load(new File("${getScriptDir()}/user.properties"))
if(!properties.url||!properties.username){
println("You must update the user.properties file first")
System.exit(0)
}
def client = new RepositoryClient()
client.setUrl(properties.url)
client.setUserId(properties.username)
if(properties.password!=null){
client.setPassword(properties.password)
}else if(properties.passwordFile!=null){
client.setPasswordFile(new File(properties.passwordFile))
}else{
println("Please enter either a password or the path for a password file in user.properties")
System.exit(0)
}
client.setForceSSLTrusted(true)
//Delete a collection XXX
client.deleteCollection("XXX")
println("XXX is deleted")

johnmnemec pushed a commit to johnmnemec/dbb that referenced this issue Sep 6, 2022
Add DBB User Build topic documentation

Signed-off-by: John Nemec <john.nemec@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant