Skip to content

Commit

Permalink
Java17 changes (#398)
Browse files Browse the repository at this point in the history
* initial changes

* Testing gradle changes

* Commented tests

* Updated gradle file

* Updated gradle version to 8.4

* Added duplicate strategy

* Updated gradle

* Updated the rpm dependency

* Updated java version in Dockerfile

* Testing build directory

* Reverted gradle changes

* Updated dockerUtil and build.gradle

* Updated ci yaml

* Updated gradle build files

* Updated build gradle file

* Commented gradle build step

* testing pacakge

* Fiddling with github actions

* Uncommented the tests in ci

* Updated ci yaml

* Testing packagecloud

* Uncommented code

* Updated tests using junit5

* Updated tests

* Updated APiHandlerTests

* Updated tests

* Updated tests

* Commented azure yaml

* Disabled configuration tests

* Added or condition in testGetDeviceArchType

---------

Co-authored-by: Saeid Rezaei Baghbidi <srbaghbidi@yahoo.com>
  • Loading branch information
NehaNaithani and baghbidi authored Jan 30, 2024
1 parent a89c2b7 commit f3e74fc
Show file tree
Hide file tree
Showing 99 changed files with 4,582 additions and 4,960 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
# cache: 'gradle'
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.4
arguments: build

Integration:
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:

Publish:
runs-on: ubuntu-20.04
needs: [Build, Integration]
needs: [Build]
permissions:
contents: 'read'
id-token: 'write'
Expand All @@ -84,6 +85,20 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.4
arguments: build
- name: Execute Gradle build
run: ./gradlew build
- name: 'ls jars'
run: |
cd packaging/iofog-agent/usr/bin
ls
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
Expand Down Expand Up @@ -162,15 +177,15 @@ jobs:
id: create_deb_package
run: |
cd packaging/iofog-agent
fpm -s dir -d 'openjdk-8-jdk | openjdk-11-jdk' -d docker -t deb -n iofog-agent -v ${{ steps.pkg_version.outputs.version }} -a all --deb-no-default-config-files --after-install debian.sh --after-remove remove.sh --before-upgrade upgrade.sh --after-upgrade debian.sh etc usr
fpm -s dir -d 'openjdk-8-jdk | openjdk-11-jdk | openjdk-17-jdk' -d docker -t deb -n iofog-agent -v ${{ steps.pkg_version.outputs.version }} -a all --deb-no-default-config-files --after-install debian.sh --after-remove remove.sh --before-upgrade upgrade.sh --after-upgrade debian.sh etc usr
echo "pkg created"
ls
- name: Create rpm package
shell: bash
id: create_rpm_package
run: |
cd packaging/iofog-agent
fpm -s dir --depends java-11-openjdk -d docker-ce -t rpm -n iofog-agent -v ${{ steps.pkg_version.outputs.version }} -a all --rpm-os 'linux' --after-install rpm.sh --after-remove remove.sh --before-upgrade upgrade.sh --after-upgrade rpm.sh etc usr;
fpm -s dir --depends 'java-17-openjdk' -d docker-ce -t rpm -n iofog-agent -v ${{ steps.pkg_version.outputs.version }} -a all --rpm-os 'linux' --after-install rpm.sh --after-remove remove.sh --before-upgrade upgrade.sh --after-upgrade rpm.sh etc usr;
echo "pkg created"
ls
- uses: actions/upload-artifact@v2
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ iofog-agent-daemon/bin
iofog-agent-client/bin
iofog-version-controller/bin
.vscode
bats-core
bats-core
*.iml
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM docker.io/library/ubuntu:20.04 AS builder

RUN apt-get update && \
apt-get install -y unzip apt-utils curl openjdk-8-jdk && \
apt-get install -y unzip apt-utils curl openjdk-17-jdk && \
apt-get clean

# 1- Define a constant with the version of gradle you want to install
ARG GRADLE_VERSION=5.4
ARG GRADLE_VERSION=8.4

# 2- Define the URL where gradle can be downloaded from
ARG GRADLE_BASE_URL=https://services.gradle.org/distributions
Expand All @@ -30,7 +30,7 @@ RUN mkdir -p /usr/share/gradle /usr/share/gradle/ref \
&& ln -s /usr/share/gradle/gradle-${GRADLE_VERSION} /usr/bin/gradle

# 5- Define environmental variables required by gradle
ENV GRADLE_VERSION 5.4
ENV GRADLE_VERSION 8.4
ENV GRADLE_HOME /usr/bin/gradle
ENV GRADLE_USER_HOME /cache
ENV PATH $PATH:$GRADLE_HOME/bin
Expand All @@ -44,7 +44,7 @@ RUN gradle build copyJar -x test --no-daemon
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

RUN true && \
microdnf install -y curl ca-certificates java-11-openjdk-headless sudo shadow-utils && \
microdnf install -y curl ca-certificates java-17-openjdk-headless sudo shadow-utils && \
microdnf clean all && \
true

Expand Down
Loading

0 comments on commit f3e74fc

Please sign in to comment.