Skip to content

Commit

Permalink
Merge pull request #165 from silinternational/release/5.1.2
Browse files Browse the repository at this point in the history
Release 5.1.2 - use GitHub Actions
  • Loading branch information
briskt authored Mar 5, 2024
2 parents 2b3bc34 + 6f12349 commit 4d077b7
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 106 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test and Publish

on:
push:

env:
IMAGE_NAME: ${{ vars.DOCKER_ORG }}/idp-id-sync

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check PSR2
run: docker-compose -f actions-services.yml run --rm app ./check-psr2.sh
- name: Run unit tests
run: docker-compose -f actions-services.yml run --rm app ./run-tests.sh

build-and-publish:
name: Build and Publish
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
79 changes: 79 additions & 0 deletions actions-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
version: "3"

services:
app:
build: .
depends_on:
- broker
- brokerdb
working_dir: /data
environment:
APP_ENV: test
EMAIL_SERVICE_accessToken: dummy
EMAIL_SERVICE_assertValidIp: "false"
EMAIL_SERVICE_baseUrl: http://email
EMAIL_SERVICE_validIpRanges: 192.168.0.0/16
ID_BROKER_ADAPTER: fake
ID_BROKER_CONFIG_accessToken: codeship-sync-to-broker-11111111
ID_STORE_ADAPTER: fake
IDP_NAME: Test

broker:
image: silintl/idp-id-broker:latest
environment:
APP_ENV: test
API_ACCESS_KEYS: codeship-sync-to-broker-11111111
EMAIL_SERVICE_accessToken: dummy
EMAIL_SERVICE_assertValidIp: "false"
EMAIL_SERVICE_baseUrl: http://email
EMAIL_SERVICE_validIpRanges: 192.168.0.0/16
EMAILER_CLASS: \Sil\SilIdBroker\Behat\Context\fakes\FakeEmailer
IDP_NAME: local
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_HOST: brokerdb
MYSQL_DATABASE: broker
MYSQL_USER: broker
MYSQL_PASSWORD: broker
MFA_TOTP_apiBaseUrl: not_needed_here
MFA_TOTP_apiKey: not_needed_here
MFA_TOTP_apiSecret: not_needed_here
MFA_WEBAUTHN_apiBaseUrl: not_needed_here
MFA_WEBAUTHN_apiKey: not_needed_here
MFA_WEBAUTHN_apiSecret: not_needed_here
depends_on:
- brokercron
- brokerdb
command: whenavail brokerdb 3306 60 ./run.sh

brokercron:
image: silintl/idp-id-broker:latest
environment:
API_ACCESS_KEYS: local-sync-123
EMAIL_SERVICE_accessToken: dummy
EMAIL_SERVICE_assertValidIp: "false"
EMAIL_SERVICE_baseUrl: http://email
EMAIL_SERVICE_validIpRanges: 10.20.40.0/24
EMAILER_CLASS: \Sil\SilIdBroker\Behat\Context\fakes\FakeEmailer
IDP_NAME: local
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_HOST: brokerdb
MYSQL_DATABASE: broker
MYSQL_USER: broker
MYSQL_PASSWORD: broker
MFA_TOTP_apiBaseUrl: not_needed_here
MFA_TOTP_apiKey: not_needed_here
MFA_TOTP_apiSecret: not_needed_here
MFA_WEBAUTHN_apiBaseUrl: not_needed_here
MFA_WEBAUTHN_apiKey: not_needed_here
MFA_WEBAUTHN_apiSecret: not_needed_here
depends_on:
- brokerdb
command: whenavail brokerdb 3306 60 ./run-cron.sh

brokerdb:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: broker
MYSQL_USER: broker
MYSQL_PASSWORD: broker
2 changes: 1 addition & 1 deletion application/common/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
'clientOptions' => [
'attach_stacktrace' => false, // stack trace identifies the logger call stack, not helpful
'environment' => YII_ENV,
'release' => '[email protected].1',
'release' => '[email protected].2',
'before_send' => function (Event $event) use ($idpName): ?Event {
$event->setExtra(['idp' => $idpName]);
return $event;
Expand Down
78 changes: 0 additions & 78 deletions codeship-services.yml

This file was deleted.

25 changes: 0 additions & 25 deletions codeship-steps.yml

This file was deleted.

2 changes: 0 additions & 2 deletions dockercfg.encrypted

This file was deleted.

0 comments on commit 4d077b7

Please sign in to comment.