Skip to content

Commit 4490805

Browse files
committed
pass secret to config
1 parent 7664bf8 commit 4490805

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.github/actions/start-promtail/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ runs:
2020
-e GITHUB_HEAD_REF=${{ github.head_ref }} \
2121
-e GITHUB_SHA=${{ github.sha }} \
2222
-e GITHUB_ACTOR=${{ github.actor }} \
23+
-e LOKI_DASHBOARD_URL=${{ secrets.LOKI_DASHBOARD_URL }} \
2324
grafana/promtail:3.4.4 \
2425
-config.file=/etc/promtail/config.yaml \
2526
-config.expand-env=true

.github/workflows/ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ jobs:
165165
run: echo "START_TIME=$(date +"%Y-%m-%dT%H:%M:%S.%NZ")" >> ${GITHUB_ENV}
166166
- name: Create Directory
167167
run: mkdir -p ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/
168+
- name: Start Promtail
169+
uses: ./.github/actions/start-promtail
168170
- name: Run Integration Tests
169171
run: |
170172
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
@@ -173,8 +175,6 @@ jobs:
173175
- name: Generate Test Results
174176
if: always()
175177
run: bash ./scripts/workflow/generate_results.sh ${{job.status}} ${{env.START_TIME}} ${{github.job}}/${{matrix.container.image}}${{matrix.container.version}} ${{github.workspace}}
176-
- name: Start Promtail
177-
uses: ./.github/actions/start-promtail
178178
- name: Container Output Logs
179179
if: failure()
180180
run: |
@@ -299,12 +299,21 @@ jobs:
299299
registry: ${{ secrets.REGISTRY_URL }}
300300
username: ${{ secrets.REGISTRY_USERNAME }}
301301
password: ${{ secrets.REGISTRY_PASSWORD }}
302+
- name: Set Start Time
303+
run: echo "START_TIME=$(date +"%Y-%m-%dT%H:%M:%S.%NZ")" >> ${GITHUB_ENV}
304+
- name: Create Directory
305+
run: mkdir -p ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/
306+
- name: Start Promtail
307+
uses: ./.github/actions/start-promtail
302308
- name: Run Integration Tests
303309
run: |
304310
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
305311
CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \
306312
OS_RELEASE="${{ matrix.container.release }}" IMAGE_PATH="${{ matrix.container.path }}" \
307-
make official-image-integration-test
313+
make official-image-integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/raw_logs.log && exit "${PIPESTATUS[0]}"
314+
- name: Generate Test Results
315+
if: always()
316+
run: bash ./scripts/workflow/generate_results.sh ${{job.status}} ${{env.START_TIME}} ${{github.job}}/${{matrix.container.image}}${{matrix.container.version}} ${{github.workspace}}
308317
- name: Container Output Logs
309318
if: failure()
310319
run: |

test/dashboard/prep/promtail.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ positions:
88
sync_period: "10s"
99

1010
clients:
11-
- url: ${{ secrets.LOKI_DASHBOARD_URL }}
11+
- url: "${LOKI_DASHBOARD_URL}"
1212
external_labels:
1313
systest_project: agent_v2
14-
systest_type: ${GITHUB_JOB}
14+
systest_type: "${GITHUB_JOB}"
1515
timeout: 30s
1616
backoff_config:
1717
min_period: 500ms

0 commit comments

Comments
 (0)