File tree Expand file tree Collapse file tree 5 files changed +85
-4
lines changed Expand file tree Collapse file tree 5 files changed +85
-4
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+
9+ jobs :
10+ test :
11+ strategy :
12+ matrix :
13+ go-version : [ "1.13.x", "1.14.x" ]
14+ os : [ ubuntu-latest ]
15+ runs-on : ${{ matrix.os }}
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v2
19+ with :
20+ fetch-depth : 1
21+
22+ - name : Set up Go
23+ uses : actions/setup-go@v2
24+ with :
25+ go-version : ${{ matrix.go-version }}
26+
27+ - name : Lint
28+ run : make lint
29+
30+ - name : Test
31+ run : make test
Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ create :
5+ tags :
6+ - v*
7+
8+ jobs :
9+ publish :
10+ strategy :
11+ matrix :
12+ go-version : [ "1.13.x", "1.14.x" ]
13+ os : [ ubuntu-latest ]
14+ runs-on : ${{ matrix.os }}
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v2
18+ with :
19+ fetch-depth : 1
20+
21+ - name : Set up Go
22+ uses : actions/setup-go@v2
23+ with :
24+ go-version : ${{ matrix.go-version }}
25+
26+ - name : Make dist
27+ run : make dist
28+
29+ - name : Upload release binaries
30+ 31+ env :
32+ GITHUB_TOKEN : ${{ github.token }}
33+ with :
34+ asset_paths : ' ["./bin/awssh*"]'
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ GitCommit := $(shell git rev-parse HEAD)
33LDFLAGS := "-s -w -X awssh/cmd.Version=$(Version ) -X awssh/cmd.GitCommit=$(GitCommit ) "
44OUTDIR := bin
55
6+ GOLANGCI_VERSION = 1.31.0
7+
68.PHONY : test pretty mod tidy
79test :
810 CGO_ENABLED=0 go test $(shell go list ./... | grep -v /vendor/|xargs echo) -cover -coverprofile=cover.out
@@ -19,6 +21,17 @@ pretty:
1921build :
2022 CGO_ENABLED=0 go build -ldflags $(LDFLAGS ) -o awssh
2123
24+ bin/golangci-lint : bin/golangci-lint-${GOLANGCI_VERSION}
25+ @ln -sf golangci-lint-${GOLANGCI_VERSION} bin/golangci-lint
26+ bin/golangci-lint-${GOLANGCI_VERSION} :
27+ @mkdir -p bin
28+ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ./bin/ v${GOLANGCI_VERSION}
29+ @mv bin/golangci-lint " $@ "
30+
31+ .PHONY : lint
32+ lint : bin/golangci-lint # # Run linter
33+ bin/golangci-lint run
34+
2235.PHONY : dist
2336dist :
2437 mkdir -p $(OUTDIR )
Original file line number Diff line number Diff line change 11# awssh
2+ [ ![ GitHub Workflow Status] ( https://img.shields.io/github/workflow/status/ardikabs/awssh/CI?style=flat-square )] ( https://github.com/ardikabs/awssh/actions?query=workflow%3ACI )
3+ ![ Go Version] ( https://img.shields.io/badge/go%20version-%3E=1.14-61CFDD.svg?style=flat-square )
4+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/ardikabs/awssh?style=flat-square )] ( https://goreportcard.com/report/github.com/ardikabs/awssh )
25## Description
36` awssh ` is a simple CLI providing an ssh access to EC2 utilizing an [ EC2 Instance Connect] ( https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html ) feature.<br >
47The ` awssh ` is extending the ` aws ec2-instance-connect ` command to be aware with ssh-agent and/or populate new temporary ssh keypair while trying to establish an ssh connection to the EC2 instance target.
@@ -22,11 +25,11 @@ The `awssh` is extending the `aws ec2-instance-connect` command to be aware with
2225
2326## Development Guide
2427### Prerequisites
25- * Go 1.13.5 or later
28+ * Go 1.14 or later
2629
2730### Setup
2831* Install Git
29- * Install Go 1.13.5 or later
32+ * Install Go 1.14 or later
3033* Clone this repository
3134
3235### Build and run binary file
Original file line number Diff line number Diff line change @@ -40,14 +40,14 @@ func NewLogger(debugMode bool) *zap.SugaredLogger {
4040
4141// Get used to get the application logger
4242func Get () * zap.SugaredLogger {
43- defer appLogger .Sync ()
43+ defer appLogger .Sync () // nolint: errcheck
4444 return appLogger
4545}
4646
4747// ExitWithError will terminate execution with an error result
4848// It prints the error to stderr and exits with a non-zero exit code
4949func ExitWithError (err error ) {
50- defer appLogger .Sync ()
50+ defer appLogger .Sync () // nolint: errcheck
5151 appLogger .Error (err )
5252 os .Exit (1 )
5353}
You can’t perform that action at this time.
0 commit comments