Skip to content

Commit

Permalink
fix: build script adapt jdk8 and jdk17 (#121)
Browse files Browse the repository at this point in the history
* feat: support JDK9 to JDK11

* fix: resume example ip to 127

* fix: spring cloud 2020 plugins not supported jdk 12+

* feat: support xmllint install

* feat: add release xmllint

* update jdk to 17

* feat: add jdk8

* add jdk 17

* add maven debug command

* add maven debug -X

* set use_docker_env=false

* fix:docker build
  • Loading branch information
andrewshan authored Jan 29, 2024
1 parent 0cc7d9f commit d167e95
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 16 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2

- name: Setup JDK 8
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
architecture: x64
targets: 'JAVA_8_HOME'

- name: Setup JDK 17
uses: AdoptOpenJDK/install-jdk@v1
with:
java-version: '8'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
version: '17'
architecture: x64

- name: Install xmllint
run: sudo apt-get install libxml2-utils

- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand All @@ -35,7 +45,7 @@ jobs:
- name: Build
id: build
run: |
export use_docker_env=true
export use_docker_env=false
pushd polaris-agent-build/bin
bash ./build_docker.sh ${{ steps.get_version.outputs.VERSION }}
26 changes: 19 additions & 7 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2

- name: Setup JDK 8
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
architecture: x64
targets: 'JAVA_8_HOME'

- name: Setup JDK 17
uses: AdoptOpenJDK/install-jdk@v1
with:
java-version: '8'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
version: '17'
architecture: x64

- name: Install xmllint
run: sudo apt-get install libxml2-utils

- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build
id: build
run: |
export use_docker_env=true
export use_docker_env=false
pushd polaris-agent-build/bin
echo $JAVA_HOME
echo $JAVA_8_HOME
bash ./build.sh ${{ steps.get_version.outputs.VERSION }}
popd
PACKAGE_NAME=$(ls | grep polaris-java-agent*.zip | sed -n '1p')
Expand Down
4 changes: 2 additions & 2 deletions polaris-agent-build/bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ cp "polaris-agent-build/conf/polaris-agent.config" "${folder_name}/conf"
echo "start to build package"

if [[ "${use_docker_env}" == "true" ]]; then
docker run --rm -u root -v "$(pwd)":/home/maven/project -w /home/maven/project maven:3.8.6-openjdk-8 mvn clean -B package --file pom.xml
docker run --rm -u root -v "$(pwd)":/home/maven/project -w /home/maven/project maven:3.8.6-openjdk-8 mvn clean -B package -X --file pom.xml
else
mvn clean -B package --file pom.xml
mvn clean -B package -X --file pom.xml
fi

cp "polaris-agent-core/polaris-agent-core-bootstrap/target/polaris-agent-core-bootstrap.jar" "${folder_name}/"
Expand Down

0 comments on commit d167e95

Please sign in to comment.