Skip to content
Snippets Groups Projects
Unverified Commit 13bc3784 authored by Xiao Gui's avatar Xiao Gui
Browse files

maint: update dockerfile & build local image

parent 8ae9264d
No related branches found
No related tags found
No related merge requests found
......@@ -18,14 +18,22 @@ jobs:
PRODUCTION: 'true'
DOCKER_REGISTRY: 'docker-registry.ebrains.eu/siibra/'
SIIBRA_API_STABLE: 'https://siibra-api-stable.apps.hbp.eu/v3_0,https://siibra-api-stable-ns.apps.hbp.eu/v3_0,https://siibra-api-stable.apps.jsc.hbp.eu/v3_0'
SIIBRA_API_STABLE: 'https://siibra-api-stable.apps.hbp.eu/v3_0,https://siibra-api-stable.apps.jsc.hbp.eu/v3_0'
SIIBRA_API_RC: 'https://siibra-api-rc.apps.hbp.eu/v3_0'
SIIBRA_API_LATEST: 'https://siibra-api-latest.apps-dev.hbp.eu/v3_0'
SIIBRA_API_LOCAL: 'http://localhost:10081/v3_0'
LOCAL_TAG: 'local-10081'
strategy:
matrix:
build: [ 'local', 'prod' ]
steps:
- uses: actions/checkout@v2
- name: 'Set matomo env var'
# if matrix.build is local, only run if master or dev
if: ${{ !(matrix.build == 'local' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev') }}
run: |
echo "Using github.ref: $GITHUB_REF"
......@@ -52,8 +60,15 @@ jobs:
echo "SIIBRA_API_ENDPOINTS=${{ env.SIIBRA_API_LATEST }}" >> $GITHUB_ENV
fi
fi
if [[ "${{ matrix.build }}" == "local" ]]
then
echo "SIIBRA_API_ENDPOINTS=${{ env.SIIBRA_API_LATEST }}" >> $GITHUB_ENV
else
- name: 'Set version variable & expmt feature flag'
# if matrix.build is local, only run if master or dev
if: ${{ !(matrix.build == 'local' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev') }}
run: |
if [[ "$GITHUB_REF" == 'refs/heads/master' ]] || [[ "$GITHUB_REF" == 'refs/heads/staging' ]]
then
......@@ -63,8 +78,14 @@ jobs:
echo "EXPERIMENTAL_FEATURE_FLAG=true" >> $GITHUB_ENV
fi
- name: 'Build docker image'
# if matrix.build is local, only run if master or dev
if: ${{ !(matrix.build == 'local' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev') }}
run: |
DOCKER_BUILT_TAG=${{ env.DOCKER_REGISTRY }}siibra-explorer:$BRANCH_NAME
if [[ "${{ matrix.build }}" == "local" ]]
then
DOCKER_BUILT_TAG="$DOCKER_BUILT_TAG"-${{ env.LOCAL_TAG }}
fi
echo "Building $DOCKER_BUILT_TAG"
docker build \
--build-arg MATOMO_URL=$MATOMO_URL \
......@@ -77,6 +98,8 @@ jobs:
echo "DOCKER_BUILT_TAG=$DOCKER_BUILT_TAG" >> $GITHUB_ENV
- name: 'Push to docker registry'
# if matrix.build is local, only run if master or dev
if: ${{ !(matrix.build == 'local' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev') }}
run: |
echo "Login to docker registry"
docker login \
......
......@@ -4,7 +4,7 @@ ARG BACKEND_URL
ENV BACKEND_URL=${BACKEND_URL}
ARG SIIBRA_API_ENDPOINTS
ENV SIIBRA_API_ENDPOINTS=${SIIBRA_API_ENDPOINTS:-https://siibra-api-stable.apps.hbp.eu/v2_0,https://siibra-api-stable-ns.apps.hbp.eu/v2_0,https://siibra-api-stable.apps.jsc.hbp.eu/v2_0}
ENV SIIBRA_API_ENDPOINTS=${SIIBRA_API_ENDPOINTS:-https://siibra-api-stable.apps.hbp.eu/v3_0,https://siibra-api-stable.apps.jsc.hbp.eu/v3_0}
ARG STRICT_LOCAL
ENV STRICT_LOCAL=${STRICT_LOCAL:-false}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment