Skip to content

Commit 509c92f

Browse files
author
Peter Kelly
committed
Change layout for project to be more idiomatic
https://github.com/golang-standards/project-layout
1 parent 1149860 commit 509c92f

33 files changed

+22
-21
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
/build
1+
/build_output
22
.DS_Store
3-

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GO_DOCKER_RUN = docker run --rm -v $(shell pwd):/go/src/github.com/nginxinc/nginx-asg-sync -w /go/src/github.com/nginxinc/nginx-asg-sync/cmd/sync
1+
GO_DOCKER_RUN = docker run --rm -v $(shell pwd):/go/src/github.com/nginxinc/nginx-asg-sync -v $(shell pwd)/build_output:/build_output -w /go/src/github.com/nginxinc/nginx-asg-sync/cmd/sync
22
GOLANG_CONTAINER = golang:1.10
33

44
all: amazon centos7 ubuntu-trusty ubuntu-xenial
@@ -7,25 +7,25 @@ test:
77
$(GO_DOCKER_RUN) $(GOLANG_CONTAINER) go test
88

99
compile: test
10-
$(GO_DOCKER_RUN) $(GOLANG_CONTAINER) go build -o /build/nginx-asg-sync
10+
$(GO_DOCKER_RUN) $(GOLANG_CONTAINER) go build -o /build_output/nginx-asg-sync
1111

1212
amazon: compile
13-
make -C os-packages/builders/amazon/
14-
docker run --rm -v $(shell pwd)/os-packages/rpm:/rpm -v $(shell pwd)/build:/build amazon-builder
13+
make -C build/package/builders/amazon/
14+
docker run --rm -v $(shell pwd)/build/package/rpm:/rpm -v $(shell pwd)/build_output:/build_output amazon-builder
1515

1616
centos7: compile
17-
make -C os-packages/builders/centos7/
18-
docker run --rm -v $(shell pwd)/os-packages/rpm:/rpm -v $(shell pwd)/build:/build centos7-builder
17+
make -C build/package/builders/centos7/
18+
docker run --rm -v $(shell pwd)/build/package/rpm:/rpm -v $(shell pwd)/build_output:/build_output centos7-builder
1919

2020
ubuntu-xenial: compile
21-
make -C os-packages/builders/ubuntu-xenial/
22-
docker run --rm -v $(shell pwd)/os-packages/debian:/debian -v $(shell pwd)/build:/build ubuntu-xenial-builder
21+
make -C build/package/builders/ubuntu-xenial/
22+
docker run --rm -v $(shell pwd)/build/package/debian:/debian -v $(shell pwd)/build_output:/build_output ubuntu-xenial-builder
2323

2424
ubuntu-trusty: compile
25-
make -C os-packages/builders/ubuntu-trusty/
26-
docker run --rm -v $(shell pwd)/os-packages/debian:/debian -v $(shell pwd)/build:/build ubuntu-trusty-builder
25+
make -C build/package/builders/ubuntu-trusty/
26+
docker run --rm -v $(shell pwd)/build/package/debian:/debian -v $(shell pwd)/build_output:/build_output ubuntu-trusty-builder
2727

2828
clean:
29-
-rm -r build
29+
-rm -r build_output
3030

3131
.PHONY: test

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
[![Go Report Card](https://goreportcard.com/badge/github.com/nginxinc/nginx-asg-sync)](https://goreportcard.com/report/github.com/nginxinc/nginx-asg-sync)
2+
13
# NGINX Plus Integration with AWS Auto Scaling groups -- nginx-asg-sync
24

35
**nginx-asg-sync** allows [NGINX Plus](https://www.nginx.com/products/) to discover instances of [AWS Auto Scaling groups](http://docs.aws.amazon.com/autoscaling/latest/userguide/WhatIsAutoScaling.html). When the number of instances in an Auto Scaling group changes, nginx-asg-sync adds the new instances to the NGINX Plus configuration and removes the terminated ones.
46

57
## How It Works
6-
nginx-asg-sync must be installed on the same EC2 instance with NGINX Plus. nginx-asg-sync constantly monitors backend Auto Scaling groups via the AWS Auto Scaling API.
8+
nginx-asg-sync is an agent process that runs on the same EC2 instance as NGINX Plus. It polls for changes to the backend Auto Scaling groups via the AWS Auto Scaling API.
79
When it sees that a scaling event has happened, it adds or removes the corresponding backend instances from the NGINX Plus configuration via the NGINX Plus API.
810

911
**Note:** nginx-asg-sync does not scale Auto Scaling groups, it only gets the IP addresses of the instances of Auto Scaling groups.
@@ -114,7 +116,7 @@ server {
114116

115117
### nginx-asg-sync Configuration
116118

117-
nginx-asg-sync is configured in the file **aws.yaml** in the **/etc/nginx** folder. For our example, we define the following configuration:
119+
nginx-asg-sync is configured in **/etc/nginx/aws.yaml**. For our example, we define the following configuration:
118120

119121
```yaml
120122
region: us-west-2

os-packages/builders/amazon/build.sh renamed to build/package/builders/amazon/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
mkdir -p ~/rpmbuild
44
cp -r rpm/* ~/rpmbuild/
55
rpmbuild -bb ~/rpmbuild/SPECS/nginx-asg-sync.spec
6-
cp ~/rpmbuild/RPMS/x86_64/*.rpm /build
6+
cp ~/rpmbuild/RPMS/x86_64/*.rpm /build_output

os-packages/builders/centos7/build.sh renamed to build/package/builders/centos7/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
mkdir -p ~/rpmbuild
44
cp -r rpm/* ~/rpmbuild/
55
rpmbuild -bb ~/rpmbuild/SPECS/nginx-asg-sync.spec
6-
cp ~/rpmbuild/RPMS/x86_64/*.rpm /build
6+
cp ~/rpmbuild/RPMS/x86_64/*.rpm /build_output

0 commit comments

Comments
 (0)