-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from odpf/setup-actions
build: setup pipeline
- Loading branch information
Showing
10 changed files
with
156 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Test & Build | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: '1.14' | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Project | ||
run: make install-protoc; make setup | ||
- name: Invoking go test | ||
run: make test | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: '1.14' | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: make all |
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,23 @@ | ||
name: Integration Test | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Docker | ||
uses: docker-practice/actions-setup-docker@master | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Copy integration config | ||
run: cp application.yml.integration-test application.yml | ||
- name: Run Raccoon | ||
run: make docker-run | ||
- run: make install-protoc && make generate-proto | ||
- name: Invoking go test | ||
run: INTEGTEST_BOOTSTRAP_SERVER=localhost:9094 INTEGTEST_HOST=ws://localhost:8080 INTEGTEST_TOPIC_FORMAT="clickstream-%s-log" go test ./integration -v |
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,37 @@ | ||
name: Package | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- "v*.*.*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Get release tag | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
- name: Login to GitHub Packages Docker Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.pkg.github.com | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and Push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
docker.pkg.github.com/${{ github.repository }}/raccoon:latest | ||
docker.pkg.github.com/${{ github.repository }}/raccoon:${{ steps.get_version.outputs.version-without-v }} | ||
odpf/raccoon:latest | ||
odpf/raccoon:${{ steps.get_version.outputs.version-without-v }} |
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,10 +1,18 @@ | ||
FROM golang:1.14 | ||
|
||
WORKDIR /app | ||
RUN apt-get update && apt-get install unzip --no-install-recommends --assume-yes | ||
RUN PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip && \ | ||
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/$PROTOC_ZIP && \ | ||
unzip -o $PROTOC_ZIP -d /usr/local bin/protoc && \ | ||
unzip -o $PROTOC_ZIP -d /usr/local 'include/*' && \ | ||
rm -f $PROTOC_ZIP | ||
COPY . . | ||
RUN make compile | ||
RUN make install-protoc && make generate-proto && make update-deps && make compile | ||
|
||
FROM debian:buster-slim | ||
WORKDIR /app | ||
COPY --from=0 /app/out/raccoon ./raccoon | ||
COPY ./application.yml . | ||
EXPOSE 8080 | ||
|
||
# Command to run the executable | ||
CMD ["./out/raccoon"] | ||
CMD ["./raccoon"] |
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,31 @@ | ||
SERVER_WEBSOCKET_PORT: "8080" | ||
SERVER_WEBSOCKET_CHECK_ORIGIN: "true" | ||
SERVER_WEBSOCKET_MAX_CONN: "30000" | ||
SERVER_WEBSOCKET_READ_BUFFER_SIZE: "10240" | ||
SERVER_WEBSOCKET_WRITE_BUFFER_SIZE: "10240" | ||
SERVER_WEBSOCKET_CONN_UNIQ_ID_HEADER: "x-user-id" | ||
SERVER_WEBSOCKET_PING_INTERVAL_MS: 30000 | ||
SERVER_WEBSOCKET_PONG_WAIT_INTERVAL_MS: 60000 | ||
SERVER_WEBSOCKET_WRITE_WAIT_INTERVAL_MS: 5000 | ||
SERVER_WEBSOCKET_SERVER_SHUTDOWN_GRACE_PERIOD_MS: 3000 | ||
SERVER_WEBSOCKET_PINGER_SIZE: 1 | ||
|
||
WORKER_BUFFER_CHANNEL_SIZE: 5 | ||
WORKER_BUFFER_FLUSH_TIMEOUT_MS: 5000 | ||
WORKER_POOL_SIZE: 5 | ||
WORKER_KAFKA_DELIVERY_CHANNEL_SIZE: 100 | ||
|
||
EVENT_DISTRIBUTION_PUBLISHER_PATTERN: "clickstream-%s-log" | ||
|
||
PUBLISHER_KAFKA_CLIENT_BOOTSTRAP_SERVERS: "kafka:9092" | ||
PUBLISHER_KAFKA_CLIENT_ACKS: "1" | ||
PUBLISHER_KAFKA_CLIENT_RETRIES: "2" | ||
PUBLISHER_KAFKA_CLIENT_RETRY_BACKOFF_MS: "100" | ||
PUBLISHER_KAFKA_CLIENT_STATISTICS_INTERVAL_MS: 5000 | ||
PUBLISHER_KAFKA_CLIENT_QUEUE_BUFFERING_MAX_MESSAGES: 100000 | ||
PUBLISHER_KAFKA_FLUSH_INTERVAL_MS: 1000 | ||
|
||
METRIC_STATSD_ADDRESS: ":8125" | ||
METRIC_STATSD_FLUSH_PERIOD_MS: 100 | ||
|
||
LOG_LEVEL: "info" |
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
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