Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #57 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 09984c7 + fbc8562 commit 3279bf6
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 54 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 }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ target/
env/

# VSCode
.vscode
.vscode

.idea
4 changes: 2 additions & 2 deletions charts/pdp-engine/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 1.1.12

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.0
appVersion: "v1.2"
2 changes: 1 addition & 1 deletion charts/pdp-engine/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pdp-{{ .Values.context }}-service
name: pdp-engine

annotations:
kubernetes.io/ingress.class: nginx
Expand Down
10 changes: 5 additions & 5 deletions charts/pdp-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ ports:
type: TCP

configMap:
check_ssl_certs: false
debug_mode: true
check_ssl_certs: "'false'"
debug_mode: "'true'"

readinessProbe:
initialDelaySeconds: 1
Expand All @@ -38,9 +38,9 @@ requests:
dbMemory: 70Mi

image:
imagePullPolicy: Always
image: eoepca/um-pdp-engine:v1.0
persistence:
image: um-pdp-engine
imagePullPolicy: IfNotPresent
persistence:
accessModes: ReadWriteMany
dbStorageSize: 5Gi
type: DirectoryOrCreate
Expand Down
7 changes: 1 addition & 6 deletions gh_actions/acceptanceTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
# fail fast settings from https://dougrichardson.org/2018/08/03/fail-fast-bash-scripting.html
set -euov pipefail

# Check presence of environment variables
TRAVIS_BUILD_NUMBER="${TRAVIS_BUILD_NUMBER:-0}"

buildTag=travis_$TRAVIS_BUILD_NUMBER # We use a temporary build number for tagging, since this is a transient artefact

docker run --rm -d -p $2:$3 --name $1 eoepca/$1:${buildTag} # Runs container from EOEPCA repository
docker run --rm -d -p $2:$3 --name $1 eoepca/$1:$4 # Runs container from EOEPCA repository

sleep 15 # wait until the container is running

Expand Down
12 changes: 2 additions & 10 deletions gh_actions/containerCreation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@
# fail fast settings from https://dougrichardson.org/2018/08/03/fail-fast-bash-scripting.html
set -euov pipefail


# Check presence of environment variables
TRAVIS_BUILD_NUMBER="${TRAVIS_BUILD_NUMBER:-0}"

# Create a Docker image and tag it as 'travis_<build number>'
buildTag=travis_$TRAVIS_BUILD_NUMBER # We use a temporary build number for tagging, since this is a transient artefact

docker build -t eoepca/$1 .
docker tag eoepca/$1 eoepca/$1:$buildTag
docker tag eoepca/$1 eoepca/$1:$2

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

docker push eoepca/$1:$buildTag # defaults to docker hub EOEPCA repo

docker push eoepca/$1:$2 # defaults to docker hub EOEPCA repo
11 changes: 2 additions & 9 deletions gh_actions/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
# fail fast settings from https://dougrichardson.org/2018/08/03/fail-fast-bash-scripting.html
set -euov pipefail

# Check presence of environment variables
TRAVIS_BUILD_NUMBER="${TRAVIS_BUILD_NUMBER:-0}"
buildTag=travis_$TRAVIS_BUILD_NUMBER # We use a temporary build number for tagging, since this is a transient artefact

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker pull eoepca/$1:$buildTag # have to pull locally in order to tag as a release

# Tag and push as a Release
docker tag eoepca/$1:$buildTag eoepca/$1:release_$TRAVIS_BUILD_NUMBER
docker push eoepca/$1:release_$TRAVIS_BUILD_NUMBER
docker push eoepca/$1:$2

# Tag and push as `latest`
docker tag eoepca/$1:$buildTag eoepca/$1:latest
docker tag eoepca/$1:$2 eoepca/$1:latest
docker push eoepca/$1:latest

0 comments on commit 3279bf6

Please sign in to comment.