-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from costateixeira/linux-docker
Linux installer and docker
- Loading branch information
Showing
15 changed files
with
492 additions
and
129 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 |
---|---|---|
@@ -1,87 +1,79 @@ | ||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- master | ||
# pull_request: | ||
jobs: | ||
Build-Docker-Image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
# - | ||
# name: Login to Docker Hub | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Cache terminology files | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/terminology | ||
key: terminology-${{ github.sha }} | ||
restore-keys: terminology- | ||
- name: Setup MySQL | ||
run: | | ||
docker network create gh | ||
docker run \ | ||
--network gh \ | ||
--name mysql \ | ||
-e MYSQL_ROOT_PASSWORD=test \ | ||
-e MYSQL_USER=test \ | ||
-e MYSQL_PASSWORD=test \ | ||
-e MYSQL_DATABASE=test \ | ||
-d mysql:8 | ||
- name: Docker Build | ||
run: | | ||
docker build \ | ||
--tag fhirserver \ | ||
. | ||
# - name: Scan Code | ||
# run: | | ||
# export DISPLAY=0:0 | ||
# docker run --entrypoint /work/fhirserver/utilities/codescan/codescan fhirserver /work/bootstrap | ||
- name: Prepare ini file | ||
env: | ||
FHIRSERVER_LOCATIONS_CLONE_PATH: /work/fhirserver | ||
FHIRSERVER_LOCATIONS_TEST_CASES_CLONE_PATH: /work/bootstrap/source/fhir-test-cases | ||
FHIRSERVER_LOCATIONS_MARKDOWN_CLONE_PATH: /work/bootstrap/source/delphi-markdown | ||
FHIRSERVER_LOCATIONS_SNOMED_CACHE_PATH: /terminology/fhir-server/snomed.test.cache | ||
FHIRSERVER_MYSQL_SERVER: mysql | ||
FHIRSERVER_EMAIL_SENDER: [email protected] | ||
FHIRSERVER_EMAIL_DESTINATION: [email protected] | ||
FHIRSERVER_EMAIL_PASSWORD: ${{ secrets.FHIRSERVER_EMAIL_PASSWORD }} | ||
FHIRSERVER_SSL_CERT_PATH: /work/fhirserver/fixtures/domain.crt | ||
FHIRSERVER_SSL_KEY_PATH: /work/fhirserver/fixtures/domain.key | ||
FHIRSERVER_SSL_CACERT_PATH: /work/fhirserver/fixtures/rootCA.crt | ||
FHIRSERVER_SSL_PASSWORD: password | ||
run: | | ||
cat fixtures/test-settings.ini.template | envsubst > ~/test-settings.ini | ||
- name: Ensure SNOMED cache is present | ||
run: | | ||
mkdir -p ~/terminology/fhir-server | ||
wget -q --no-clobber https://storage.googleapis.com/ig-build/snomed.test.cache -O ~/terminology/fhir-server/snomed.test.cache || true | ||
ls ~/terminology/fhir-server/snomed.test.cache | ||
- name: Run tests in docker | ||
run: | | ||
docker images --all | ||
docker run \ | ||
--network gh \ | ||
-v ~/terminology:/terminology \ | ||
-v ~/test-settings.ini:/work/fhirserver/exec/64/test-settings.ini \ | ||
fhirserver -tests | ||
# - name: Tag and push Docker image | ||
# run: | | ||
# # Extract the FHIR server version from the library/version.inc file | ||
# FHIR_VERSION=$(grep -oP "FHIR_CODE_FULL_VERSION = '\K[^']+" library/version.inc) | ||
# | ||
# # Tag the Docker image with the extracted version and "latest" | ||
# docker tag fhirserver ${{ secrets.DOCKERHUB_USERNAME }}/fhirserver:$FHIR_VERSION | ||
# docker tag fhirserver ${{ secrets.DOCKERHUB_USERNAME }}/fhirserver:latest | ||
# | ||
# # Push both tagged images to Docker Hub | ||
# docker push ${{ secrets.DOCKERHUB_USERNAME }}/fhirserver:$FHIR_VERSION | ||
# docker push ${{ secrets.DOCKERHUB_USERNAME }}/fhirserver:latest | ||
name: Build and Push Docker Image to GHCR | ||
|
||
on: | ||
# Trigger the workflow on push or pull request for the main branch | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
Build-Docker-Image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the repository code | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
|
||
# Step 2: Log in to GitHub Container Registry (GHCR) | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub | ||
|
||
# Step 3: Cache terminology files (optional, to avoid re-downloading terminology files) | ||
- name: Cache terminology files | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/terminology | ||
key: terminology-${{ github.sha }} | ||
restore-keys: terminology- | ||
|
||
# Step 4: Setup MySQL for the build | ||
- name: Setup MySQL | ||
run: | | ||
docker network create gh | ||
docker run \ | ||
--network gh \ | ||
--name mysql \ | ||
-e MYSQL_ROOT_PASSWORD=test \ | ||
-e MYSQL_USER=test \ | ||
-e MYSQL_PASSWORD=test \ | ||
-e MYSQL_DATABASE=test \ | ||
-d mysql:8 | ||
# Step 5: Build the Docker image and tag it for GitHub Container Registry (GHCR) | ||
- name: Docker Build | ||
run: | | ||
docker build --tag ghcr.io/${{ github.repository_owner }}/fhirserver:nightly . | ||
# Step 6: Prepare ini file for your FHIR Server with environment variables | ||
- name: Prepare ini file | ||
env: | ||
FHIRSERVER_LOCATIONS_CLONE_PATH: /work/fhirserver | ||
FHIRSERVER_LOCATIONS_TEST_CASES_CLONE_PATH: /work/bootstrap/source/fhir-test-cases | ||
FHIRSERVER_LOCATIONS_MARKDOWN_CLONE_PATH: /work/bootstrap/source/delphi-markdown | ||
FHIRSERVER_LOCATIONS_SNOMED_CACHE_PATH: /terminology/fhir-server/snomed.test.cache | ||
FHIRSERVER_MYSQL_SERVER: mysql | ||
FHIRSERVER_EMAIL_SENDER: [email protected] | ||
FHIRSERVER_EMAIL_DESTINATION: [email protected] | ||
FHIRSERVER_EMAIL_PASSWORD: ${{ secrets.FHIRSERVER_EMAIL_PASSWORD }} | ||
FHIRSERVER_SSL_CERT_PATH: /work/fhirserver/fixtures/domain.crt | ||
FHIRSERVER_SSL_KEY_PATH: /work/fhirserver/fixtures/domain.key | ||
FHIRSERVER_SSL_CACERT_PATH: /work/fhirserver/fixtures/rootCA.crt | ||
FHIRSERVER_SSL_PASSWORD: password | ||
run: | | ||
cat fixtures/test-settings.ini.template | envsubst > ~/test-settings.ini | ||
# Step 7: Ensure SNOMED cache is present | ||
- name: Ensure SNOMED cache is present | ||
run: | | ||
mkdir -p ~/terminology/fhir-server | ||
wget -q --no-clobber https://storage.googleapis.com/ig-build/snomed.test.cache -O ~/terminology/fhir-server/snomed.test.cache || true | ||
ls ~/terminology/fhir-server/snomed.test.cache | ||
# Step 8: Push the Docker image to GitHub Container Registry (GHCR) | ||
- name: Push Docker image to GHCR | ||
run: | | ||
docker push ghcr.io/${{ github.repository_owner }}/fhirserver:nightly |
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.