Skip to content

Commit

Permalink
Merge pull request #48 from EOEPCA/develop
Browse files Browse the repository at this point in the history
Release 1.2
  • Loading branch information
daniel-pimenta-DME authored Aug 3, 2023
2 parents 9bddc09 + efc6208 commit f54a16a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 21 deletions.
67 changes: 47 additions & 20 deletions .github/workflows/container_creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,31 @@ on: push

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
GITHUB_REGISTRY: ghcr.io
DOCKER_REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:
build:

test:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Runs a single command using the runners shell
- name: Setup Python 3.6.9
uses: actions/setup-python@v2
with:
python-version: "3.6.9"
# Runs a set of commands using the runners shell
- name: Testing
run: |
sudo apt-get install jq python3-venv
pip install -r ./src/requirements.txt
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
Expand All @@ -43,36 +61,25 @@ jobs:

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
- name: Log into registry ${{ env.GITHUB_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
id: gh_meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=develop
type=ref,event=tag
# Runs a single command using the runners shell
- name: Setup Python 3.6.9
uses: actions/setup-python@v2
with:
python-version: 3.6.9
# Runs a set of commands using the runners shell
- name: Testing
run: |
sudo apt-get install jq python3-venv
pip install -r ./src/requirements.txt
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
Expand All @@ -82,8 +89,8 @@ jobs:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.gh_meta.outputs.tags }}
labels: ${{ steps.gh_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -98,4 +105,24 @@ jobs:
COSIGN_EXPERIMENTAL: "true"
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
run: echo "${{ steps.gh_meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

- name: Log into registry ${{ env.DOCKER_REGISTRY }}
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: docker_meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: "{{defaultContext}}"
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
2 changes: 1 addition & 1 deletion charts/user-profile/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ configMap:

image:
imagePullPolicy: Always
image: ghcr.io/eoepca/um-user-profile:v1.3
image: um-user-profile:v1.2
persistence:
accessModes: ReadWriteMany
dbStorageSize: 5Gi
Expand Down
2 changes: 2 additions & 0 deletions src/config/um-user-profile-env-vars
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ UP_COLOR_TEXT_HEADER_TABLE="white"
UP_COLOR_BUTTON_MODIFY="#38A79F"
UP_USE_THREADS=true
UP_DEBUG_MODE=true
UP_PDP_URL="localhost"
UP_PDP_PORT=5567
1 change: 1 addition & 0 deletions src/web_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
for env_var in env_vars:
if env_var not in os.environ:
use_env_var = False

config = {}
# setup config
if use_env_var is False:
Expand Down

0 comments on commit f54a16a

Please sign in to comment.