9
9
fake_tag :
10
10
description : ' Version to be given to the packages'
11
11
default : ' 0.0.0'
12
+ skip_mirror_repo :
13
+ type : boolean
14
+ required : true
15
+ description : ' Skip mirroring the repository'
16
+ default : ' true'
12
17
dest_prefix :
13
18
description : ' Repo prefix'
14
19
required : true
27
32
GPG_PASSPHRASE : ${{ secrets.OHAI_GPG_PASSPHRASE }}
28
33
GPG_PRIVATE_KEY_BASE64 : ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
29
34
BRANCH : ${{ github.event.inputs.branch }}
35
+ # publish packages to a custom path
30
36
DEST_PREFIX : ${{ github.event.inputs.dest_prefix }}
37
+ # force all custom packages to be published to a fixed path
38
+ FIXED_PREFIX : " testing-pre-releases"
39
+ # using infrastructure_agent as suffix allows use to mirror an on_demand repo
40
+ FIXED_SUFFIX : " infrastructure_agent/"
41
+ # skip mirror repo for a single package test, or allow mirroring to have multiple packages in a custom repo
42
+ SKIP_MIRROR_REPO : ${{ github.event.inputs.skip_mirror_repo }}
31
43
AWS_S3_BUCKET_NAME : " nr-downloads-ohai-staging"
32
44
AWS_REGION : " us-east-1"
33
45
AWS_S3_LOCK_BUCKET_NAME : " onhost-ci-lock-staging"
34
- ACCESS_POINT_HOST : " staging"
35
46
RUN_ID : ${{ github.run_id }}
36
47
37
48
AWS_ACCESS_KEY_ID : ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_STAGING }}
46
57
runs-on : ubuntu-20.04
47
58
48
59
steps :
60
+ - name : dest_prefix for testing
61
+ run : |
62
+ # append trailing slash if no present
63
+ dest_prefix="${{ env.DEST_PREFIX }}"
64
+ if [[ "${dest_prefix}" != */ ]]; then
65
+ dest_prefix="${dest_prefix}/"
66
+ fi
67
+ echo "DEST_PREFIX=${{ env.FIXED_PREFIX }}/${dest_prefix}${{ env.FIXED_SUFFIX }}" >> $GITHUB_ENV
68
+ # remove trailing slash from dest prefix
69
+ dest_prefix="${dest_prefix%/}"
70
+ echo "ACCESS_POINT_HOST=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${{ env.FIXED_PREFIX }}/${dest_prefix}" >> $GITHUB_ENV
71
+
49
72
- uses : actions/checkout@v3
50
73
with :
51
74
ref : ${{ env.BRANCH }}
74
97
75
98
- name : Publish NON-FIPS deb to S3 action
76
99
if : ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'NON-FIPS' }}
77
- uses : newrelic/infrastructure-publish-action@v1.3.4
100
+ uses : newrelic/infrastructure-publish-action@v1
78
101
with :
79
102
tag : ${{env.FAKE_TAG}}
80
103
app_name : " newrelic-infra"
@@ -96,11 +119,11 @@ jobs:
96
119
disable_lock : ${{ env.DISABLE_LOCK }}
97
120
dest_prefix : ${{ env.DEST_PREFIX }}
98
121
local_packages_path : " /srv/dist/"
99
- apt_skip_mirror : true
122
+ apt_skip_mirror : ${{ env.SKIP_MIRROR_REPO }}
100
123
101
124
- name : Publish NON-FIPS rpm to S3 action
102
125
if : ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'NON-FIPS' }}
103
- uses : newrelic/infrastructure-publish-action@v1.3.4
126
+ uses : newrelic/infrastructure-publish-action@v1
104
127
with :
105
128
tag : ${{env.FAKE_TAG}}
106
129
app_name : " newrelic-infra"
@@ -125,7 +148,7 @@ jobs:
125
148
126
149
- name : Publish NON-FIPS targz to S3 action
127
150
if : ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'NON-FIPS' }}
128
- uses : newrelic/infrastructure-publish-action@v1.3.4
151
+ uses : newrelic/infrastructure-publish-action@v1
129
152
with :
130
153
tag : ${{env.FAKE_TAG}}
131
154
app_name : " newrelic-infra"
@@ -169,7 +192,7 @@ jobs:
169
192
170
193
- name : Publish FIPS deb to S3 action
171
194
if : ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'FIPS' }}
172
- uses : newrelic/infrastructure-publish-action@v1.3.4
195
+ uses : newrelic/infrastructure-publish-action@v1
173
196
with :
174
197
tag : ${{env.FAKE_TAG}}
175
198
app_name : " newrelic-infra-fips"
@@ -191,11 +214,11 @@ jobs:
191
214
disable_lock : ${{ env.DISABLE_LOCK }}
192
215
dest_prefix : ${{ env.DEST_PREFIX }}
193
216
local_packages_path : " /srv/dist/"
194
- apt_skip_mirror : true
217
+ apt_skip_mirror : ${{ env.SKIP_MIRROR_REPO }}
195
218
196
219
- name : Publish FIPS rpm to S3 action
197
220
if : ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'FIPS' }}
198
- uses : newrelic/infrastructure-publish-action@v1.3.4
221
+ uses : newrelic/infrastructure-publish-action@v1
199
222
with :
200
223
tag : ${{env.FAKE_TAG}}
201
224
app_name : " newrelic-infra-fips"
@@ -220,7 +243,7 @@ jobs:
220
243
221
244
- name : Publish FIPS targz to S3 action
222
245
if : ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'FIPS' }}
223
- uses : newrelic/infrastructure-publish-action@v1.3.4
246
+ uses : newrelic/infrastructure-publish-action@v1
224
247
with :
225
248
tag : ${{env.FAKE_TAG}}
226
249
app_name : " newrelic-infra-fips"
0 commit comments