Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
rename imports and cleanup goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Weiss committed Jan 12, 2019
1 parent 0be18fd commit a340848
Show file tree
Hide file tree
Showing 33 changed files with 96 additions and 104 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
test:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/opencontrol/oscalkit
working_directory: /go/src/github.com/docker/oscalkit
environment:
TEST_RESULTS: /tmp/test-results
steps:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
deploy:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/opencontrol/oscalkit
working_directory: /go/src/github.com/docker/oscalkit
steps:
- setup_remote_docker:
docker_layer_caching: true
Expand Down
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ Makefile
oscalkit
README.md
sample/
oscalkit_*
docs/
LICENSE.md
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.dll
*.so
*.dylib
oscalkit_*

# Test binary, build with `go test -c`
*.test
coverage.txt

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
Expand Down
21 changes: 6 additions & 15 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
builds:
- binary: oscalkit
main: ./cli/main.go
ldflags: -s -w -X github.com/opencontrol/oscalkit/cli/version.Version={{.Version}} -X github.com/opencontrol/oscalkit/cli/version.Build={{.ShortCommit}} -X github.com/opencontrol/oscalkit/cli/version.Date={{.Date}}
ldflags: -s -w -X github.com/docker/oscalkit/cli/version.Version={{.Version}} -X github.com/docker/oscalkit/cli/version.Build={{.ShortCommit}} -X github.com/docker/oscalkit/cli/version.Date={{.Date}}
env:
- CGO_ENABLED=0
goos:
Expand All @@ -11,17 +11,8 @@ builds:
goarch:
- amd64

nfpm:
homepage: https://github.com/opencontrol/oscalkit
license: CC0 1.0
dependencies:
- libxml2-utils
formats:
- deb
- rpm

dockers:
- image: opencontrolorg/oscalkit
- image: docker/oscalkit
dockerfile: Dockerfile.release
tag_templates:
- "{{ .Version }}"
Expand All @@ -30,11 +21,11 @@ dockers:
brew:
name: oscalkit
github:
owner: opencontrol
owner: docker
name: homebrew-oscalkit
commit_author:
name: OpenControl
email: [email protected]
homepage: https://github.com/opencontrol/oscalkit
name: Andrew Weiss
email: [email protected]
homepage: https://github.com/docker/oscalkit
dependencies:
- libxml2
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.

FROM golang:1.11-alpine AS builder
WORKDIR /go/src/github.com/opencontrol/oscalkit
WORKDIR /go/src/github.com/docker/oscalkit
ARG VERSION
ARG BUILD
ARG DATE
COPY . .
WORKDIR /go/src/github.com/opencontrol/oscalkit/cli
RUN CGO_ENABLED=0 go build -o oscalkit -v -ldflags "-s -w -X github.com/opencontrol/oscalkit/cli/version.Version=${VERSION} -X github.com/opencontrol/oscalkit/cli/version.Build=${BUILD} -X github.com/opencontrol/oscalkit/cli/version.Date=${DATE}"
WORKDIR /go/src/github.com/docker/oscalkit/cli
RUN CGO_ENABLED=0 go build -o oscalkit -v -ldflags "-s -w -X github.com/docker/oscalkit/cli/version.Version=${VERSION} -X github.com/docker/oscalkit/cli/version.Build=${BUILD} -X github.com/docker/oscalkit/cli/version.Date=${DATE}"

FROM alpine:3.7
RUN apk --no-cache add ca-certificates libxml2-utils
WORKDIR /oscalkit
COPY --from=builder /go/src/github.com/opencontrol/oscalkit/cli/oscalkit /oscalkit-linux-x86_64
COPY --from=builder /go/src/github.com/docker/oscalkit/cli/oscalkit /oscalkit-linux-x86_64
RUN ln -s /oscalkit-linux-x86_64 /usr/local/bin/oscalkit
ENTRYPOINT ["oscalkit"]
12 changes: 6 additions & 6 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.

FROM golang:1.11 AS race-detector
WORKDIR /go/src/github.com/opencontrol/oscalkit
WORKDIR /go/src/github.com/docker/oscalkit
COPY . .
WORKDIR /go/src/github.com/opencontrol/oscalkit/cli
WORKDIR /go/src/github.com/docker/oscalkit/cli
RUN go build -race

FROM golang:1.11
Expand All @@ -21,7 +21,7 @@ ARG VERSION
ARG BUILD
ARG DATE
ARG BINARY
WORKDIR /go/src/github.com/opencontrol/oscalkit
COPY --from=race-detector /go/src/github.com/opencontrol/oscalkit .
WORKDIR /go/src/github.com/opencontrol/oscalkit/cli
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /${BINARY} -v -ldflags "-s -w -X github.com/opencontrol/oscalkit/cli/version.Version=${VERSION} -X github.com/opencontrol/oscalkit/cli/version.Build=${BUILD} -X github.com/opencontrol/oscalkit/cli/version.Date=${DATE}"
WORKDIR /go/src/github.com/docker/oscalkit
COPY --from=race-detector /go/src/github.com/docker/oscalkit .
WORKDIR /go/src/github.com/docker/oscalkit/cli
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /${BINARY} -v -ldflags "-s -w -X github.com/docker/oscalkit/cli/version.Version=${VERSION} -X github.com/docker/oscalkit/cli/version.Build=${BUILD} -X github.com/docker/oscalkit/cli/version.Date=${DATE}"
2 changes: 1 addition & 1 deletion Dockerfile.generate
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM golang:1.11-alpine
RUN apk add --no-cache git
WORKDIR /go/src/github.com/opencontrol/oscalkit/metaschema
WORKDIR /go/src/github.com/docker/oscalkit/metaschema
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ VERSION := 0.2.0
BUILD := $(shell git rev-parse --short HEAD)-dev
DATE := $(shell date "+%Y-%m-%d")

NAMESPACE := opencontrolorg
NAMESPACE := docker
REPO := oscalkit
BINARY=oscalkit_$(GOOS)_$(GOARCH)

.DEFAULT_GOAL := $(BINARY)
.PHONY: test build-docker push $(BINARY) clean
.PHONY: test build-docker push $(BINARY) clean generate

generate:
docker build -t $(NAMESPACE)/$(REPO):generate -f Dockerfile.generate .
docker container run \
-v $$PWD:/go/src/github.com/opencontrol/oscalkit \
-v $$PWD:/go/src/github.com/docker/oscalkit \
$(NAMESPACE)/$(REPO):generate \
sh -c "go generate"

Expand All @@ -37,17 +37,19 @@ build-docker:
push: build-docker
docker image push $(NAMESPACE)/$(REPO):$(BUILD)

# Builds binary for the OS/arch. Assumes that types have already been generated
# via the "generate" target
$(BINARY):
build:
docker image build -f Dockerfile.build \
--build-arg GOOS=$(GOOS) \
--build-arg GOARCH=$(GOARCH) \
--build-arg VERSION=$(VERSION) \
--build-arg BUILD=$(BUILD) \
--build-arg DATE=$(DATE) \
--build-arg BINARY=$(BINARY) \
-t $(NAMESPACE)/$(REPO):$(VERSION)-$(BUILD)-builder .;
-t $(NAMESPACE)/$(REPO):$(VERSION)-$(BUILD)-builder .

# Builds binary for the OS/arch. Assumes that types have already been generated
# via the "generate" target
$(BINARY): build
$(eval ID := $(shell docker create $(NAMESPACE)/$(REPO):$(VERSION)-$(BUILD)-builder))
@docker cp $(ID):/$(BINARY) .
@docker rm $(ID) >/dev/null
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# oscalkit

[![CircleCI](https://circleci.com/gh/opencontrol/oscalkit.svg?style=svg)](https://circleci.com/gh/opencontrol/oscalkit) [![codecov](https://codecov.io/gh/opencontrol/oscalkit/branch/master/graph/badge.svg)](https://codecov.io/gh/opencontrol/oscalkit) [![GoDoc](https://godoc.org/github.com/opencontrol/oscalkit?status.svg)](https://godoc.org/github.com/opencontrol/oscalkit)
[![CircleCI](https://circleci.com/gh/docker/oscalkit.svg?style=svg)](https://circleci.com/gh/docker/oscalkit) [![codecov](https://codecov.io/gh/docker/oscalkit/branch/master/graph/badge.svg)](https://codecov.io/gh/docker/oscalkit) [![GoDoc](https://godoc.org/github.com/docker/oscalkit?status.svg)](https://godoc.org/github.com/docker/oscalkit)

> In development. Since the OSCAL schemas are still under active development, parsing errors may occur if running the tool against OSCAL documents that are developed against iterations of the schemas that aren't supported. Individual [Releases](https://github.com/opencontrol/oscalkit/releases) of `oscalkit` will indicate in the notes which commits in the usnistgov/OSCAL repo against which the tool has been tested.
> In development. Since the OSCAL schemas are still under active development, parsing errors may occur if running the tool against OSCAL documents that are developed against iterations of the schemas that aren't supported. Individual [Releases](https://github.com/docker/oscalkit/releases) of `oscalkit` will indicate in the notes which commits in the usnistgov/OSCAL repo against which the tool has been tested.
Barebones Go SDK and CLI tool for parsing OSCAL, converting between OSCAL-formatted XML, JSON and YAML and for converting from [OpenControl](http://opencontrol.cfapps.io/) projects in to OSCAL.
Barebones Go SDK and CLI tool for parsing OSCAL, converting between OSCAL-formatted XML, JSON and YAML and for converting from [docker](http://opencontrol.cfapps.io/) projects in to OSCAL.

## Supported OSCAL Components

Expand All @@ -18,23 +18,23 @@ The following OSCAL components are currently supported:

## Installing

You can download the appropriate `oscalkit` command-line utility for your system from the [GitHub Releases](https://github.com/opencontrol/oscalkit/releases) page and run it from your local machine directly. For easier execution, you can move it to an appropriate directory listed in your `$PATH` environment variable. If you prefer, you can download and install via the included RPM/Deb packages on Linux or Homebrew recipe on macOS. A [Docker image](https://hub.docker.com/r/opencontrolorg/oscalkit/) is also made available on Docker Hub.
You can download the appropriate `oscalkit` command-line utility for your system from the [GitHub Releases](https://github.com/docker/oscalkit/releases) page and run it from your local machine directly. For easier execution, you can move it to an appropriate directory listed in your `$PATH` environment variable. If you prefer, you can download and install via the included RPM/Deb packages on Linux or Homebrew recipe on macOS. A [Docker image](https://hub.docker.com/r/docker/oscalkit/) is also made available on Docker Hub.

### Homebrew

$ brew tap opencontrol/homebrew-oscalkit
$ brew tap docker/homebrew-oscalkit
$ brew install oscalkit

### Docker

> Running the `oscalkit` Docker container requires either bind-mounting the directory containing your source files or passing file contents in to the command via stdin.
$ docker pull opencontrolorg/oscalkit:<version>
$ docker run -it --rm -v $PWD:/data -w /data opencontrolorg/oscalkit convert oscal-core.xml
$ docker pull docker/oscalkit:<version>
$ docker run -it --rm -v $PWD:/data -w /data docker/oscalkit convert oscal-core.xml

via stdin:

$ docker run -it --rm opencontrolorg/oscalkit convert < oscal-core.xml
$ docker run -it --rm docker/oscalkit convert < oscal-core.xml

## Usage

Expand Down Expand Up @@ -135,7 +135,7 @@ USAGE:
oscalkit convert opencontrol [command options] [opencontrol.yaml-filepath] [opencontrols-dir-path]
DESCRIPTION:
Convert OpenControl-formatted "component" and "opencontrol" YAML into
Convert OpenControl-formatted "component" and "OpenControl" YAML into
OSCAL-formatted "implementation" layer JSON
OPTIONS:
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"os"

"github.com/Sirupsen/logrus"
"github.com/opencontrol/oscalkit/cli/cmd/convert"
"github.com/opencontrol/oscalkit/cli/version"
"github.com/docker/oscalkit/cli/cmd/convert"
"github.com/docker/oscalkit/cli/version"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/convert/oscal.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"

"github.com/Sirupsen/logrus"
"github.com/opencontrol/oscalkit/types/oscal"
"github.com/docker/oscalkit/types/oscal"
"github.com/urfave/cli"
)

Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"os"

"github.com/Sirupsen/logrus"
"github.com/opencontrol/oscalkit/generator"
"github.com/opencontrol/oscalkit/templates"
"github.com/opencontrol/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/generator"
"github.com/docker/oscalkit/templates"
"github.com/docker/oscalkit/types/oscal/catalog"

"github.com/urfave/cli"
)
Expand Down
9 changes: 3 additions & 6 deletions cli/cmd/implementation.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ import (
"os"

"github.com/Sirupsen/logrus"

"github.com/opencontrol/oscalkit/templates"

"github.com/opencontrol/oscalkit/impl"

"github.com/opencontrol/oscalkit/generator"
"github.com/docker/oscalkit/generator"
"github.com/docker/oscalkit/impl"
"github.com/docker/oscalkit/templates"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"path/filepath"

"github.com/Sirupsen/logrus"
"github.com/opencontrol/oscalkit/validator"
"github.com/docker/oscalkit/validator"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package main

import (
"github.com/opencontrol/oscalkit/cli/cmd"
"github.com/docker/oscalkit/cli/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseURL = "https://opencontrol.github.io/oscalkit/"
baseURL = "https://docker.github.io/oscalkit/"
languageCode = "en-us"
title = "oscalkit"
theme = "oscalkit"
Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bref = "Install oscalkit and become familiar with the basic functionality it pro

<h3 class="section-head" id="install"><a href="#install">Install</a></h3>

oscalkit has been packaged for various OS's and as a Docker image. Navigate to the [Releases](https://github.com/opencontrol/oscalkit/releases) page to download the appropriate package for your intended platform.
oscalkit has been packaged for various OS's and as a Docker image. Navigate to the [Releases](https://github.com/docker/oscalkit/releases) page to download the appropriate package for your intended platform.

#### macOS (Homebrew)

Expand All @@ -21,11 +21,11 @@ to update:

#### Windows

Download the .exe from the [Releases](https://github.com/opencontrol/oscalkit/releases) page. Move it to a location from which it can be easily executed.
Download the .exe from the [Releases](https://github.com/docker/oscalkit/releases) page. Move it to a location from which it can be easily executed.

#### Linux

Download the binary from the [Releases](https://github.com/opencontrol/oscalkit/releases) page. Move it to a location from which it can be easily executed.
Download the binary from the [Releases](https://github.com/docker/oscalkit/releases) page. Move it to a location from which it can be easily executed.

#### Verify installation

Expand Down
4 changes: 2 additions & 2 deletions docs/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ <h1>{{.Title}}</h1>
<p>{{.Description}}</p>
</div>
<div id="action-buttons">
<a class="button primary big" href="https://github.com/opencontrol/oscalkit/releases" onclick="_gaq.push(['_trackEvent', 'kube', 'download']);">Download</a> <a class="button outline big" href="https://github.com/opencontrol/oscalkit" onclick="_gaq.push(['_trackEvent', 'kube', 'github']);">View on Github</a> <a class="button secondary big" href="https://github.com/opencontrol/oscalkit" onclick="_gaq.push(['_trackEvent', 'kube', 'github']);">OSCAL on Github</a>
<a class="button primary big" href="https://github.com/docker/oscalkit/releases" onclick="_gaq.push(['_trackEvent', 'kube', 'download']);">Download</a> <a class="button outline big" href="https://github.com/docker/oscalkit" onclick="_gaq.push(['_trackEvent', 'kube', 'github']);">View on Github</a> <a class="button secondary big" href="https://github.com/docker/oscalkit" onclick="_gaq.push(['_trackEvent', 'kube', 'github']);">OSCAL on Github</a>
<p>Download binaries for various platforms</p>
</div>
<div class="message focus" data-component="message"> <span class="close small"></span>
<mark>macOS</mark> brew install oscalkit<br/>
{{/* <a class="button inverted small " href="https://github.com/opencontrol/oscalkit/" >oscalkit </a> from <a href="https://imperavi.com/">imperavi</a> is an awesome <mark>CSS & JS Framework</mark> and i designed this template for <a href="https://gohugo.io">hugo</a> with the same original philosophy ! */}}
{{/* <a class="button inverted small " href="https://github.com/docker/oscalkit/" >oscalkit </a> from <a href="https://imperavi.com/">imperavi</a> is an awesome <mark>CSS & JS Framework</mark> and i designed this template for <a href="https://gohugo.io">hugo</a> with the same original philosophy ! */}}
</div>
{{/* <div id="kube-features">
<div class="row gutters">
Expand Down
5 changes: 2 additions & 3 deletions generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"net/url"
"testing"

"github.com/opencontrol/oscalkit/types/oscal/profile"

"github.com/opencontrol/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/types/oscal/profile"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions generator/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"strings"

"github.com/Sirupsen/logrus"

"github.com/opencontrol/oscalkit/types/oscal/catalog"
"github.com/opencontrol/oscalkit/types/oscal/profile"
"github.com/docker/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/types/oscal/profile"
)

//CreateCatalogsFromProfile maps profile controls to multiple catalogs
Expand Down
7 changes: 3 additions & 4 deletions generator/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import (
"strings"
"time"

"github.com/opencontrol/oscalkit/types/oscal/profile"

"github.com/opencontrol/oscalkit/types/oscal"
"github.com/opencontrol/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/types/oscal"
"github.com/docker/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/types/oscal/profile"
)

//ReadCatalog ReadCatalog
Expand Down
4 changes: 2 additions & 2 deletions impl/impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/url"
"testing"

"github.com/opencontrol/oscalkit/types/oscal/catalog"
"github.com/opencontrol/oscalkit/types/oscal/profile"
"github.com/docker/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/types/oscal/profile"
)

const (
Expand Down
Loading

0 comments on commit a340848

Please sign in to comment.