Skip to content

Commit 9af1066

Browse files
author
Peter Kelly
authored
Merge pull request #9 from nginxinc/update-package-layout
Update package layout
2 parents b750af3 + 63a77a0 commit 9af1066

File tree

210 files changed

+40463
-15253
lines changed

Some content is hidden

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

210 files changed

+40463
-15253
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-

Gopkg.lock

Lines changed: 65 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://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
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/aws/aws-sdk-go"
30+
version = "1.14.29"
31+
32+
[[constraint]]
33+
name = "gopkg.in/yaml.v2"
34+
version = "2.2.1"
35+
36+
[prune]
37+
go-tests = true
38+
unused-packages = true

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)/cmd/sync:/go/src/github.com/nginxinc/nginx-asg-sync/cmd/sync -v $(shell pwd)/build:/build -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/Dockerfile renamed to build/package/builders/amazon/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazonlinux:latest
1+
FROM amazonlinux:2018.03.0.20180424
22

33
RUN yum install -y rpmdevtools
44
ADD build.sh /

os-packages/builders/centos7/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

0 commit comments

Comments
 (0)