File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7+ ### [ 0.1.4] - 2025-1-31
8+
9+ ### Added
10+
11+ * Added an ` update ` command to pull the latest BloodHound images
12+
713## [ 0.1.3] - 2025-1-31
814
915### Added
Original file line number Diff line number Diff line change @@ -232,6 +232,16 @@ func RunDockerComposeDown(yaml string, volumes bool) {
232232 }
233233}
234234
235+ // RunDockerComposePull executes the "docker compose" commands to pull the latest container images for
236+ // the specified YAML file ("yaml" parameter).
237+ func RunDockerComposePull (yaml string ) {
238+ fmt .Printf ("[+] Running `%s` to pull container imahes with %s...\n " , dockerCmd , yaml )
239+ startErr := RunCmd (dockerCmd , []string {"-f" , yaml , "pull" })
240+ if startErr != nil {
241+ log .Fatalf ("Error trying to pull the container images with %s: %v\n " , yaml , startErr )
242+ }
243+ }
244+
235245// FetchLogs fetches logs from the container with the specified "name" label ("containerName" parameter).
236246func FetchLogs (containerName string , lines string ) []string {
237247 var logs []string
Original file line number Diff line number Diff line change 1+ package cmd
2+
3+ import (
4+ "fmt"
5+ docker "github.com/SpecterOps/BloodHound_CLI/cmd/internal"
6+ "github.com/spf13/cobra"
7+ )
8+
9+ // updateCmd represents the update command
10+ var updateCmd = & cobra.Command {
11+ Use : "update" ,
12+ Short : "Update the BloodHound container images if an update is available" ,
13+ Long : `Updates the BloodHound container images if an update is available.` ,
14+ Run : updateBloodHound ,
15+ }
16+
17+ func init () {
18+ rootCmd .AddCommand (updateCmd )
19+ }
20+
21+ func updateBloodHound (cmd * cobra.Command , args []string ) {
22+ err := docker .EvaluateDockerComposeStatus ()
23+ if err != nil {
24+ return
25+ }
26+ fmt .Println ("[+] Checking for BloodHound image updates..." )
27+ docker .RunDockerComposePull ("docker-compose.yml" )
28+ }
You can’t perform that action at this time.
0 commit comments