forked from SigNoz/signoz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/signoz/signoz into main
- Loading branch information
Showing
5 changed files
with
253 additions
and
4 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,25 @@ | ||
To run GitHub workflow, a few environment variables needs to add in GitHub secrets | ||
|
||
#### Environment Variables | ||
|
||
<table> | ||
<tr> | ||
<th> Variables </th> | ||
<th> Description </th> | ||
<th> Example </th> | ||
</tr> | ||
<tr> | ||
<td> REPONAME </td> | ||
<td> Provide the DockerHub user/organisation name of the image. </td> | ||
<td> signoz</td> | ||
</tr> | ||
<tr> | ||
<td> DOCKERHUB_USERNAME </td> | ||
<td> Docker hub username </td> | ||
<td> signoz</td> | ||
</tr> | ||
<tr> | ||
<td> DOCKERHUB_TOKEN </td> | ||
<td> Docker hub password/token with push permission </td> | ||
<td> **** </td> | ||
</tr> |
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,70 @@ | ||
name: build-pipeline | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- v* | ||
paths: | ||
- 'pkg/**' | ||
- 'frontend/**' | ||
|
||
jobs: | ||
get_filters: | ||
runs-on: ubuntu-latest | ||
# Set job outputs to values from filter step | ||
outputs: | ||
frontend: ${{ steps.filter.outputs.frontend }} | ||
query-service: ${{ steps.filter.outputs.query-service }} | ||
flattener: ${{ steps.filter.outputs.flattener }} | ||
steps: | ||
# For pull requests it's not necessary to checkout the code | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
frontend: | ||
- 'frontend/**' | ||
query-service: | ||
- 'pkg/query-service/**' | ||
flattener: | ||
- 'pkg/processors/flattener/**' | ||
build-frontend: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get_filters | ||
if: ${{ needs.get_filters.outputs.frontend == 'true' }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build frontend docker image | ||
shell: bash | ||
run: | | ||
cd frontend | ||
docker build . -f Dockerfile | ||
build-query-service: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get_filters | ||
if: ${{ needs.get_filters.outputs.query-service == 'true' }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build query-service image | ||
shell: bash | ||
run: | | ||
cd pkg/query-service | ||
docker build . -f Dockerfile | ||
build-flattener: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get_filters | ||
if: ${{ needs.get_filters.outputs.flattener == 'true' }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build flattener docker image | ||
shell: bash | ||
run: | | ||
cd pkg/processors/flattener | ||
docker build . -f Dockerfile |
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,151 @@ | ||
name: push-pipeline | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- ^v[0-9]*.[0-9]*.x$ | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
get-envs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- shell: bash | ||
run: | | ||
img_tag="" | ||
array=(`echo ${GITHUB_REF} | sed 's/\//\n/g'`) | ||
if [ ${array[1]} == "tags" ] | ||
then | ||
echo "tag build" | ||
img_tag=${GITHUB_REF#refs/*/} | ||
else | ||
echo "non tag build" | ||
img_tag="latest" | ||
fi | ||
# This is a condition where image tag looks like "pull/<pullrequest-name>" during pull request build | ||
NEW_IMG_TAG=`echo $img_tag | sed "s/\//-/g"` | ||
echo $NEW_IMG_TAG | ||
echo export IMG_TAG=$NEW_IMG_TAG >> env-vars | ||
echo export FRONTEND_IMAGE="frontend" >> env-vars | ||
echo export QUERY_SERVICE="query-service" >> env-vars | ||
echo export FLATTENER_PROCESSOR="flattener-processor" >> env-vars | ||
- name: Uploading envs | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: env_artifact | ||
path: env-vars | ||
|
||
build-and-push-frontend: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get-envs | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Downloading image artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: env_artifact | ||
|
||
- name: Build frontend docker image | ||
shell: bash | ||
run: | | ||
source env-vars | ||
cd frontend | ||
docker build . -f Dockerfile -t ${{ secrets.REPONAME }}/${FRONTEND_IMAGE}:${IMG_TAG} | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Push frontend docker image | ||
shell: bash | ||
run: | | ||
branch=${GITHUB_REF#refs/*/} | ||
array=(`echo ${GITHUB_REF} | sed 's/\//\n/g'`) | ||
if [ $branch == "main" ] || [ ${array[1]} == "tags" ] || [[ $branch =~ ^v[0-9]*.[0-9]*.x$ ]] | ||
then | ||
source env-vars | ||
docker push ${{ secrets.REPONAME }}/${FRONTEND_IMAGE}:${IMG_TAG} | ||
fi | ||
build-and-push-query-service: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get-envs | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Downloading image artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: env_artifact | ||
|
||
- name: Build query-service image | ||
shell: bash | ||
run: | | ||
source env-vars | ||
cd pkg/query-service | ||
docker build . -f Dockerfile -t ${{ secrets.REPONAME }}/${QUERY_SERVICE}:${IMG_TAG} | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Push query service docker image | ||
shell: bash | ||
run: | | ||
branch=${GITHUB_REF#refs/*/} | ||
array=(`echo ${GITHUB_REF} | sed 's/\//\n/g'`) | ||
if [ $branch == "main" ] || [ ${array[1]} == "tags" ] || [[ $branch =~ ^v[0-9]*.[0-9]*.x$ ]] | ||
then | ||
source env-vars | ||
docker push ${{ secrets.REPONAME }}/${QUERY_SERVICE}:${IMG_TAG} | ||
fi | ||
build-and-push-flattener: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- get-envs | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Downloading image artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: env_artifact | ||
|
||
- name: Build flattener docker image | ||
shell: bash | ||
run: | | ||
source env-vars | ||
cd pkg/processors/flattener | ||
docker build . -f Dockerfile -t ${{ secrets.REPONAME }}/${FLATTENER_PROCESSOR}:${IMG_TAG} | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Push flattener processor docker image | ||
shell: bash | ||
run: | | ||
branch=${GITHUB_REF#refs/*/} | ||
array=(`echo ${GITHUB_REF} | sed 's/\//\n/g'`) | ||
if [ $branch == "main" ] || [ ${array[1]} == "tags" ] || [[ $branch =~ ^v[0-9]*.[0-9]*.x$ ]] | ||
then | ||
source env-vars | ||
docker push ${{ secrets.REPONAME }}/${FLATTENER_PROCESSOR}:${IMG_TAG} | ||
fi |
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