Skip to content

Commit

Permalink
Merge pull request #41 from synackd/repo-cleanup
Browse files Browse the repository at this point in the history
Cleanup unused files, improve build infra, add license to postgres, etc.
  • Loading branch information
synackd authored Aug 5, 2024
2 parents 01350b7 + ad2f5f5 commit 8355aa1
Show file tree
Hide file tree
Showing 91 changed files with 54 additions and 14,664 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
with:
fetch-tags: 1
fetch-depth: 1
- name: Set version in .version file
run: make version
- name: Unit Tests
run: go test -v ./...
- name: Release with goreleaser
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
go-version: '1.21.x'
- name: Install dependencies
run: go get ./boot-script-service ./bss-init
- name: Generate .version
run: make -C ../ version
- name: Test with the Go CLI
run: go test ./boot-script-service ./bss-init
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
kubernetes/.packaged/
.idea/
*.swp
.version

# Binaries
boot-script-service
bss-init

# Prevent certificates from getting checked in
*.ca
Expand Down
1 change: 0 additions & 1 deletion .version

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ 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).

## [1.31.1] - 2024-08-05

- Removed unused files and directories from repository
- Removed reliance on .version file for tagging containers
- While not tracked in repository, it is still generated so BSS can fetch its version
when the version endpoint is queried
- Updated Makefile
- `git describe` is now used to get version instead of .version file
- Replaced `docker` target with `container` and allowed using different container runtime
- Added version target to generate .version; used in CI and dependency for all build targets
- Got rid of unnecessary targets/recipes

## [1.31.0] - 2024-07-25

- Added CheckMacs() to BootParams struct to check MAC address format on POST/PUT/PATCH
Expand Down
31 changes: 0 additions & 31 deletions Dockerfile.bss-debugger.Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions Dockerfile.bss-postgres-test.Dockerfile

This file was deleted.

51 changes: 0 additions & 51 deletions Dockerfile.testing.Dockerfile

This file was deleted.

38 changes: 20 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,38 @@

# Service
NAME ?= bss
VERSION ?= $(shell cat .version)
DOCKER ?= docker

# Version
BUILD := $(shell git rev-parse --short HEAD)
VERSION := $(shell git describe --tags --always --abbrev=0)
BINARIES = boot-script-service bss-init
GOOS := $(if $(GOOS),$(GOOS),linux)
GOARCH := $(if $(GOARCH),$(GOARCH),amd64)

.PHONY: all
all: binaries

.PHONY: binaries
binaries: version $(BINARIES)

all : image unittest ct snyk ct_image
.PHONY: docker
container: version $(BINARIES)
$(DOCKER) build --tag openchami/bss:$(VERSION)-dirty $(DOCKEROPTS) .

binaries: $(BINARIES)
# BSS uses the .version file when printing its version, so we need to
# update it.
.PHONY: version
version:
echo '$(VERSION)' | tr -d v | tee .version

%: cmd/%/*.go
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -v -tags musl $(LDFLAGS) -o $@ ./$(dir $<)

.PHONY: clean
clean:
rm -f $(BINARIES)

image:
docker build ${NO_CACHE} --pull ${DOCKER_ARGS} --tag '${NAME}:${VERSION}' .

unittest:
./runUnitTest.sh

.PHONY: snyk
snyk:
./runSnyk.sh

ct:
./runCT.sh

ct_image:
docker build --no-cache -f test/ct/Dockerfile test/ct/ --tag hms-bss-hmth-test:${VERSION}

docker: $(BINARIES)
docker build --tag openchami/bss:v$(VERSION)-dirty $(DOCKEROPTS) .
62 changes: 0 additions & 62 deletions build_tag_push.sh

This file was deleted.

36 changes: 0 additions & 36 deletions dev/etcd/run.sh

This file was deleted.

Loading

0 comments on commit 8355aa1

Please sign in to comment.