diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 03e1bba..2b4407d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to almigthy-core +# Contributing to fabric8-wit You are welcome to contribute to this project. Here are few suggestions to help you to contribute. You can contribute to this diff --git a/.gitignore b/.gitignore index 36e393d..4ea3874 100644 --- a/.gitignore +++ b/.gitignore @@ -60,11 +60,11 @@ _testmain.go *.test *.prof -# ALMighty specific artifacts +# Fabric8-wit specific artifacts /debug **/debug.test -# ALMighty binaries +# Fabric8-wit binaries bin/ # Glide package manager diff --git a/.make/Makefile.lnx b/.make/Makefile.lnx index dd958db..fd83a58 100644 --- a/.make/Makefile.lnx +++ b/.make/Makefile.lnx @@ -1,5 +1,5 @@ -BINARY_SERVER_BIN=$(INSTALL_PREFIX)/alm -BINARY_CLIENT_BIN=$(INSTALL_PREFIX)/alm-cli +BINARY_SERVER_BIN=$(INSTALL_PREFIX)/wit +BINARY_CLIENT_BIN=$(INSTALL_PREFIX)/wit-cli GLIDE_BIN=glide GOAGEN_BIN=$(VENDOR_DIR)/github.com/goadesign/goa/goagen/goagen GO_BINDATA_BIN=$(VENDOR_DIR)/github.com/jteeuwen/go-bindata/go-bindata/go-bindata diff --git a/.make/Makefile.win b/.make/Makefile.win index ed05503..15a689e 100644 --- a/.make/Makefile.win +++ b/.make/Makefile.win @@ -1,5 +1,5 @@ -BINARY_SERVER_BIN=$(INSTALL_PREFIX)/alm.exe -BINARY_CLIENT_BIN=$(INSTALL_PREFIX)/alm-cli.exe +BINARY_SERVER_BIN=$(INSTALL_PREFIX)/wit.exe +BINARY_CLIENT_BIN=$(INSTALL_PREFIX)/wit-cli.exe GLIDE_BIN=glide.exe GOAGEN_BIN=$(VENDOR_DIR)/github.com/goadesign/goa/goagen/goagen.exe GO_BINDATA_BIN=$(VENDOR_DIR)/github.com/jteeuwen/go-bindata/go-bindata/go-bindata.exe diff --git a/.make/docker.mk b/.make/docker.mk index f7c17a3..754b10f 100644 --- a/.make/docker.mk +++ b/.make/docker.mk @@ -107,8 +107,8 @@ endif ifeq ($(strip $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' make_postgres_integration_test_1 2>/dev/null)),) $(error Failed to find PostgreSQL container. Try running "make integration-test-env-prepare") endif - $(eval ALMIGHTY_POSTGRES_HOST := $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' make_postgres_integration_test_1 2>/dev/null)) - docker exec -t $(DOCKER_RUN_INTERACTIVE_SWITCH) "$(DOCKER_CONTAINER_NAME)" bash -ec 'export ALMIGHTY_POSTGRES_HOST=$(ALMIGHTY_POSTGRES_HOST); make $(makecommand)' + $(eval F8_POSTGRES_HOST := $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' make_postgres_integration_test_1 2>/dev/null)) + docker exec -t $(DOCKER_RUN_INTERACTIVE_SWITCH) "$(DOCKER_CONTAINER_NAME)" bash -ec 'export F8_POSTGRES_HOST=$(F8_POSTGRES_HOST); make $(makecommand)' # This is a wildcard target to let you call any make target from the normal makefile # but it will run inside the docker container. This target will only get executed if diff --git a/.make/test.mk b/.make/test.mk index f3843c3..99eaf24 100644 --- a/.make/test.mk +++ b/.make/test.mk @@ -94,9 +94,9 @@ GO_TEST_VERBOSITY_FLAG ?= -v # By default use the "localhost" or specify manually during make invocation: # -# ALMIGHTY_POSTGRES_HOST=somehost make test-integration +# F8_POSTGRES_HOST=somehost make test-integration # -ALMIGHTY_POSTGRES_HOST ?= localhost +F8_POSTGRES_HOST ?= localhost # Output directory for coverage information COV_DIR = $(TMP_PATH)/coverage @@ -144,7 +144,7 @@ test-unit: prebuild-check clean-coverage-unit $(COV_PATH_UNIT) test-unit-no-coverage: prebuild-check $(SOURCES) $(call log-info,"Running test: $@") $(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN))) - ALMIGHTY_DEVELOPER_MODE_ENABLED=1 ALMIGHTY_RESOURCE_UNIT_TEST=1 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) + F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_UNIT_TEST=1 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) .PHONY: test-integration ## Runs the integration tests and produces coverage files for each package. @@ -157,7 +157,7 @@ test-integration: prebuild-check clean-coverage-integration migrate-database $(C test-integration-no-coverage: prebuild-check migrate-database $(SOURCES) $(call log-info,"Running test: $@") $(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN))) - ALMIGHTY_DEVELOPER_MODE_ENABLED=1 ALMIGHTY_RESOURCE_DATABASE=1 ALMIGHTY_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) + F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) .PHONY: test-remote ## Runs the remote tests and produces coverage files for each package. @@ -168,13 +168,13 @@ test-remote: prebuild-check clean-coverage-remote $(COV_PATH_REMOTE) test-remote-no-coverage: prebuild-check $(SOURCES) $(call log-info,"Running test: $@") $(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN))) - ALMIGHTY_DEVELOPER_MODE_ENABLED=1 ALMIGHTY_RESOURCE_REMOTE=1 ALMIGHTY_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) + F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_REMOTE=1 F8_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) .PHONY: test-migration ## Runs the migration tests and should be executed before running the integration tests ## in order to have a clean database test-migration: prebuild-check - ALMIGHTY_RESOURCE_DATABASE=1 go test $(GO_TEST_VERBOSITY_FLAG) github.com/fabric8-services/fabric8-wit/migration + F8_RESOURCE_DATABASE=1 go test $(GO_TEST_VERBOSITY_FLAG) github.com/fabric8-services/fabric8-wit/migration # Downloads docker-compose to tmp/docker-compose if it does not already exist. define download-docker-compose @@ -411,7 +411,7 @@ $(eval ENV_VAR := $(5)) $(eval ALL_PKGS_COMMA_SEPARATED := $(6)) @mkdir -p $(COV_DIR)/$(PACKAGE_NAME); $(eval COV_OUT_FILE := $(COV_DIR)/$(PACKAGE_NAME)/coverage.$(TEST_NAME).mode-$(COVERAGE_MODE)) -@$(ENV_VAR) ALMIGHTY_DEVELOPER_MODE_ENABLED=1 ALMIGHTY_POSTGRES_HOST=$(ALMIGHTY_POSTGRES_HOST) \ +@$(ENV_VAR) F8_DEVELOPER_MODE_ENABLED=1 F8_POSTGRES_HOST=$(F8_POSTGRES_HOST) \ go test $(PACKAGE_NAME) \ $(GO_TEST_VERBOSITY_FLAG) \ -coverprofile $(COV_OUT_FILE) \ @@ -471,7 +471,7 @@ $(COV_PATH_INTEGRATION): $(SOURCES) $(GOCOVMERGE_BIN) @-rm -f $(ERRORS_FILE) $(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN))) $(eval ALL_PKGS_COMMA_SEPARATED:=$(shell echo $(TEST_PACKAGES) | tr ' ' ,)) - $(foreach package, $(TEST_PACKAGES), $(call test-package,$(TEST_NAME),$(package),$(COV_PATH_INTEGRATION),$(ERRORS_FILE),ALMIGHTY_RESOURCE_DATABASE=1 ALMIGHTY_RESOURCE_UNIT_TEST=0,$(ALL_PKGS_COMMA_SEPARATED))) + $(foreach package, $(TEST_PACKAGES), $(call test-package,$(TEST_NAME),$(package),$(COV_PATH_INTEGRATION),$(ERRORS_FILE),F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0,$(ALL_PKGS_COMMA_SEPARATED))) $(call check-test-results,$(ERRORS_FILE)) # NOTE: We don't have prebuild-check as a dependency here because it would cause diff --git a/Dockerfile.deploy b/Dockerfile.deploy index 02fffc2..2a0af16 100644 --- a/Dockerfile.deploy +++ b/Dockerfile.deploy @@ -2,30 +2,30 @@ FROM centos:7 LABEL maintainer "Devtools " LABEL author "Konrad Kleine " ENV LANG=en_US.utf8 -ENV ALMIGHTY_INSTALL_PREFIX=/usr/local/alm +ENV F8_INSTALL_PREFIX=/usr/local/wit -# Create a non-root user and a group with the same name: "almighty" -ENV ALMIGHTY_USER_NAME=almighty -RUN useradd --no-create-home -s /bin/bash ${ALMIGHTY_USER_NAME} +# Create a non-root user and a group with the same name: "wit" +ENV F8_USER_NAME=wit +RUN useradd --no-create-home -s /bin/bash ${F8_USER_NAME} -COPY bin/alm ${ALMIGHTY_INSTALL_PREFIX}/bin/alm -COPY config.yaml ${ALMIGHTY_INSTALL_PREFIX}/etc/config.yaml +COPY bin/wit ${F8_INSTALL_PREFIX}/bin/wit +COPY config.yaml ${F8_INSTALL_PREFIX}/etc/config.yaml # Install little pcp pmcd server for metrics collection # would prefer only pmcd, and not the /bin/pm*tools etc. COPY pcp.repo /etc/yum.repos.d/pcp.repo RUN yum install -y pcp && yum clean all && \ mkdir -p /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \ - chown -R ${ALMIGHTY_USER_NAME} /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \ + chown -R ${F8_USER_NAME} /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \ chmod -R ug+rw /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp -COPY ./alm+pmcd.sh /alm+pmcd.sh +COPY ./wit+pmcd.sh /wit+pmcd.sh EXPOSE 44321 # From here onwards, any RUN, CMD, or ENTRYPOINT will be run under the following user -USER ${ALMIGHTY_USER_NAME} +USER ${F8_USER_NAME} -WORKDIR ${ALMIGHTY_INSTALL_PREFIX} -ENTRYPOINT [ "/alm+pmcd.sh" ] +WORKDIR ${F8_INSTALL_PREFIX} +ENTRYPOINT [ "/wit+pmcd.sh" ] EXPOSE 8080 diff --git a/Makefile b/Makefile index 493648c..6739d9c 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ export GIT_COMMITTER_NAME export GIT_COMMITTER_EMAIL # Used as target and binary output names... defined in includes -CLIENT_DIR=tool/alm-cli +CLIENT_DIR=tool/wit-cli COMMIT=$(shell git rev-parse HEAD) GITUNTRACKEDCHANGES := $(shell git status --porcelain --untracked-files=no) @@ -242,12 +242,12 @@ generate: app/controllers.go assets/js/client.js bindata_assetfs.go migration/sq .PHONY: regenerate ## Runs the "clean-generated" and the "generate" target -regenerate: clean-generated generate +regenerate: clean-generated generate .PHONY: dev dev: prebuild-check deps generate $(FRESH_BIN) docker-compose up -d db - ALMIGHTY_DEVELOPER_MODE_ENABLED=true $(FRESH_BIN) + F8_DEVELOPER_MODE_ENABLED=true $(FRESH_BIN) include ./.make/test.mk diff --git a/README.adoc b/README.adoc index 99b35f7..ca8ff9f 100644 --- a/README.adoc +++ b/README.adoc @@ -324,15 +324,15 @@ github.secret : 2fe6736e90a9283036a37059d75ac0c82f4f5288 Although this is a YAML file, we highly suggest to stick to this rather lenghty notation instead of nesting structs. To override configuration values using environment variables, use the prefix -`ALMIGHTY_` and replace the dots in the variables names with underscores. +`F8_` and replace the dots in the variables names with underscores. -For example to override `postgres.password`, set the environment variable `ALMIGHTY_POSTGRES_PASSWORD` to the value of you liking. +For example to override `postgres.password`, set the environment variable `F8_POSTGRES_PASSWORD` to the value of you liking. NOTE: Environment variables override the default values and the ones you've set in your config file. ==== Development -Only files `+./*.go+`, `+./design/*.go+`, `+./models/*.go+` and `+./tool/alm-cli/main.go+` should be edited. +Only files `+./*.go+`, `+./design/*.go+`, `+./models/*.go+` and `+./tool/wit-cli/main.go+` should be edited. These files and directory are generated: @@ -360,26 +360,26 @@ NOTE: The CLI needs the API Server which was started on executing `make dev` to Generate a token for future use. ---- -./bin/alm-cli generate login -H localhost:8080 --pp +./bin/wit-cli generate login -H localhost:8080 --pp ---- You should get Token in response, save this token in your favourite editor as you need to use this token for POST API calls Create a work item type (using above token). ---- -./bin/alm-cli create workitemtype --key "" --payload '{"fields":{"system.owner":{"Type":{"Kind":"user"},"Required":true},"system.state":{"Type":{"Kind":"string"},"Required":false}},"name":"Epic"}' -H localhost:8080 --pp +./bin/wit-cli create workitemtype --key "" --payload '{"fields":{"system.owner":{"Type":{"Kind":"user"},"Required":true},"system.state":{"Type":{"Kind":"string"},"Required":false}},"name":"Epic"}' -H localhost:8080 --pp ---- Note: Work Item Type `Name` is unique. If one tries to create another work item type with same name, error will be trown. Retrieve the work item type. ---- -$ ./bin/alm-cli show workitemtype --name "Epic" -H localhost:8080 +$ ./bin/wit-cli show workitemtype --name "Epic" -H localhost:8080 ---- List all available work item types. ---- -$ ./bin/alm-cli list workitemtype -H localhost:8080 --pp +$ ./bin/wit-cli list workitemtype -H localhost:8080 --pp ---- Create a work item. @@ -388,13 +388,13 @@ Based on WorkItemType created above, we can create WorkItem. We need to use name of work item type in the `type` field below. ---- -$ ./bin/alm-cli create workitem --key "" --payload '{"type": "Epic", "fields": { "system.owner": "tmaeder", "system.state": "open" }}' -H localhost:8080 +$ ./bin/wit-cli create workitem --key "" --payload '{"type": "Epic", "fields": { "system.owner": "tmaeder", "system.state": "open" }}' -H localhost:8080 ---- Retrieve the work item. ---- -$ ./bin/alm-cli show workitem --id 1 -H localhost:8080 --pp +$ ./bin/wit-cli show workitem --id 1 -H localhost:8080 --pp ---- @@ -410,11 +410,11 @@ System defined Work Item Types are Use any one of above to create Work Item based on that type. Following example creates a Work Item of type `userstory` ---- -$ ./bin/alm-cli create workitem --key "" --payload '{ "data": { "attributes": { "system.owner": "tmaeder", "system.state": "open", "system.title": "Example of an Epic", "version": "1" }, "relationships": { "baseType": { "data": { "id": "Epic", "type": "workitemtypes" } } }, "type": "workitems" } }' -H localhost:8080 +$ ./bin/wit-cli create workitem --key "" --payload '{ "data": { "attributes": { "system.owner": "tmaeder", "system.state": "open", "system.title": "Example of an Epic", "version": "1" }, "relationships": { "baseType": { "data": { "id": "Epic", "type": "workitemtypes" } } }, "type": "workitems" } }' -H localhost:8080 ---- In response you should get ID of created item, using that you can retrieve the work item. ---- -$ ./bin/alm-cli show workitem --id -H localhost:8080 --pp +$ ./bin/wit-cli show workitem --id -H localhost:8080 --pp ---- diff --git a/assets/index.html b/assets/index.html index 906e0c8..c1389bf 100644 --- a/assets/index.html +++ b/assets/index.html @@ -7,7 +7,7 @@
-

almighty tokens Loading..

+

Fabric8-wit tokens Loading..