Skip to content

Commit c5d50db

Browse files
committed
Add new actions
1 parent 9846628 commit c5d50db

File tree

4 files changed

+64
-106
lines changed

4 files changed

+64
-106
lines changed

.github/workflows/build.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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/exporter-builder@v0.4
22+
with:
23+
exporter: postgresql-exporter
24+
artifactory_token: ${{ secrets.ARTI_TOKEN }}
25+
artifactory_username: david.lorite@sysdig.com
26+
tag_name: dev
27+
target: ${{ matrix.docker }}
28+
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-postgresql-exporter/buildWithParameters?token=${{ secrets.JENKINS_PROMCAT_LAUNCH_TOKEN }}&EXPORTER=postgresql-exporter&DRY_RUN=false'
21+
method: 'POST'
22+
username: david.lorite@sysdig.com
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: postgresql-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/#-action@v1
15-
with:
16-
registry: artifactory.internal.sysdig.com
17-
username: david.lorite@sysdig.com
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/exporter-builder@v0.4
3418
with:
35-
url: 'https://sysdig-jenkins.internal.sysdig.com/view/Integrations/job/integrations-postgresql-exporter/buildWithParameters?token=${{ secrets.JENKINS_PROMCAT_LAUNCH_TOKEN }}&EXPORTER=postgresql-exporter&DRY_RUN=fasle'
36-
method: 'POST'
37-
username: david.lorite@sysdig.com
38-
password: ${{ secrets.JENKINS_PROMCAT_API_TOKEN }}
19+
exporter: postgresql-exporter
20+
artifactory_token: ${{ secrets.ARTI_TOKEN }}
21+
artifactory_username: david.lorite@sysdig.com
22+
tag_name: ${{ github.event.release.tag_name }}
23+
target: ${{ matrix.docker }}
24+
repository: artifactory.internal.sysdig.com

0 commit comments

Comments
 (0)