This file contains hidden or 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
| function Slack-Rich-Notification ($notification) | |
| { | |
| $payload = @{ | |
| channel = $OctopusParameters['Channel'] | |
| username = $OctopusParameters['Username']; | |
| icon_url = $OctopusParameters['IconUrl']; | |
| attachments = @( | |
| @{ | |
| fallback = $notification["fallback"]; | |
| color = $notification["color"]; |
This file contains hidden or 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
| #!/bin/bash | |
| # | |
| # add the "-x" option to the shebang line if you want a more verbose output | |
| # | |
| # set some colors for status OK, FAIL and titles | |
| SETCOLOR_SUCCESS="echo -en \\033[0;32m" | |
| SETCOLOR_FAILURE="echo -en \\033[1;31m" | |
| SETCOLOR_NORMAL="echo -en \\033[0;39m" | |
| SETCOLOR_TITLE_PURPLE="echo -en \\033[0;35m" # purple |
This file contains hidden or 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
| import org.sonatype.nexus.repository.storage.StorageFacet; | |
| import org.sonatype.nexus.repository.storage.Query; | |
| import org.joda.time.DateTime; | |
| import org.joda.time.format.DateTimeFormat; | |
| def fmt = DateTimeFormat.forPattern('yyyy-MM-dd HH:mm:ss'); | |
| // Get a repository | |
| def repo = repository.repositoryManager.get('nuget-releases'); | |
| // Get a database transaction | |
| def tx = repo.facet(StorageFacet).txSupplier().get(); |
This file contains hidden or 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
| import org.sonatype.nexus.repository.storage.StorageFacet; | |
| import org.sonatype.nexus.repository.storage.Query; | |
| import org.joda.time.DateTime; | |
| import org.joda.time.format.DateTimeFormat; | |
| def fmt = DateTimeFormat.forPattern('yyyy-MM-dd HH:mm:ss'); | |
| [ | |
| 'maven-releases', | |
| 'other-releases' | |
| ].each { reponame -> |
This file contains hidden or 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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |