Skip to content

Commit 09792c9

Browse files
authored
Dev/code reorg (#1)
* code reorg + initial beta release
1 parent 24ca948 commit 09792c9

File tree

339 files changed

+192681
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+192681
-129
lines changed

.circleci/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Golang CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-go/ for more details
4+
version: 2
5+
jobs:
6+
build:
7+
docker:
8+
- image: circleci/golang:1.11
9+
working_directory: /go/src/github.com/ppetko/gopxe
10+
steps:
11+
- checkout
12+
- run: go get -v -t -d ./...
13+
- run: go test -v ./...

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
## Code of Conduct
2+
3+
### Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
### Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
### Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
### Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
### Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
### Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
Please note we have a code of conduct, please follow it in all your interactions with the project.
7+
8+
## Pull Request Process
9+
10+
1. Fork the project
11+
2. Create a topic branch from master.
12+
3. Make some commits to improve the project.
13+
4. Push this branch to your GitHub project.
14+
5. Open a Pull Request on GitHub.
15+
6. Discuss, and optionally continue committing.
16+
7. The project owner merges or closes the Pull Request.

Dockerfile

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
FROM centos:7.3.1611
2-
3-
RUN yum install tftp tftp-server* xinetd* dhcp* -y && \
4-
yum clean all
5-
6-
RUN mkdir /var/lib/tftpboot/pxelinux.cfg
1+
FROM golang:latest as builder
2+
RUN mkdir -p /go/src/github.com/ppetko/gopxe
3+
ADD . /go/src/github.com/ppetko/gopxe
4+
WORKDIR /go/src/github.com/ppetko/gopxe
5+
RUN go test ./...
6+
RUN go build -o main .
77

8+
FROM centos:7.5.1804
9+
RUN yum install -y tftp tftp-server* xinetd* dhcp* epel-release syslinux && yum clean all
810
EXPOSE 67 67/udp 69/udp 9090 9090/udp
9-
10-
ADD ./conf/dhcpd_template /etc/dhcp/dhcpd.conf
11-
ADD ./conf/tftp /etc/xinetd.d/tftp
12-
ADD ./pxe_conf /var/lib/tftpboot
13-
ADD ./pxe/pxe_api /
14-
ADD ./run_pxe.sh /
15-
16-
HEALTHCHECK --interval=4m --timeout=3s CMD curl --fail http://localhost:9090/status || exit 1
17-
18-
CMD ["/run_pxe.sh"]
11+
RUN mkdir /var/lib/tftpboot/pxelinux.cfg /opt/localrepo
12+
RUN cp -r /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
13+
ADD ./pxebootImages /var/lib/tftpboot
14+
RUN mkdir -p /gopxe/public ; mkdir /gopxe/ksTempl
15+
WORKDIR /gopxe
16+
COPY --from=builder /go/src/github.com/ppetko/gopxe/main /gopxe/
17+
ADD ./public /gopxe/public
18+
ADD ./ksTempl /gopxe/ksTempl
19+
ADD ./start-gopxe.sh /gopxe/
20+
HEALTHCHECK --interval=4m --timeout=60s CMD curl --fail http://localhost:9090/health || exit 1
21+
ENTRYPOINT ["/gopxe/start-gopxe.sh"]

Gopkg.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Gopkg.toml example
2+
#
3+
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4+
# for detailed Gopkg.toml documentation.
5+
#
6+
# required = ["github.com/user/thing/cmd/thing"]
7+
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8+
#
9+
# [[constraint]]
10+
# name = "github.com/user/project"
11+
# version = "1.0.0"
12+
#
13+
# [[constraint]]
14+
# name = "github.com/user/project2"
15+
# branch = "dev"
16+
# source = "github.com/myfork/project2"
17+
#
18+
# [[override]]
19+
# name = "github.com/x/y"
20+
# version = "2.4.0"
21+
#
22+
# [prune]
23+
# non-go = false
24+
# go-tests = true
25+
# unused-packages = true
26+
27+
28+
[[constraint]]
29+
name = "github.com/coreos/bbolt"
30+
version = "1.3.0"
31+
32+
[[constraint]]
33+
name = "github.com/gorilla/mux"
34+
version = "1.6.2"
35+
36+
[prune]
37+
go-tests = true
38+
unused-packages = true

ISSUE_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Expected Behavior
2+
3+
Please describe the behavior you are expecting
4+
5+
# Current Behavior
6+
7+
What is the current behavior?
8+
9+
# Failure Information (for bugs)
10+
11+
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
12+
13+
## Steps to Reproduce
14+
15+
Please provide detailed steps for reproducing the issue.
16+
17+
1. step 1
18+
2. step 2
19+
3. ...
20+
21+
## Context
22+
23+
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
24+
25+
* Operating System:
26+
* Go version:
27+
28+
## Failure Logs
29+
30+
Please include any relevant log snippets or files here.

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
PROJECT_NAME := "gopxe"
2+
PKG := "github.com/ppetko/$(PROJECT_NAME)"
3+
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
4+
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
5+
6+
.PHONY: all dep build docker-build clean test coverage lint
7+
8+
all: build
9+
10+
lint: ## Lint the files
11+
@golint -set_exit_status ${PKG_LIST}
12+
13+
test: ## Run unittests
14+
@go test -v ./...
15+
16+
race: dep ## Run data race detector
17+
@go test -race -short ${PKG_LIST}
18+
19+
cover: ## Generate global code coverage report in HTML
20+
./tools/coverage.sh html;
21+
22+
dep: ## Get the dependencies
23+
@go get -v -d ./...
24+
25+
build: dep ## Build the binary file
26+
@go build -v
27+
28+
docker-build: ## Build docker container from Dockerfile
29+
@docker build -t $(PROJECT_NAME) -f Dockerfile .
30+
31+
docker-test: ## Run all go tests in Docker
32+
@docker run --rm -ti $(PROJECT_NAME) go tests -v ./...
33+
34+
clean: ## Remove previous build
35+
@rm -f $(PROJECT_NAME)
36+
@rm -f coverage.html
37+
38+
help: ## Display this help screen
39+
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
40+

PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Description - What does this PR do?
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
## Types of changes
6+
7+
What types of changes does your code introduce to Appium?
8+
_Put an `x` in the boxes that apply_
9+
10+
- [ ] Bugfix (non-breaking change which fixes an issue)
11+
- [ ] New feature (non-breaking change which adds functionality)
12+
13+
Before submitting your PR, please review the following checklist:
14+
15+
- [ ] I have signed the [**GoPXE CLA**](http://add-this-later).
16+
- [ ] I have read the [**CONTRIBUTING guide**](github.com/ppetko/gopxe/CONTRIBUTING.md).
17+
- [ ] **CONSIDER** adding a unit test if your PR resolves an issue.
18+
- [ ] **DO** keep pull requests small so they can be easily reviewed.
19+
- [ ] **DO** make sure unit tests pass.
20+
- [ ] **DO** make sure its documented.
21+
- [ ] **AVOID** breaking the continuous integration build.

0 commit comments

Comments
 (0)