Skip to content
Snippets Groups Projects
Verified Commit 46f8f1f4 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent 9c3449f8
No related branches found
No related tags found
No related merge requests found
Showing
with 108 additions and 235 deletions
......@@ -2,14 +2,16 @@
<project version="4">
<component name="accountSettings">
<option name="activeProfile" value="profile:default" />
<option name="activeRegion" value="eu-west-1" />
<option name="activeRegion" value="eu-central-1" />
<option name="recentlyUsedProfiles">
<list>
<option value="profile:default" />
<option value="profile:schukai" />
</list>
</option>
<option name="recentlyUsedRegions">
<list>
<option value="eu-central-1" />
<option value="eu-west-1" />
</list>
</option>
......
......@@ -7,6 +7,7 @@
<module fileurl="file://$PROJECT_DIR$/../../../schukai/manual/manual.iml" filepath="$PROJECT_DIR$/../../../schukai/manual/manual.iml" />
<module fileurl="file://$PROJECT_DIR$/requirements-manager.iml" filepath="$PROJECT_DIR$/requirements-manager.iml" />
<module fileurl="file://$PROJECT_DIR$/../../../customer-projects/administration/templates-for-requirements/templates-for-requirements.iml" filepath="$PROJECT_DIR$/../../../customer-projects/administration/templates-for-requirements/templates-for-requirements.iml" />
<module fileurl="file://$PROJECT_DIR$/../version/version.iml" filepath="$PROJECT_DIR$/../version/version.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run requirement report" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="requirements report --grouped-by Estimation -p $PROJECT_DIR$/development/examples/example1" />
<kind value="DIRECTORY" />
<package value="gitlab.schukai.com/oss/utilities/requirements-manager" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$/application/source/main.go" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run add requirement" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman add requirement" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="requirements add --id 144444 -p $PROJECT_DIR$/development/examples/example1" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run add requirements" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman add requirements" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="requirements add -p $PROJECT_DIR$/development/examples/example1 --id=1425" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run create meta" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman create meta" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="meta print -c ID -c Title -c Created -c Version -c File -p $PROJECT_DIR$/development/examples/example1" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="reqman issues gitlab-sync" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<go_parameters value="-ldflags &quot;-X main.version=1.0.15 -X main.build=20220616123315&quot;" />
<parameters value="tasks gitlab -p $PROJECT_DIR$/development/examples/example1" />
<kind value="DIRECTORY" />
<package value="gitlab.schukai.com/oss/utilities/requirements-manager" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$/application/source/main.go" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run print changelog" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman print changelog" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="privacy print --date-format 01.02.2006 -p $PROJECT_DIR$/development/examples/example1" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run print overview" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman print overview" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="overview print -c ID -c Title -c Version -p $PROJECT_DIR$/development/examples/example1 -o /tmp/overview.pdf -f pdf" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run print overview (mey)" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman print overview (mey)" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="overview print -c ID -c ID -c Title -p $PROJECT_DIR$/../../../customer-projects/mey/alvine/requirement/documents -t $PROJECT_DIR$/../../../customer-projects/mey/alvine/requirement/template/schukai.md -l $PROJECT_DIR$/../../../customer-projects/mey/alvine/requirement/template/schukai.latex -o /tmp/overview.pdf -f pdf" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run print requirements" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman print requirements" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="requirements print -p $PROJECT_DIR$/development/examples/example1 -c ID -c Title" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run print todo" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman print todo" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="tasks print -p $PROJECT_DIR$/development/examples/example1" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="reqman requirement report" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="requirements report --gitlab --grouped-by Estimation -p $PROJECT_DIR$/development/examples/example1/req1/1/test1.md" />
<kind value="DIRECTORY" />
<package value="gitlab.schukai.com/oss/utilities/requirements-manager" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$/application/source/main.go" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run version" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqman version" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<go_parameters value="-ldflags &quot;-X main.version=1.0.15 -X main.build=20220616123315&quot;" />
<parameters value="version" />
<kind value="DIRECTORY" />
<package value="gitlab.schukai.com/oss/utilities/requirements-manager" />
......
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run print items" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="reqmanprint items" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="items print -p $PROJECT_DIR$/development/examples/example1" />
......
......@@ -6,191 +6,36 @@
#############################################################################################
#############################################################################################
COPYRIGHT_TEXT := © schukai GmbH, Released under the AGPL 3.0 License.
COMPONENTNAME := RequirementManager
COMPONENTSLUG := $(shell echo "$COMPONENTNAME" | tr '[:upper:]' '[:lower:]')
#############################################################################################
#############################################################################################
##
## more general block with standard definitions
## MORE GENERAL BLOCK WITH STANDARD DEFINITIONS
##
#############################################################################################
#############################################################################################
# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)/
THIS_MAKEFILE:=$(THIS_DIR)$(THIS_MAKEFILE_PATH)
PROJECT_ROOT:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)/
THIS_MAKEFILE:=$(PROJECT_ROOT)$(THIS_MAKEFILE_PATH)
# colors
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
LIGHTPURPLE := $(shell tput -Txterm setaf 4)
PURPLE := $(shell tput -Txterm setaf 5)
BLUE := $(shell tput -Txterm setaf 6)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
include $(PROJECT_ROOT)development/makefile/license-agpl3.mk
include $(PROJECT_ROOT)development/makefile/placeholder.mk
include $(PROJECT_ROOT)development/makefile/directories-default.mk
include $(PROJECT_ROOT)development/makefile/go.mk
include $(PROJECT_ROOT)development/makefile/color.mk
include $(PROJECT_ROOT)development/makefile/terminal.mk
include $(PROJECT_ROOT)development/makefile/output.mk
include $(PROJECT_ROOT)development/makefile/version.mk
include $(PROJECT_ROOT)development/makefile/target-help.mk
include $(PROJECT_ROOT)development/makefile/target-init.mk
include $(PROJECT_ROOT)development/makefile/target-deploy-tool.mk
include $(PROJECT_ROOT)development/makefile/target-build-go.mk
include $(PROJECT_ROOT)development/makefile/target-git.mk
include $(PROJECT_ROOT)development/makefile/terminal-check.mk
INFO := $(GREEN)
COMMENT := $(YELLOW)
# Output control and standard outputs
MARKER := $(BLUE)[+]$(RESET)
ERRORMARKER := $(RED)[-]$(RESET)
## Deactivate the quite mode by overwriting the value with space
ifndef DEBUG
QUIET = @
else
QUIET =
endif
ifndef DONTOPENBROWSER
OPENBROWSER = false
else
OPENBROWSER = true
endif
ECHO := @echo
ECHOMARKER := @echo "$(MARKER) $0"
ECHOERRORMARKER := @echo "$(ERRORMARKER) $0"
# Use bash instead of sh
## Sets the shell used
SHELL = bash
# path and binaries
AWK := awk
GO := go
CP := cp
CD := cd
KILL := /bin/kill
M4 := m4
MV := mv
RM := rm -f
MKDIR := mkdir -p
SED := sed
FIND := find
SORT := sort
TOUCH := touch
WGET := wget
CHMOD := chmod
RSYNC := rsync
DOCKER := docker
NPX := npx
AWS := aws
XARGS := xargs
GREP := grep
NPM := npm
make := make
GIT := git
NPX := npx
NODE := node
LN := ln -s
# Executable Programs the Installed be have to
EXECUTABLES = $(AWK) $(CP) $(KILL) $(M4) $(MV) rm mkdir $(SED) $(SORT) $(TOUCH) $(WGET) $(CHMOD) $(NPX) $(FIND) $(XARGS) $(GREP) $(NPM) $(GIT) $(NPX) $(NODE) $(GO) ln;
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "Missing $(exec) in PATH; please install")))
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)),$3)))
__check_defined = \
$(if $(value $1),, \
$(ECHOERRORMARKER) $(if $2, $2, $1))
#############################################################################################
#############################################################################################
##
## DEFAULT-TARGETS
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.DEFAULT_GOAL := help
.PHONY: print
print:
$(ECHO) "THIS_MAKEFILE: $(THIS_MAKEFILE)"
$(ECHO) "THIS_MAKEFILE_PATH: $(THIS_MAKEFILE_PATH)"
$(ECHO) "THIS_DIR: $(THIS_DIR)"
# Add a comment to the public targets so that it appears
# in this help Use two # characters for a help comment
.PHONY: help
help:
@printf "${COMMENT}Usage:${RESET}\n"
@printf " make [target] [arg=\"val\"...]\n\n"
@printf "${COMMENT}Available targets:${RESET}\n"
@awk '/^[a-zA-Z\-\_0-9\.@]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${INFO}%-22s${RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
@printf "\n${COMMENT}Available arguments:${RESET}\n\n"
@awk '/^(([a-zA-Z\-\_0-9\.@]+)\s=)/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${INFO}%-22s${RESET} %s (Default: %s)\n", $$1, helpMessage, $$3; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.PHONY: variables
## Print all Variables
variables:
@$(foreach v, $(.VARIABLES), $(if $(filter file,$(origin $(v))), $(info $(INFO)$(v)$(RESET)=$($(v))$(RESET))))
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
#############################################################################################
#############################################################################################
##
## DIRECTORIES
##
#############################################################################################
#############################################################################################
APPLICATION_PATH := $(THIS_DIR)application/
RESOURCE_PATH := $(THIS_DIR)application/resource/
SOURCE_PATH := $(THIS_DIR)application/source/
WEB_PATH := $(THIS_DIR)application/web/
DEPLOYMENT_PATH := $(THIS_DIR)deployment/
VENDOR_PATH := $(THIS_DIR)deployment/vendor/
DEVELOPMENT_PATH := $(THIS_DIR)development/
SCRIPTS_PATH := $(THIS_DIR)development/scripts/
DOCUMENTATION_PATH := $(THIS_DIR)documentation/
## Build path
BUILD_PATH = $(DEPLOYMENT_PATH)build/
#############################################################################################
#############################################################################################
##
## DEPENDENCIES (JEKYLL, MINERVA, ...)
##
#############################################################################################
#############################################################################################
#############################################################################################
......@@ -203,37 +48,5 @@ BUILD_PATH = $(DEPLOYMENT_PATH)build/
#############################################################################################
#############################################################################################
##
## PROJECT-TARGETS
##
#############################################################################################
#############################################################################################
#############################################################################################
#############################################################################################
##
## PROJECT-TARGETS
##
#############################################################################################
#############################################################################################
## Compiling for every OS and Platform
compile:
echo "Compiling for every OS and Platform"
cd $(SOURCE_PATH); GOOS=linux GOARCH=arm $(GO) build -o $(BUILD_PATH)reqman-linux-arm; cd -
cd $(SOURCE_PATH); GOOS=linux GOARCH=amd64 $(GO) build -o $(BUILD_PATH)reqman-linux-amd64; cd -
cd $(SOURCE_PATH); GOOS=linux GOARCH=arm64 $(GO) build -o $(BUILD_PATH)reqman-linux-arm64; cd -
cd $(SOURCE_PATH); GOOS=linux GOARCH=386 $(GO) build -o $(BUILD_PATH)reqman-linux-386; cd -
cd $(SOURCE_PATH); GOOS=windows GOARCH=amd64 $(GO) build -o $(BUILD_PATH)reqman-windows; cd -
## compile and deplay to aws
deploy: compile
find $(BUILD_PATH) -iname reqman-* -exec aws s3 cp {} s3://download.schukai.com/tools/reqman/ \;
## overview-to-aws
overview-to-aws:
aws s3 cp $(WEB_PATH)/index.html s3://download.schukai.com/tools/reqman/
......@@ -22,12 +22,25 @@ type commandLineOptions struct {
} `command:"add"`
Report struct {
GroupedBy string `long:"grouped-by" required:"false" description:"grouped by"`
Gitlab bool `long:"gitlab" description:"get data from gitlab"`
} `command:"report"`
} `command:"requirements"`
Tasks struct {
Print struct {
} `command:"print"`
Gitlab struct {
ProjectID string `long:"project-id" required:"false" description:"gitlab project id"`
Token string `long:"token" required:"false" description:"gitlab token"`
} `command:"gitlab"`
} `command:"tasks"`
Issues struct {
Print struct {
} `command:"print"`
Gitlab struct {
ProjectID string `long:"project-id" required:"false" description:"gitlab project id"`
Token string `long:"token" required:"false" description:"gitlab token"`
} `command:"gitlab"`
} `command:"issues"`
Items struct {
Print struct {
} `command:"print"`
......@@ -74,9 +87,10 @@ func executeCommand() {
activeCommand := p.Command.Active
version = "development"
build = "1.1.1"
//
if activeCommand == nil {
return
}
switch activeCommand.Name {
case "version":
......@@ -160,6 +174,18 @@ func executeCommand() {
}
}
case "issues":
subcommand := activeCommand.Active
switch subcommand.Name {
case "print":
err := printIssueTable(config)
if err != nil {
printErrorAndExit(2, err.Error())
}
case "gitlab":
syncTasksWithGitlab(config)
}
case "items":
subcommand := activeCommand.Active
switch subcommand.Name {
......
......@@ -29,6 +29,10 @@ type Configuration struct {
DateFormat string `yaml:"DateFormat"`
} `yaml:"Locale"`
GitLab struct {
Token string `yaml:"Token"`
} `yaml:"GitLab"`
Overview struct {
Template struct {
Markdown string `yaml:"Markdown"`
......
......@@ -103,6 +103,11 @@ Source: null
Created: %%CREATED%%
Last Update: null
# The issues that are associated with this requirement
Issues:
- Title: null
URL: null
# the individual items as a list
Items:
- ID: null
......@@ -110,7 +115,7 @@ Items:
# what is it, a image, font, legal information, access data, texts, decisions, etc.
Type: null
# does this belong to a group
Group: null
group: null
Description: null
Delivery until: null
# when was the project items delivered and by whom?
......
package main
import "errors"
var (
noGitRepositoryError = errors.New("no git repository found")
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment