-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#13779: Decouple docker from maven #30
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ac86f30
Refactors docker_build to be autonomousé
8df3c22
Removes docker build from maven main pom
7c62094
Modifies build to build images independently
35d886a
Fixes path error
0c96840
Docker file cleaning
477ef38
Refactors docker_build to be autonomousé
cc28a45
Removes docker build from maven main pom
6f7bcf5
Modifies build to build images independently
1d10f47
Fixes path error
9344a15
Docker file cleaning
9dd7a5a
Merge remote-tracking branch 'refs/remotes/origin/ademarcq/13779' int…
6985626
redundant files cleaning
269703f
Fixes version in docker_run
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
ademarcqrtsl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're using this for sane defaults?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's used for defaults only.