Skip to content

Commit 9b1dbdd

Browse files
committed
Fix merge
2 parents bb48019 + e05e2b7 commit 9b1dbdd

File tree

5 files changed

+72
-108
lines changed

5 files changed

+72
-108
lines changed

.github/workflows/build.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
push:
7+
branches: [ build ]
8+
9+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10+
jobs:
11+
# This workflow contains a single job called "build"
12+
build:
13+
strategy:
14+
matrix:
15+
docker: ['scratch','ubi']
16+
# The type of runner that the job will run on
17+
runs-on: ubuntu-latest
18+
name: ${{ matrix.docker }}
19+
steps:
20+
- name: build
21+
uses: sysdiglabs/[email protected]
22+
with:
23+
exporter: elasticsearch-exporter
24+
artifactory_token: ${{ secrets.ARTI_TOKEN }}
25+
artifactory_username: [email protected]
26+
sysdig_secure_token: ${{ secrets.SYSDIG_SECURE_TOKEN }}
27+
tag_name: dev
28+
target: ${{ matrix.docker }}
29+
repository: artifactory.internal.sysdig.com

.github/workflows/image-builder-workflow.yaml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.github/workflows/push.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Push
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
workflow_run:
7+
workflows: [Release]
8+
types: [completed]
9+
10+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
11+
jobs:
12+
# This workflow contains a single job called "build"
13+
on-success:
14+
# The type of runner that the job will run on
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Upload master to Quay.io
18+
uses: fjogeleit/http-request-action@master
19+
with:
20+
url: 'https://sysdig-jenkins.internal.sysdig.com/view/Integrations/job/integrations-elasticsearch-exporter/buildWithParameters?token=${{ secrets.JENKINS_PROMCAT_LAUNCH_TOKEN }}&EXPORTER=elasticsearch-exporter&DRY_RUN=false'
21+
method: 'POST'
22+
23+
password: ${{ secrets.JENKINS_PROMCAT_API_TOKEN }}

.github/workflows/release.yaml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1+
name: Release
12
on:
23
release:
34
types: [released]
4-
name: Build, test and publish
55
jobs:
66
buildDockerImage:
7-
env:
8-
EXPORTER_NAME: elasticsearch-exporter
9-
name: Build docker image
7+
strategy:
8+
matrix:
9+
docker: ['scratch','ubi']
10+
name: Build docker image ${{ matrix.docker }}
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: actions/checkout@master
13-
- name: Login to Artifactory
14-
uses: docker/login-action@v1
15-
with:
16-
registry: artifactory.internal.sysdig.com
17-
18-
password: ${{ secrets.ARTI_TOKEN }}
1913
- name: Release if tagged
2014
if: "!startswith(github.ref, 'refs/tags/v')"
2115
run: exit 78
22-
- name: Build image
23-
run: |
24-
docker build --label release=${{ github.event.release.tag_name }} -f Dockerfile --target scratch -t artifactory.internal.sysdig.com/$EXPORTER_NAME:latest .
25-
docker build --label release=${{ github.event.release.tag_name }} -f Dockerfile --target ubi -t artifactory.internal.sysdig.com/$EXPORTER_NAME:${{ github.event.release.tag_name }}-ubi .
26-
- name: Publish docker image
27-
run: |
28-
docker tag artifactory.internal.sysdig.com/$EXPORTER_NAME:latest artifactory.internal.sysdig.com/$EXPORTER_NAME:${{ github.event.release.tag_name }}
29-
docker push artifactory.internal.sysdig.com/$EXPORTER_NAME:${{ github.event.release.tag_name }}
30-
docker push artifactory.internal.sysdig.com/$EXPORTER_NAME:${{ github.event.release.tag_name }}-ubi
31-
docker push artifactory.internal.sysdig.com/$EXPORTER_NAME:latest
32-
- name: Upload master to Quay.io
33-
uses: fjogeleit/http-request-action@master
16+
- name: build
17+
uses: sysdiglabs/[email protected]
3418
with:
35-
url: 'https://sysdig-jenkins.internal.sysdig.com/view/Integrations/job/integrations-elasticsearch-exporter/buildWithParameters?token=${{ secrets.JENKINS_PROMCAT_LAUNCH_TOKEN }}&EXPORTER=elasticsearch-exporter&DRY_RUN=false'
36-
method: 'POST'
37-
38-
password: ${{ secrets.JENKINS_PROMCAT_API_TOKEN }}
19+
exporter: elasticsearch-exporter
20+
artifactory_token: ${{ secrets.ARTI_TOKEN }}
21+
artifactory_username: [email protected]
22+
tag_name: ${{ github.event.release.tag_name }}
23+
target: ${{ matrix.docker }}
24+
repository: artifactory.internal.sysdig.com

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
FROM quay.io/prometheus/golang-builder as builder
22

3+
ARG PROMU_VERSION=0.13.0
4+
ADD https://github.com/prometheus/promu/releases/download/v${PROMU_VERSION}/promu-${PROMU_VERSION}.linux-amd64.tar.gz ./
5+
RUN tar -xvzf promu-${PROMU_VERSION}.linux-amd64.tar.gz && mv promu-${PROMU_VERSION}.linux-amd64/promu /go/bin
6+
37
ADD . /go/src/github.com/prometheus-community/elasticsearch_exporter
48
WORKDIR /go/src/github.com/prometheus-community/elasticsearch_exporter
59

10+
RUN go mod download
611
RUN make
712

813
FROM scratch as scratch
@@ -12,9 +17,9 @@ COPY --from=builder /go/src/github.com/prometheus-community/elasticsearch_export
1217
EXPOSE 9114
1318
ENTRYPOINT [ "/bin/elasticsearch_exporter" ]
1419

15-
FROM quay.io/sysdig/sysdig-mini-ubi:1.1.14 as ubi
20+
FROM quay.io/sysdig/sysdig-mini-ubi:1.2.12 as ubi
1621

1722
COPY --from=builder /go/src/github.com/prometheus-community/elasticsearch_exporter/elasticsearch_exporter /bin/elasticsearch_exporter
1823

1924
EXPOSE 9114
20-
ENTRYPOINT [ "/bin/elasticsearch_exporter" ]
25+
ENTRYPOINT [ "/bin/elasticsearch_exporter" ]

0 commit comments

Comments
 (0)