Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
viktigpetterr committed May 11, 2022
0 parents commit 0001d33
Show file tree
Hide file tree
Showing 40 changed files with 3,464 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/debricked.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Debricked Automations

on: [push, pull_request]

jobs:
vulnerabilities-scan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- uses: actions/cache@v2
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
printf "$(go mod graph)\n\n$(go list -mod=readonly -e -m all)" > .debricked-go-dependencies.txt
- uses: debricked/actions/scan@v1
env:
DEBRICKED_TOKEN: ${{ secrets.DEBRICKED_TOKEN }}
EXCLUDED_DIRECTORIES: "pkg/cmd/scan/testdata"
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test

on:
push:
branches:
- main
pull_request:

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Build
run: go build -v ./...

- name: Vet
run: go vet ./...

- name: Test
run: bash scripts/test.sh
env:
DEBRICKED_TOKEN: ${{ secrets.DEBRICKED_TOKEN }}

- name: Test coverage
run: bash scripts/check_coverage.sh
env:
TEST_COVERAGE_THRESHOLD: 90

- name: Upload coverage report
uses: actions/upload-artifact@v3
if: always()
with:
name: coverage.html
path: coverage.html
retention-days: 2

- name: Test - E2E
run: go run cmd/debricked/main.go scan . -t ${{ secrets.DEBRICKED_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode
.idea
coverage.out
coverage.html
node_modules
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

[Unreleased]: https://github.com/viktigpetterr/composer-template/compare/v1.0.0...HEAD
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.17-alpine

WORKDIR /debricked

RUN apk add git

COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .

RUN go install ./debricked.go

ENTRYPOINT ["debricked"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Debricked AB.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
install:
go install ./cmd/debricked
test:
bash scripts/test.sh
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Debricked CLI
[![Test](https://github.com/viktigpetterr/debricked-go-cli/actions/workflows/test.yml/badge.svg)](https://github.com/viktigpetterr/debricked-go-cli/actions/workflows/test.yml)
[![Debricked scan](https://github.com/viktigpetterr/debricked-go-cli/actions/workflows/debricked.yml/badge.svg)](https://github.com/viktigpetterr/debricked-go-cli/actions/workflows/debricked.yml)

`debricked` is Debricked's own command line interface. It brings open source security, compliance and health to your project via the command prompt.

![debricked-ship](https://debricked.com/build/images/spaceship.f6582850.svg)
## Documentation
Complete documentation can be found over at [Debricked](https://debricked.com/docs/integrations/cli.html#debricked-cli).
## Contributing

## Installation

### Linux

### Windows

### MacOs
14 changes: 14 additions & 0 deletions cmd/debricked/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"debricked/pkg/cmd/root"
"fmt"
"os"
)

func main() {
if err := root.NewRootCmd().Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
39 changes: 39 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module debricked

go 1.17

require (
github.com/fatih/color v1.13.0
github.com/go-git/go-git/v5 v5.4.2
github.com/google/go-cmp v0.5.6
github.com/jedib0t/go-pretty/v6 v6.3.0
github.com/schollz/progressbar/v3 v3.8.6
github.com/spf13/cobra v1.3.0
)

require (
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sys v0.0.0-20220403020550-483a9cbc67c0 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading

0 comments on commit 0001d33

Please sign in to comment.