Skip to content

Commit

Permalink
Merge pull request #14 from josegonzalez/master
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
josegonzalez authored Mar 11, 2019
2 parents 0d1e982 + e871c3b commit 093f9fd
Show file tree
Hide file tree
Showing 33 changed files with 39 additions and 1,902 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
command: |
make build-in-docker
[[ -d build ]] && sudo chown -R circleci:circleci build
[[ -d vendor ]] && sudo chown -R circleci:circleci vendor
- run:
command: |
ls -lah
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.10.3-stretch
FROM golang:1.12.0-stretch

RUN apt-get update \
&& apt install apt-transport-https build-essential curl gnupg2 lintian rpm rsync rubygems-integration ruby-dev ruby -qy \
Expand All @@ -7,4 +7,4 @@ RUN apt-get update \

RUN gem install --no-ri --no-rdoc --quiet rake fpm package_cloud

RUN curl -s https://raw.githubusercontent.com/golang/dep/master/install.sh | INSTALL_DIRECTORY=/usr/local/bin sh
WORKDIR /src
27 changes: 0 additions & 27 deletions Gopkg.lock

This file was deleted.

42 changes: 0 additions & 42 deletions Gopkg.toml

This file was deleted.

26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ MAINTAINER = josegonzalez
MAINTAINER_NAME = Jose Diaz-Gonzalez
REPOSITORY = go-procfile-util
HARDWARE = $(shell uname -m)
BASE_VERSION ?= 0.4.0
SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]')
BASE_VERSION ?= 0.5.0
IMAGE_NAME ?= $(MAINTAINER)/$(REPOSITORY)
PACKAGECLOUD_REPOSITORY ?= dokku/dokku-betafish

Expand Down Expand Up @@ -42,7 +43,6 @@ targets = $(addsuffix -in-docker, $(LIST))
@echo "VERSION=$(VERSION)" >> .env.docker

build:
@$(MAKE) deps
@$(MAKE) build/darwin/$(NAME)
@$(MAKE) build/linux/$(NAME)
@$(MAKE) build/deb/$(NAME)_$(VERSION)_amd64.deb
Expand All @@ -57,19 +57,19 @@ $(targets): %-in-docker: .env.docker
--rm \
--volume /var/lib/docker:/var/lib/docker \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
--volume ${PWD}:/go/src/github.com/$(MAINTAINER)/$(REPOSITORY) \
--workdir /go/src/github.com/$(MAINTAINER)/$(REPOSITORY) \
--volume ${PWD}:/src/github.com/$(MAINTAINER)/$(REPOSITORY) \
--workdir /src/github.com/$(MAINTAINER)/$(REPOSITORY) \
$(IMAGE_NAME):build make -e $(@:-in-docker=)

build/darwin/$(NAME):
mkdir -p build/darwin
CGO_ENABLED=0 GOOS=darwin go build -a -asmflags=-trimpath=/go/src -gcflags=-trimpath=/go/src \
CGO_ENABLED=0 GOOS=darwin go build -a -asmflags=-trimpath=/src -gcflags=-trimpath=/src \
-ldflags "-s -w -X main.Version=$(VERSION)" \
-o build/darwin/$(NAME)

build/linux/$(NAME):
mkdir -p build/linux
CGO_ENABLED=0 GOOS=linux go build -a -asmflags=-trimpath=/go/src -gcflags=-trimpath=/go/src \
CGO_ENABLED=0 GOOS=linux go build -a -asmflags=-trimpath=/src -gcflags=-trimpath=/src \
-ldflags "-s -w -X main.Version=$(VERSION)" \
-o build/linux/$(NAME)

Expand Down Expand Up @@ -121,20 +121,22 @@ circleci:
docker version
rm -f ~/.gitconfig

deps:
dep ensure -vendor-only

docker-image:
docker build --rm -q -f Dockerfile.hub -t $(IMAGE_NAME):$(DOCKER_VERSION) .

release: build
go get -u github.com/progrium/gh-release/...
gh-release:
mkdir -p build
curl -o build/gh-release.tgz -sL https://github.com/progrium/gh-release/releases/download/v2.2.1/gh-release_2.2.1_$(SYSTEM_NAME)_$(HARDWARE).tgz
tar xf build/gh-release.tgz -C build
chmod +x build/gh-release

release: build gh-release
rm -rf release && mkdir release
tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME)
tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME)
cp build/deb/$(NAME)_$(VERSION)_amd64.deb release/$(NAME)_$(VERSION)_amd64.deb
cp build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm release/$(NAME)-$(VERSION)-1.x86_64.rpm
gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD)
build/gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD)

release-packagecloud:
@$(MAKE) release-packagecloud-deb
Expand Down
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module procfile-util

go 1.12

require (
github.com/akamensky/argparse v0.0.0-20180405044306-95911c018170
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2
github.com/joho/godotenv v1.2.0
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/akamensky/argparse v0.0.0-20180405044306-95911c018170 h1:JuYOgmyY+ckpAAfYbiToLlgcjidpLKgjVbu+7J09FI4=
github.com/akamensky/argparse v0.0.0-20180405044306-95911c018170/go.mod h1:pdh+2piXurh466J9tqIqq39/9GO2Y8nZt6Cxzu18T9A=
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 h1:axBiC50cNZOs7ygH5BgQp4N+aYrZ2DNpWZ1KG3VOSOM=
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2/go.mod h1:jnzFpU88PccN/tPPhCpnNU8mZphvKxYM9lLNkd8e+os=
github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc=
github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
10 changes: 8 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func getProcfile(path string) (string, error) {

func parseProcfile(path string, delimiter string) ([]procfileEntry, error) {
var entries []procfileEntry
re, _ := regexp.Compile(`^([A-Za-z0-9_]+)` + delimiter + `\s*(.+)$`)
reCmd, _ := regexp.Compile(`^([A-Za-z0-9_]+)` + delimiter + `\s*(.+)$`)
reComment, _ := regexp.Compile(`^(.*)\s#.+$`)

text, err := getProcfile(path)
if err != nil {
Expand All @@ -87,7 +88,7 @@ func parseProcfile(path string, delimiter string) ([]procfileEntry, error) {
continue
}

params := re.FindStringSubmatch(line)
params := reCmd.FindStringSubmatch(line)
if len(params) != 3 {
debugMessage(fmt.Sprintf("No matching params in line: %v", line))
continue
Expand All @@ -100,6 +101,11 @@ func parseProcfile(path string, delimiter string) ([]procfileEntry, error) {
}
names[name] = true

commentParams := reComment.FindStringSubmatch(cmd)
if len(commentParams) == 2 {
cmd = commentParams[1]
}

entries = append(entries, procfileEntry{name, cmd})
}

Expand Down
16 changes: 0 additions & 16 deletions vendor/github.com/akamensky/argparse/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/akamensky/argparse/.travis.yml

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/akamensky/argparse/LICENSE

This file was deleted.

129 changes: 0 additions & 129 deletions vendor/github.com/akamensky/argparse/README.md

This file was deleted.

Loading

0 comments on commit 093f9fd

Please sign in to comment.