-
Notifications
You must be signed in to change notification settings - Fork 290
90 lines (79 loc) · 3.03 KB
/
lib-injection.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "Lib Injection Test"
on:
push:
branches:
- master
- 'release/*'
tags:
- '*'
pull_request:
branches:
- master
jobs:
build-and-publish-init-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # 2.3.4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # 2.0.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # 2.0.0
with:
version: v0.9.1 # https://github.com/docker/buildx/issues/1533
- name: Set up Docker platforms
id: buildx-platforms
run: |
BUILDX_PLATFORMS=`docker buildx imagetools inspect --raw alpine:3.18.3 | jq -r 'reduce (.manifests[] | [ .platform.os, .platform.architecture, .platform.variant ] | join("/") | sub("\\/$"; "")) as $item (""; . + "," + $item)' | sed 's/,//'`
echo "$BUILDX_PLATFORMS"
echo "platforms=$BUILDX_PLATFORMS" >> $GITHUB_OUTPUT
- name: lib-injection-tags
id: lib-injection-tags
uses: DataDog/system-tests/lib-injection/docker-tags@89d754340046eafcc72dc5c5fd6ea651ca7b920e # main
with:
init-image-name: 'dd-lib-java-init'
main-branch-name: 'master'
- name: Build dd-java-agent.jar
run: ./lib-injection/build_java_agent.sh
- name: Login to Docker
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Docker Build
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # 3.2.0
with:
push: true
tags: ${{ steps.lib-injection-tags.outputs.tag-names }}
platforms: ${{ steps.buildx-platforms.outputs.platforms }}
context: ./lib-injection
injection-tests:
needs:
- build-and-publish-init-image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
lib-injection-connection: [ 'network','uds']
lib-injection-use-admission-controller: ['', 'use-admission-controller']
weblog-variant: [ 'dd-lib-java-init-test-app']
fail-fast: false
env:
TEST_LIBRARY: java
WEBLOG_VARIANT: ${{ matrix.weblog-variant }}
LIBRARY_INJECTION_CONNECTION: ${{ matrix.lib-injection-connection }}
LIBRARY_INJECTION_ADMISSION_CONTROLLER: ${{ matrix.lib-injection-use-admission-controller }}
DOCKER_REGISTRY_IMAGES_PATH: ghcr.io/datadog
DOCKER_IMAGE_TAG: ${{ github.sha }}
MODE: manual
steps:
- name: lib-injection test runner
id: lib-injection-test-runner
uses: DataDog/system-tests/lib-injection/runner@89d754340046eafcc72dc5c5fd6ea651ca7b920e # main
with:
docker-registry: ghcr.io
docker-registry-username: ${{ github.repository_owner }}
docker-registry-password: ${{ secrets.GITHUB_TOKEN }}
test-script: ./lib-injection/run-manual-lib-injection.sh