Skip to content

Commit 27ae663

Browse files
committed
Automate website deployment using logging-parent:11.0.0-SNAPSHOT
1 parent 0eeb713 commit 27ae663

File tree

8 files changed

+151
-192
lines changed

8 files changed

+151
-192
lines changed

.github/workflows/build.yaml

+7-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
build:
4040
if: github.actor != 'dependabot[bot]'
41-
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/10.6.0
41+
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@main
4242
with:
4343
java-version: |
4444
8
@@ -48,11 +48,11 @@ jobs:
4848
deploy-snapshot:
4949
needs: build
5050
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
51-
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/10.6.0
51+
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@main
5252
# Secrets for deployments
5353
secrets:
54-
NEXUS_USER: ${{ secrets.NEXUS_USER }}
55-
NEXUS_PW: ${{ secrets.NEXUS_PW }}
54+
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
55+
NEXUS_PASSWORD: ${{ secrets.NEXUS_PW }}
5656
with:
5757
java-version: |
5858
8
@@ -61,12 +61,12 @@ jobs:
6161
deploy-release:
6262
needs: build
6363
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
64-
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/10.6.0
64+
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@main
6565
# Secrets for deployments
6666
secrets:
6767
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
68-
LOGGING_STAGE_DEPLOYER_USER: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
69-
LOGGING_STAGE_DEPLOYER_PW: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
68+
NEXUS_USERNAME: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
69+
NEXUS_PASSWORD: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
7070
SVN_USERNAME: ${{ secrets.LOGGING_SVN_DEV_USERNAME }}
7171
SVN_PASSWORD: ${{ secrets.LOGGING_SVN_DEV_PASSWORD }}
7272
# Write permissions to allow the Maven `revision` property update, changelog release, etc.
@@ -77,4 +77,3 @@ jobs:
7777
8
7878
17
7979
project-id: log4j
80-
site-enabled: true

.github/workflows/deploy-site.yaml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
name: deploy-site
19+
20+
on:
21+
push:
22+
branches:
23+
- "2.x"
24+
- "2.x-site-pro"
25+
- "release/*"
26+
paths-ignore:
27+
- "**.md"
28+
- "**.txt"
29+
30+
permissions: read-all
31+
32+
jobs:
33+
34+
deploy-site-stg:
35+
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
36+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@main
37+
# Secrets for committing the generated site
38+
secrets:
39+
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
40+
# Write permissions for committing the generated site
41+
permissions:
42+
contents: write
43+
with:
44+
asf-yaml-content: |
45+
staging:
46+
profile: ~
47+
whoami: ${{ github.ref_name }}-site-stg-out
48+
subdir: content/log4j/2.x
49+
install-required: true
50+
target-branch: ${{ github.ref_name }}-site-stg-out
51+
52+
deploy-site-pro:
53+
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x-site-pro'
54+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@main
55+
# Secrets for committing the generated site
56+
secrets:
57+
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
58+
# Write permissions for committing the generated site
59+
permissions:
60+
contents: write
61+
with:
62+
asf-yaml-content: |
63+
publish:
64+
profile: ~
65+
whoami: ${{ github.ref_name }}-out
66+
subdir: content/log4j/2.x
67+
install-required: true
68+
target-branch: ${{ github.ref_name }}-out
69+
70+
export-version:
71+
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
72+
runs-on: ubuntu-latest
73+
outputs:
74+
version: ${{ steps.export-version.outputs.version }}
75+
steps:
76+
- name: Export version
77+
id: export-version
78+
run: |
79+
version=$(echo "${{ github.ref_name }}" | sed 's/^release\///')
80+
echo "version=$version" >> "$GITHUB_OUTPUT"
81+
82+
deploy-site-rel:
83+
needs: export-version
84+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@main
85+
# Secrets for committing the generated site
86+
secrets:
87+
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
88+
# Write permissions for committing the generated site
89+
permissions:
90+
contents: write
91+
with:
92+
asf-yaml-content: |
93+
staging:
94+
profile: ~
95+
whoami: ${{ github.ref_name }}-site-stg-out
96+
subdir: content/log4j/${{ needs.export-version.outputs.version }}
97+
install-required: true
98+
target-branch: ${{ github.ref_name }}-site-stg-out

log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ private static final class InstanceHolder {
530530
StatusLogger.class.getSimpleName(),
531531
ParameterizedNoReferenceMessageFactory.INSTANCE,
532532
Config.getInstance(),
533-
new StatusConsoleListener(Config.getInstance().fallbackListenerLevel));
533+
new StatusConsoleListener(requireNonNull(Config.getInstance().fallbackListenerLevel)));
534534
}
535535

536536
/**

log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/convert/TypeConvertersTest.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
*/
1717
package org.apache.logging.log4j.core.config.plugins.convert;
1818

19-
import static org.junit.Assert.assertArrayEquals;
20-
import static org.junit.Assert.assertEquals;
19+
import static org.assertj.core.api.Assertions.assertThat;
2120

2221
import java.io.File;
2322
import java.math.BigDecimal;
@@ -221,12 +220,6 @@ public TypeConvertersTest(
221220
public void testConvert() throws Exception {
222221
final Object actual = TypeConverters.convert(value, clazz, defaultValue);
223222
final String assertionMessage = "\nGiven: " + value + "\nDefault: " + defaultValue;
224-
if (expected instanceof char[]) {
225-
assertArrayEquals(assertionMessage, (char[]) expected, (char[]) actual);
226-
} else if (expected instanceof byte[]) {
227-
assertArrayEquals(assertionMessage, (byte[]) expected, (byte[]) actual);
228-
} else {
229-
assertEquals(assertionMessage, expected, actual);
230-
}
223+
assertThat(actual).as(assertionMessage).isEqualTo(expected);
231224
}
232225
}

0 commit comments

Comments
 (0)