This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added LICENSE, Dockerfile, CI files and docs draft
- Loading branch information
1 parent
07b546d
commit 4efd42e
Showing
11 changed files
with
599 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
vendor | ||
ggr-ui | ||
|
||
.idea | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
sudo: required | ||
language: go | ||
|
||
go: | ||
- 1.10.x | ||
|
||
services: | ||
- docker | ||
|
||
script: | ||
- go test -v -race -coverprofile=coverage.txt -covermode=atomic | ||
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.gitRevision=`git describe --tags || git rev-parse HEAD` -s -w" | ||
- gox -os "linux darwin windows" -arch "amd64" -osarch="windows/386" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.gitRevision=`git describe --tags || git rev-parse HEAD` -s -w" | ||
|
||
before_install: | ||
- go get -u github.com/golang/dep/cmd/dep | ||
|
||
install: | ||
- go get -u github.com/mitchellh/gox # cross compile | ||
- dep ensure | ||
|
||
deploy: | ||
- provider: releases | ||
api-key: $GITHUB_TOKEN | ||
file_glob: true | ||
file: dist/* | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
- provider: script | ||
script: travis/docker-push.sh latest | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
- provider: script | ||
script: travis/docker-push.sh $TRAVIS_TAG | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
- provider: script | ||
script: travis/docker-push.sh latest-release | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
- provider: script | ||
script: travis/docs.sh latest | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
- provider: script | ||
script: travis/docs.sh $TRAVIS_TAG | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) -F unittests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM alpine:3.7 | ||
|
||
RUN apk add -U tzdata && rm -Rf /var/cache/apk/* | ||
COPY ggr-ui /usr/bin | ||
|
||
EXPOSE 4444 | ||
ENTRYPOINT ["/usr/bin/ggr-ui", "-quota-dir", "/etc/grid-router/quota"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
# ggr-ui | ||
# Ggr UI | ||
|
||
Ggr UI is a standalone daemon that automatically collects `/status` information from multiple [Selenoid](https://github.com/aerokube/selenoid) and returns it as a single `/status` API. When this daemon is running you can use [Selenoid UI](https://github.com/aerokube/selenoid-ui) to see the state of the entire cluster. | ||
|
||
## Complete Guide & Build Instructions | ||
|
||
Complete reference guide (including building instructions) can be found at: http://aerokube.com/ggr-ui/latest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
== Contributing & Development | ||
|
||
To build Ggr UI: | ||
|
||
. Install https://golang.org/doc/install[Golang] | ||
|
||
. Setup `$GOPATH` https://github.com/golang/go/wiki/GOPATH[properly] | ||
|
||
. Get Ggr UI source: | ||
|
||
$ go get -d github.com/aerokube/ggr-ui | ||
|
||
. Go to project directory: | ||
|
||
$ cd $GOPATH/src/github.com/aerokube/ggr-ui | ||
|
||
. Checkout dependencies | ||
|
||
$ go get -u github.com/golang/dep/cmd/dep && dep ensure | ||
|
||
. Build source: | ||
|
||
$ go build | ||
|
||
. Run Ggr UI: | ||
|
||
$ ./ggr-ui --help | ||
|
||
[TIP] | ||
==== | ||
To build Docker container type: | ||
[source,bash] | ||
---- | ||
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build | ||
$ docker build -t ggr-ui:latest . | ||
---- | ||
==== | ||
|
||
=== Documentation | ||
|
||
Locally can be generated with: | ||
|
||
[source,bash] | ||
---- | ||
$ docker run --rm -v `pwd`/docs/:/documents/ \ | ||
asciidoctor/docker-asciidoctor \ | ||
asciidoctor -D /documents/output/ index.adoc | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
= Ggr UI | ||
:revdate: {docdate} | ||
:toc: left | ||
:toclevels: 3 | ||
:sectnums: | ||
:sectanchors: | ||
:Author: Alexander Andryashin and the Aerokube community | ||
:revnumber: latest | ||
:icons: font | ||
:source-highlighter: coderay | ||
:docinfo: shared | ||
|
||
This reference covers version: _{revnumber}_ | ||
|
||
Ggr UI is a standalone daemon that automatically collects `/status` information from multiple https://github.com/aerokube/selenoid[Selenoid] instances and returns it as a single `/status` API. When this daemon is running you can use https://github.com/aerokube/selenoid-ui[Selenoid UI] to see the state of the entire cluster. | ||
|
||
== Getting Started | ||
include::quick-start-guide.adoc[leveloffset=+1] | ||
|
||
include::contributing.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
== Quick Start Guide | ||
|
||
. Prerequisites: | ||
* One or more https://github.com/aerokube/selenoid[Selenoid] hosts | ||
* A directory with http://aerokube.com/ggr/latest/#_creating_quota_files[XML quota files] for Ggr | ||
. Start Ggr UI binary or container: | ||
+ | ||
``` | ||
$ ./ggr-ui -quota-dir /path/to/quota/dir # As a binary | ||
|
||
$ docker run -d --name ggr-ui -p 8888:8888 -v /path/to/quota/dir:/etc/grid-router/quota:ro aerokube/ggr-ui:latest-release | ||
``` | ||
+ | ||
Binaries as usually can be downloaded from https://github.com/aerokube/ggr-ui/releases[releases page]. | ||
. Now start https://github.com/aerokube/selenoid-ui[Selenoid UI] and point it to `http://localhost:8888`. It should start showing sessions running anywhere in Selenium cluster behind Ggr. | ||
. You can also use `/status` API similarly to Selenoid http://aerokube.com/selenoid/latest/#_usage_statistics[/status] API: | ||
+ | ||
``` | ||
$ curl -s http://localhost:8888/status | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
docker build -t $TRAVIS_REPO_SLUG . | ||
docker tag $TRAVIS_REPO_SLUG $TRAVIS_REPO_SLUG:$1 | ||
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
docker push $TRAVIS_REPO_SLUG | ||
docker push $TRAVIS_REPO_SLUG:$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
TAGNAME=$1 | ||
GH_REF=github.com/aerokube/selenoid.git | ||
git config user.name "${TRAVIS_REPO_SLUG}" | ||
git config user.email "[email protected]" | ||
git remote add upstream "https://${GITHUB_TOKEN}@${GH_REF}" | ||
git fetch upstream | ||
|
||
git branch -r | ||
|
||
echo "Deleting old output" | ||
rm -rf ${TRAVIS_BUILD_DIR}/docs/output | ||
mkdir ${TRAVIS_BUILD_DIR}/docs/output | ||
git worktree prune | ||
rm -rf ${TRAVIS_BUILD_DIR}/.git/worktrees/docs/output/ | ||
|
||
echo "Checking out gh-pages branch into docs/output" | ||
git worktree add -B gh-pages ${TRAVIS_BUILD_DIR}/docs/output upstream/gh-pages | ||
|
||
echo "Removing existing files" | ||
mkdir -p ${TRAVIS_BUILD_DIR}/docs/output/${TAGNAME} | ||
rm -rf ${TRAVIS_BUILD_DIR}/docs/output/${TAGNAME}/* | ||
|
||
#echo "Copying images" | ||
#cp -R ${TRAVIS_BUILD_DIR}/docs/img ${TRAVIS_BUILD_DIR}/docs/output/${TAGNAME}/img | ||
echo "Generating docs" | ||
docker run -v ${TRAVIS_BUILD_DIR}/docs/:/documents/ --name asciidoc-to-html asciidoctor/docker-asciidoctor asciidoctor -a revnumber=${TAGNAME} -D /documents/output/${TAGNAME} index.adoc | ||
|
||
|
||
echo "Updating gh-pages branch" | ||
cd ${TRAVIS_BUILD_DIR}/docs/output && git add --all && git commit -m "Publishing to gh-pages" | ||
|
||
|
||
git push upstream HEAD:gh-pages |