Skip to content

Commit

Permalink
create new image with java17 for zowe v3
Browse files Browse the repository at this point in the history
Signed-off-by: MarkAckert <[email protected]>
  • Loading branch information
MarkAckert committed Dec 2, 2024
1 parent 0eefaf7 commit 1edecd4
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .dockerfiles/ort.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ USER root
RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -y curl bash python3 zip unzip wget software-properties-common python3-pip git && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get update -y && apt-get install -y nodejs openjdk-11-jdk pkg-config
apt-get update -y && apt-get install -y nodejs openjdk-17-jdk pkg-config

RUN mkdir /report
RUN mkdir -p /home/build
Expand Down
71 changes: 71 additions & 0 deletions .dockerfiles/ort.zowev2.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Set base image as Debian Buster w/ Packaged Ruby
FROM debian:bullseye

#####################################################
# version the Dockerfile, so we can do release bump
LABEL version="1.0.0"

USER root

RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -y curl bash python3 zip unzip wget software-properties-common python3-pip git && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get update -y && apt-get install -y nodejs openjdk-11-jdk pkg-config

RUN mkdir /report
RUN mkdir -p /home/build

ENV HOME=/root

WORKDIR /home/build

RUN mkdir -p "$HOME/.npm_global"
ENV NPM_CONFIG_PREFIX="$HOME/.npm-global"
ENV PATH=$PATH:"$HOME/.npm-global/bin"
ENV PATH="$HOME/.cargo/bin:$PATH"

RUN npm install -g yarn
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash -

ENV owasp_version=5.3.2
ENV owasp_dc_download="https://github.com/jeremylong/DependencyCheck/releases/download/v${owasp_version}/"

RUN file="dependency-check-${owasp_version}-release.zip" && \
wget "$owasp_dc_download/$file" && \
unzip ${file} && \
rm ${file}

WORKDIR /home/build

RUN curl -fL https://getcli.jfrog.io/v2 | sh && chmod 775 jfrog && mv jfrog /usr/local/bin


RUN apt-get install libssl-dev build-essential jq -y

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN . "$HOME/.cargo/env"
RUN env

RUN rustup install stable && rustup default stable
RUN cargo install cargo-license
RUN cargo install get-license-helper

ARG ORT_VERSION=33.1.0

RUN git clone https://github.com/oss-review-toolkit/ort
WORKDIR /home/build/ort
RUN git checkout "$ORT_VERSION"
RUN git submodule update --init --recursive
RUN ./gradlew installDist

## ORT Binary install - requires Java 17+, which causes issues with some of our v2 projects (Java 11)
# RUN wget -O ort.zip "https://github.com/oss-review-toolkit/ort/releases/download/$ORT_VERSION/ort-$ORT_VERSION.zip"
# RUN unzip ort.zip
ENV PATH=/home/build/ort/cli/build/install/ort/bin:$PATH

RUN pip install git+https://github.com/aboutcode-org/python-inspector setuptools

WORKDIR /home/build

ENTRYPOINT [ "tail", "-f", "/dev/null" ]

8 changes: 8 additions & 0 deletions .github/workflows/create-dockerfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,12 @@ jobs:
file: .dockerfiles/ort.Dockerfile
tags: ${{ env.TARGET_DOCKER_REGISTRY }}/ompzowe/zowecicd-license-base:${{ github.event.inputs.image_version }}

- name: Build and push v2 docker release
id: docker_build_v2
uses: docker/build-push-action@v2
with:
push: true
file: .dockerfiles/ort.zowev2.Dockerfile
tags: ${{ env.TARGET_DOCKER_REGISTRY }}/ompzowe/zowecicd-license-base:v2-${{ github.event.inputs.image_version }}


22 changes: 20 additions & 2 deletions .github/workflows/license-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,30 @@ env:

jobs:

license-runner-tag:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.get-version.outputs.image_tag }}
steps:
- name: Determine which docker image to use
id: get-version
run: |
MAJOR_VERS=$(printf %.1s "${{ github.event.inputs.zowe_version }}")
## all of v3+ uses latest image, which is Java 17. v1 and v2 share J8/J11 image.
if [[ $MAJOR_VERS > 2 ]]; then
echo "image_tag=latest" >> $GITHUB_OUTPUT
else
echo "image_tag=v2-latest" >> $GITHUB_OUTPUT
fi

create-licenses:

runs-on: ubuntu-latest

needs: [license-runner-tag]
container:
image: zowe-docker-release.jfrog.io/ompzowe/zowecicd-license-base:latest
image: zowe-docker-release.jfrog.io/ompzowe/zowecicd-license-base:${{ needs.license-runner-tag.outputs.image_tag }}

steps:
- name: Update variables if releasing
Expand Down
9 changes: 0 additions & 9 deletions licenses/dependency-scan/resources/repoRules.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@
}
},
"zowe-cli": {
"excludes": {
"paths": [
{
"pattern": "**/__tests__/**",
"reason": "TEST_OF",
"comment": "test cases"
}
]
}
},
"zowe-client-python-sdk": {
"excludes": {
Expand Down

0 comments on commit 1edecd4

Please sign in to comment.