-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13779: Decouple docker from maven (#30)
* Refactors docker_build to be autonomousé * Removes docker build from maven main pom * Modifies build to build images independently * Fixes path error * Docker file cleaning * Refactors docker_build to be autonomousé * Removes docker build from maven main pom * Modifies build to build images independently * Fixes path error * Docker file cleaning * redundant files cleaning * Fixes version in docker_run --------- Co-authored-by: Arnaud DEMARCQ <[email protected]>
- Loading branch information
1 parent
04c841e
commit b153434
Showing
10 changed files
with
32 additions
and
189 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 |
---|---|---|
|
@@ -24,18 +24,21 @@ jobs: | |
- uses: stCarolas/[email protected] | ||
with: | ||
maven-version: 3.9.6 | ||
- name: docker-compose workaround | ||
run: echo "docker compose \"\$@\"" > $HOME/docker-compose ; chmod 777 $HOME/docker-compose ; echo "$HOME/" >> $GITHUB_PATH | ||
- name: Clean branch name | ||
- name: Set Environment Variables | ||
run: | | ||
BRANCH_NAME=${{ github.ref_name }} | ||
CLEAN_BRANCH_NAME=$(echo $BRANCH_NAME | sed 's/[\/_]/-/g') | ||
echo "Cleaned branch name: $CLEAN_BRANCH_NAME" | ||
echo CLEAN_BRANCH_NAME=$CLEAN_BRANCH_NAME >> $GITHUB_ENV | ||
- name: Sets up version | ||
run: mvn versions:set -DnewVersion=${{ env.CLEAN_BRANCH_NAME }}.${{github.run_number}} | ||
- name: Builds Artifacts and Images | ||
- name: Builds Artifacts | ||
run: mvn clean install | ||
- name: Builds Images | ||
working-directory: ./docker_build | ||
run: | | ||
export PROJECT_VERSION=${{ env.CLEAN_BRANCH_NAME }}.${{github.run_number}} | ||
docker compose build | ||
- name: Publish Images | ||
run: docker push simpledotorg/prometheusdbexporter:${{ env.CLEAN_BRANCH_NAME }}.${{github.run_number}} | ||
- name: Archive Dhis2TestTool jar file | ||
|
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 @@ | ||
PROJECT_VERSION=0.0.0 |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
services: | ||
prometheusdbexporter: | ||
image: simpledotorg/prometheusdbexporter:${PROJECT_VERSION} | ||
build: | ||
context: . | ||
dockerfile: prometheus.db.exporter.docker | ||
image: simpledotorg/prometheusdbexporter:${project.version} | ||
|
||
context: .. | ||
dockerfile: ./docker_build/prometheus.db.exporter.docker | ||
args: | ||
PROJECT_VERSION: ${PROJECT_VERSION} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,23 @@ | ||
from tomcat:11.0-jdk21 | ||
|
||
ENV JAVA_OPTS " -Dlogback.ContextSelector=JNDI " | ||
ARG PROJECT_VERSION | ||
|
||
COPY ./PrometheusDatabaseExporterWar-${project.version}.war /app/rtsl/prom_db_exporter/ | ||
COPY ./prometheus_db_exporter/*.properties /app/rtsl/prom_db_exporter/ | ||
COPY ./prometheus_db_exporter/logback.xml /app/rtsl/prom_db_exporter/ | ||
# | ||
# Files and Folders | ||
# | ||
COPY ./Webapps/PrometheusDatabaseExporterWar/target/PrometheusDatabaseExporterWar-*.war /app/rtsl/prom_db_exporter/ | ||
COPY ./docker_content/prometheus_db_exporter/*.properties /app/rtsl/prom_db_exporter/ | ||
COPY ./docker_content/prometheus_db_exporter/logback.xml /app/rtsl/prom_db_exporter/ | ||
COPY ./docker_content/prometheus_db_exporter/PrometheusDbExporter.xml /usr/local/tomcat/conf/Catalina/localhost/ | ||
RUN mkdir /app/rtsl/prom_db_exporter/sources | ||
|
||
COPY ./prometheus_db_exporter/PrometheusDbExporter.xml /usr/local/tomcat/conf/Catalina/localhost/ | ||
# | ||
# System needs to be as up to date as possible | ||
# | ||
#RUN apt-get update ; apt-get upgrade ; apt-get clean | ||
|
||
ENV JAVA_OPTS " -Dlogback.ContextSelector=JNDI " | ||
|
||
## Templates the config files based on the ARGS | ||
RUN sed -i "s/\${project.version}/${PROJECT_VERSION}/g" /usr/local/tomcat/conf/Catalina/localhost/PrometheusDbExporter.xml | ||
|
||
RUN mkdir /app/rtsl/prom_db_exporter/sources |
2 changes: 1 addition & 1 deletion
2
docker_content/prometheus_db_exporter/prom_db_exporter.5.docker.properties
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
database.jdbc.url=jdbc:postgresql://host.docker.internal:5432/dhis?ApplicationName=PrometheusDatabaseExporterWar | ||
database.jdbc.url=jdbc:postgresql://database:5432/dhis?ApplicationName=PrometheusDatabaseExporterWar | ||
|
||
config.root.folder=/app/rtsl/prom_db_exporter/sources | ||
cache.folder=/tmp/prom_db_exporter_cache/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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