-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support automatic docker build of analyzer
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
tags: ['**'] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: jeffersonlab/analyzer | ||
- | ||
name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: "{{defaultContext}}" | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
DOCKER_TAG=${{ steps.meta.outputs.tags }} | ||
APP_VERSION=${{ github.ref_name}} | ||
REPO_NAME=${{ github.event.repository.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM centos:centos7 | ||
|
||
ARG APP_VERSION | ||
ARG REPO_NAME | ||
|
||
RUN yum update -q -y | ||
|
||
RUN yum -y install epel-release &&\ | ||
yum -y install git && \ | ||
yum -y groupinstall 'Development Tools'&& \ | ||
yum -y install gcc-c++ && \ | ||
yum -y install make && \ | ||
yum install -y root && \ | ||
yum install -y which && \ | ||
yum install -y root-montecarlo-eg && \ | ||
localedef -i en_US -f UTF-8 en_US.UTF-8 | ||
|
||
ADD https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.tar.gz . | ||
RUN tar -xvf cmake-3.22.2-linux-x86_64.tar.gz && rm cmake-3.22.2-linux-x86_64.tar.gz | ||
RUN mv cmake-3.22.2-linux-x86_64 /usr/local/cmake | ||
ENV PATH="/usr/local/cmake/bin:$PATH" | ||
ADD https://github.com/JeffersonLab/${REPO_NAME}/archive/refs/tags/${APP_VERSION}.tar.gz . | ||
RUN tar -xvf ${APP_VERSION}.tar.gz && rm ${APP_VERSION}.tar.gz | ||
WORKDIR "/${REPO_NAME}-${APP_VERSION}" | ||
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr/local/analyzer -B BUILD -S /${REPO_NAME}-${APP_VERSION}/ | ||
RUN cmake --build BUILD -j8 | ||
RUN cmake --install BUILD | ||
ENV LD_LIBRARY_PATH="/usr/local/analyzer/lib64:$LD_LIBRARY_PATH" | ||
ENV ANALYZER="/usr/local/analyzer" | ||
ENV PATH="/usr/local/analyzer/bin:/usr/bin/root:$PATH" | ||
ENV ROOTSYS="/usr/" | ||
|