Skip to content

Commit

Permalink
Merge pull request #5 from rightscale/PHX-1467_add_update
Browse files Browse the repository at this point in the history
PHX-1467 Re-add update command
  • Loading branch information
psschroeter authored Feb 13, 2019
2 parents 1fdbd2e + 450428f commit e1e4082
Show file tree
Hide file tree
Showing 11 changed files with 936 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
vendor/
version.go
version.yml
build
./right_pt
/right_pt
*.coverprofile
*.bak
*.old
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
v1.0.1 / 2019-02-12
-------------------
* Add in update code

v1.0.0 / 2019-02-12
-------------------
* Initial release
135 changes: 134 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
branch = "master"
name = "goa.design/plugins"

# https://github.com/golang/dep/issues/1799
[[override]]
source = "https://github.com/fsnotify/fsnotify/archive/v1.4.7.tar.gz"
name = "gopkg.in/fsnotify.v1"

[prune]
go-tests = true
unused-packages = true
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

`right_pt` is a command line tool to aid in the development and testing of RightScale Policies. The tool is able to syntax check, upload, and run Policies.

[![Travis CI Build Status](https://travis-ci.org/rightscale/right_pt.svg?branch=master)](https://travis-ci.org/rightscale/right_pt?branch=master)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/rightscale/right_pt?branch=master&svg=true)](https://ci.appveyor.com/project/RightScale/right-pt?branch=master)
[![Travis CI Build Status](https://travis-ci.com/rightscale/right_pt.svg?token=6Udhsz2ZbD68aBb7ApTx&branch=master)](https://travis-ci.com/rightscale/right_pt)

* [Installation](#installation)
* [Configuration](#configuration)
* [Managing RightScripts](#managing-rightscripts)
* [RightScript Usage](#rightscript-usage)
* [Managing ServerTemplates](#managing-servertemplates)
* [ServerTemplate Usage](#servertemplate-usage)
* [Usage](#usage)
* [Contributors](#contributors)
* [License](#license)

Expand Down Expand Up @@ -80,9 +76,11 @@ right_pt script [<flags>] <file> [<parameters>...]
## Contributors

This tool is maintained by [Douglas Thrift (douglaswth)](https://github.com/douglaswth),
[Peter Schroeter (psschroeter)](https://github.com/psschroeter)
[Peter Schroeter (psschroeter)](https://github.com/psschroeter),
[Avinash Bhashyam (avinashbhashyam-rs)](https://github.com/avinashbhashyam-rs)


## License

The `right_pt` source code is subject to the MIT license, see the
[LICENSE](https://github.com/douglaswth/right_pt/blob/master/LICENSE) file.
[LICENSE](https://github.com/rightscale/right_pt/blob/master/LICENSE) file.
18 changes: 14 additions & 4 deletions cmd/right_pt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ Example: right_pt script max_snapshots.pt --result snapshots volumes=@ec2_volume
configShowCmd = configCmd.Command("show", "Show configuration")

// ----- Update right_st -----
// updateCmd = app.Command("update", "Update "+app.Name+" executable")
updateCmd = app.Command("update", "Update "+app.Name+" executable")

// updateListCmd = updateCmd.Command("list", "List any available updates for the "+app.Name+" executable")
updateListCmd = updateCmd.Command("list", "List any available updates for the "+app.Name+" executable")

// updateApplyCmd = updateCmd.Command("apply", "Apply the latest update for the current major version or a specified major version")
// updateApplyMajorVersion = updateApplyCmd.Flag("major-version", "Major version to update to").Short('m').Int()
updateApplyCmd = updateCmd.Command("apply", "Apply the latest update for the current major version or a specified major version")
updateApplyMajorVersion = updateApplyCmd.Flag("major-version", "Major version to update to").Short('m').Int()
)

func main() {
Expand Down Expand Up @@ -160,6 +160,16 @@ func main() {
if err != nil {
fatalError("%s\n", err.Error())
}
case updateListCmd.FullCommand():
err := UpdateList(VV, os.Stdout)
if err != nil {
fatalError("%s\n", err.Error())
}
case updateApplyCmd.FullCommand():
err := UpdateApply(VV, os.Stdout, *updateApplyMajorVersion, "")
if err != nil {
fatalError("%s\n", err.Error())
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions cmd/right_pt/right_pt_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main_test

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"testing"
)

func TestRightSt(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "RightPt Suite")
}
Loading

0 comments on commit e1e4082

Please sign in to comment.