Skip to content

Commit ba09d9c

Browse files
committed
Initial commit.
0 parents  commit ba09d9c

24 files changed

+531
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bin/
2+
docker-hub/
3+
vendor/

.gometalinter.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"Aggregate": true,
3+
"Concurrency": 4,
4+
"CycloOver": 10,
5+
"Deadline": "2m",
6+
"Debug": false,
7+
"DisableAll": true,
8+
"DuplThreshold": 50,
9+
"Enable": [
10+
"deadcode",
11+
"dupl",
12+
"errcheck",
13+
"gas",
14+
"goconst",
15+
"gocyclo",
16+
"gofmt",
17+
"goimports",
18+
"golint",
19+
"gotype",
20+
"gotypex",
21+
"ineffassign",
22+
"interfacer",
23+
"lll",
24+
"maligned",
25+
"megacheck",
26+
"misspell",
27+
"nakedret",
28+
"structcheck",
29+
"test",
30+
"testify",
31+
"unconvert",
32+
"unparam",
33+
"varcheck",
34+
"vet",
35+
"vetshadow"
36+
],
37+
"EnableGC": true,
38+
"Exclude": ["^/.*", "vendor/.*", ".*_test.go$"],
39+
"LineLength": 120,
40+
"MinConfidence": 80,
41+
"MinConstLength": 3,
42+
"MinOccurrences": 3,
43+
"MisspellLocale": "US",
44+
"Skip": ["vendor"],
45+
"Sort": ["linter", "severity", "path", "line"],
46+
"Test": true,
47+
"Vendor": true,
48+
"VendoredLinters": true
49+
}
11 KB
Loading

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2018 Ryan Parman
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
all:
2+
@cat Makefile | grep : | grep -v PHONY | grep -v @ | sed 's/:/ /' | awk '{print $$1}' | sort
3+
4+
#-------------------------------------------------------------------------------
5+
6+
.PHONY: install-deps
7+
install-deps:
8+
glide install && gometalinter.v2 --install
9+
10+
.PHONY: build
11+
build:
12+
go build -ldflags="-s -w" -o bin/dockerhub main.go
13+
14+
.PHONY: lint
15+
lint:
16+
gometalinter.v2 ./main.go
17+
18+
.PHONY: package
19+
package: build
20+
upx --brute bin/dockerhub
21+
mkdir -p docker-hub
22+
rm -Rf docker-hub
23+
mkdir -p docker-hub
24+
cp -rv bin docker-hub/
25+
cp -v *.png docker-hub/
26+
cp -v *.plist docker-hub/
27+
cd docker-hub/ && \
28+
zip -r docker-hub.zip * && \
29+
mv -v docker-hub.zip ../docker-hub.alfredworkflow
30+
31+
#-------------------------------------------------------------------------------
32+
33+
.PHONY: tag
34+
tag:
35+
@ if [ $$(git status -s -uall | wc -l) != 0 ]; then echo 'ERROR: Git workspace must be clean.'; exit 1; fi;
36+
37+
@echo "This release will be tagged as: $$(cat ./VERSION)"
38+
@echo "This version should match your release. If it doesn't, re-run 'make version'."
39+
@echo "---------------------------------------------------------------------"
40+
@read -p "Press any key to continue, or press Control+C to cancel. " x;
41+
42+
@echo " "
43+
@chag update $$(cat ./VERSION)
44+
@echo " "
45+
46+
@echo "These are the contents of the CHANGELOG for this release. Are these correct?"
47+
@echo "---------------------------------------------------------------------"
48+
@chag contents
49+
@echo "---------------------------------------------------------------------"
50+
@echo "Are these release notes correct? If not, cancel and update CHANGELOG.md."
51+
@read -p "Press any key to continue, or press Control+C to cancel. " x;
52+
53+
@echo " "
54+
55+
git add .
56+
git commit -a -m "Preparing the $$(cat ./VERSION) release."
57+
chag tag --sign
58+
59+
#-------------------------------------------------------------------------------
60+
61+
.PHONY: version
62+
version:
63+
@echo "Current version: $$(cat ./VERSION)"
64+
@read -p "Enter new version number: " nv; \
65+
printf "$$nv" > ./VERSION

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# docker-hub.alfredworkflow
2+
3+
An Alfred PowerPack Workflow for searching Docker Hub for public Docker images.
4+
5+
## Usage
6+
7+
`dockerhub {query}` — Search for an image.
8+
9+
### Actions
10+
11+
`` — Open the module in the Docker Hub UI.
12+
`⇧/⌘Y` — Quicklook details
13+
14+
### Screenshots
15+
16+
![](README.png)
17+
![](README2.png)
18+
![](README3.png)
19+
![](README4.png)
20+
21+
**[Download!](docker-hub.alfredworkflow?raw=true)** Requires [Alfred 3 and the PowerPack](https://www.alfredapp.com/powerpack/).
22+
23+
## Developing/Deploying
24+
25+
### Golang
26+
27+
Go (when spoken) or [Golang] (when written) is a strongly-typed language from Google that "blends the simplicity of Python with the performance of C". Static binaries can be compiled for all major platforms, and many minor ones.
28+
29+
It is recommended that you install Golang using your system's package manager. If you don't have one (or if the version is too old), you can [install Golang from its website](https://golang.org/doc/install). Reading the [Getting Started](https://golang.org/doc/) documentation is a valuable exercise.
30+
31+
```bash
32+
brew update && brew install golang
33+
```
34+
35+
### Glide
36+
37+
Golang dependencies are managed with [Glide]. You should install them before compiling this project.
38+
39+
```bash
40+
curl https://glide.sh/get | sh
41+
glide install
42+
```
43+
44+
### GoMetaLinter
45+
46+
[GoMetaLinter] pulls together many popular linting tools, and can run them on a project.
47+
48+
```bash
49+
gometalinter.v2 --install
50+
```
51+
52+
### Developing
53+
54+
```bash
55+
make build
56+
bin/dockerhub "golang"
57+
```
58+
59+
Make sure that you run the linter to catch any issues.
60+
61+
```bash
62+
make lint
63+
```
64+
65+
[Glide]: https://glide.sh
66+
[Golang]: https://golang.org
67+
[GoMetaLinter]: https://github.com/alecthomas/gometalinter

README.png

27.2 KB
Loading

README2.png

160 KB
Loading

README3.png

24.5 KB
Loading

README4.png

137 KB
Loading

0 commit comments

Comments
 (0)