File tree Expand file tree Collapse file tree 4 files changed +79
-18
lines changed
actions/build-and-publish-docker Expand file tree Collapse file tree 4 files changed +79
-18
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Build and publish docker images'
2
+ description : ' Builds and publishes the docker images for a given version using the agent artifact from maven central'
3
+ inputs :
4
+ release_version :
5
+ description : ' The version to release. If this is the currently latest version based on the git tags, it will also be published as latest'
6
+ required : true
7
+ ref :
8
+ description : ' Branch or tag ref to run the action, defines the version of the scripts in the ./scripts folder to run'
9
+ required : true
10
+ dry_run :
11
+ description : If set, generate the docker image but don't publish it
12
+ required : true
13
+ type : boolean
14
+ runs :
15
+ using : " composite"
16
+ env :
17
+ SONATYPE_FALLBACK : 1
18
+ steps :
19
+ - name : Log in to the Elastic Container registry
20
+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
21
+ with :
22
+ registry : ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
23
+ username : ${{ secrets.ELASTIC_DOCKER_USERNAME }}
24
+ password : ${{ secrets.ELASTIC_DOCKER_PASSWORD }}
25
+
26
+ - name : " Build docker image"
27
+ shell : bash
28
+ run : ./scripts/docker-release/build_docker.sh "${{ inputs.release_version }}"
29
+ - name : " Push docker image"
30
+ if : ${{ ! inputs.dry_run }}
31
+ shell : bash
32
+ run : ./scripts/docker-release/push_docker.sh "${{ inputs.release_version }}"
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Regenerate the docker images based on what is released at maven central if something went wrong during the standard release process
3
+ name : ' regenerate-docker-images'
4
+
5
+ on :
6
+ workflow_dispatch :
7
+ inputs :
8
+ ref :
9
+ description : ' Branch or tag ref to run the workflow on'
10
+ required : true
11
+ default : " main"
12
+ version :
13
+ description : |
14
+ The version of the agent to re-generate and publish the docker images for (e.g. 1.2.3).
15
+ If this is the latest tag (based on the selected ref), the image will also be published with the latest-tag.
16
+ required : true
17
+ dry_run :
18
+ description : If set, generates the images but doesn't push them
19
+ default : false
20
+ type : boolean
21
+
22
+ permissions :
23
+ contents : read
24
+
25
+ concurrency :
26
+ group : ${{ github.workflow }}
27
+
28
+ jobs :
29
+ build-and-push-docker-images :
30
+ name : " Build and push docker images"
31
+ runs-on : ubuntu-latest
32
+ steps :
33
+ - uses : actions/checkout@v4
34
+ with :
35
+ ref : ${{ inputs.ref }}
36
+ fetch-depth : 0 # Load entire history as it is required for the push-script
37
+ - uses : ./.github/actions/build-and-publish-docker
38
+ with :
39
+ release_version : ${{ inputs.version }}
40
+ ref : ${{ inputs.ref }}
41
+ dry_run : ${{ inputs.dry_run }}
Original file line number Diff line number Diff line change @@ -129,28 +129,16 @@ jobs:
129
129
needs :
130
130
- await-maven-central-artifact
131
131
- create-github-release
132
- env :
133
- SONATYPE_FALLBACK : 1
134
132
steps :
135
133
- uses : actions/checkout@v4
136
134
with :
137
135
ref : ${{ inputs.ref }}
138
136
fetch-depth : 0 # Load entire history as it is required for the push-script
139
-
140
- - name : Log in to the Elastic Container registry
141
- uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
137
+ - uses : ./.github/actions/build-and-publish-docker
142
138
with :
143
- registry : ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
144
- username : ${{ secrets.ELASTIC_DOCKER_USERNAME }}
145
- password : ${{ secrets.ELASTIC_DOCKER_PASSWORD }}
146
-
147
- - name : " Build docker image"
148
- shell : bash
149
- run : ./scripts/docker-release/build_docker.sh "${{ env.RELEASE_VERSION }}"
150
- - name : " Push docker image"
151
- if : ${{ ! inputs.dry_run }}
152
- shell : bash
153
- run : ./scripts/docker-release/push_docker.sh "${{ env.RELEASE_VERSION }}"
139
+ release_version : " ${{ env.RELEASE_VERSION }}"
140
+ ref : ${{ inputs.ref }}
141
+ dry_run : ${{ inputs.dry_run }}
154
142
155
143
publish-aws-lambda :
156
144
name : " Publish AWS Lambda"
Original file line number Diff line number Diff line change 34
34
then
35
35
echo " ERROR: Pulling images from Sonatype Nexus repo requires cURL to be installed" && exit 1
36
36
fi
37
- curl -L -s -o apm-agent-java.jar \
38
- " https://oss.sonatype .org/service/local/artifact/maven/redirect?r=releases&g=co. elastic. apm&a= elastic-apm-agent&v= $RELEASE_VERSION "
37
+ curl -L -s --fail-with-body - o apm-agent-java.jar \
38
+ " https://repo1.maven .org/maven2/co/elastic/apm/ elastic- apm-agent/ $RELEASE_VERSION / elastic-apm-agent- $RELEASE_VERSION .jar "
39
39
else
40
40
echo " ERROR: No suitable build artifact was found. Re-running this script with the SONATYPE_FALLBACK variable set to true will try to use the Sonatype artifact for the latest tag"
41
41
exit 1
You can’t perform that action at this time.
0 commit comments