-
Notifications
You must be signed in to change notification settings - Fork 1
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 #327 from silinternational/feature/actions
convert from Codeship to GitHub Actions
- Loading branch information
Showing
6 changed files
with
140 additions
and
136 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Test and Publish | ||
|
||
on: | ||
push: | ||
|
||
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: ${{ vars.DOCKER_ORG }}/idp-id-broker | ||
- 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 }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
version: '2' | ||
services: | ||
testdb: | ||
image: mariadb:10 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: r00tp@ss! | ||
MYSQL_DATABASE: test | ||
MYSQL_USER: idbroker | ||
MYSQL_PASSWORD: idbroker | ||
|
||
app: | ||
build: . | ||
depends_on: | ||
- testdb | ||
- mfaapi | ||
- u2fsim | ||
working_dir: /data | ||
environment: | ||
APP_ENV: test | ||
EMAIL_SERVICE_accessToken: fake-abc-123 | ||
EMAIL_SERVICE_assertValidIp: "false" | ||
EMAIL_SERVICE_baseUrl: http://email | ||
EMAIL_SERVICE_validIpRanges: 192.168.0.0/16 | ||
EMAIL_SIGNATURE: Dummy Signature for Automated Tests | ||
EMAILER_CLASS: \Sil\SilIdBroker\Behat\Context\fakes\FakeEmailer | ||
HELP_CENTER_URL: https://help-center | ||
IDP_NAME: Test | ||
MYSQL_HOST: testdb | ||
MYSQL_DATABASE: test | ||
MYSQL_USER: idbroker | ||
MYSQL_PASSWORD: idbroker | ||
API_ACCESS_KEYS: abc123 | ||
TEST_SERVER_HOSTNAME: localhost | ||
PASSWORD_PROFILE_URL: https://www.example.com | ||
SUPPORT_EMAIL: support@example.com | ||
HR_NOTIFICATIONS_EMAIL: hr@example.com | ||
ABANDONED_USER_bestPracticeUrl: http://www.example.com/best-practices.html | ||
ABANDONED_USER_deactivateInstructionsUrl: http://www.example.com/deactivate-instructions.html | ||
MFA_WEBAUTHN_apiBaseUrl: mfaapi:8080/ | ||
MFA_WEBAUTHN_apiKey: 10345678-1234-1234-1234-123456789012 | ||
MFA_WEBAUTHN_apiSecret: 11345678-1234-1234-1234-12345678 | ||
MFA_WEBAUTHN_appId: ourApp99 | ||
MFA_WEBAUTHN_rpDisplayName: Our App | ||
MFA_WEBAUTHN_rpId: http://app99 | ||
U2F_SIM_HOST_AND_PORT: u2fsim:8080 | ||
|
||
dynamo: | ||
image: amazon/dynamodb-local | ||
ports: | ||
- "8000:8000" | ||
environment: | ||
AWS_ACCESS_KEY_ID: abc123 | ||
AWS_SECRET_ACCESS_KEY: abc123 | ||
AWS_DEFAULT_REGION: us-east-1 | ||
command: "-jar DynamoDBLocal.jar -sharedDb" | ||
|
||
# Don't use underscores in service names | ||
mfaapi: | ||
build: ./serverless-mfa-api | ||
ports: | ||
- 8080 | ||
environment: | ||
AWS_ENDPOINT: dynamo:8000 | ||
AWS_DEFAULT_REGION: us-east-1 | ||
AWS_ACCESS_KEY_ID: abc123 | ||
AWS_SECRET_ACCESS_KEY: abc123 | ||
AWS_DISABLE_SSL: "true" | ||
API_KEY_TABLE: ApiKey | ||
WEBAUTHN_TABLE: WebAuthn | ||
depends_on: | ||
- dynamo | ||
- dynamorestart | ||
working_dir: /src | ||
command: bash -c "echo starting server && go run ./server/" | ||
|
||
u2fsim: | ||
build: ./u2f-simulator | ||
ports: | ||
- 8080 | ||
working_dir: /src | ||
command: bash -c "echo starting u2f server && go run ./u2fserver/" | ||
|
||
# Create dynamodb tables and data before running the backend mfa api | ||
dynamorestart: | ||
build: ./dynamorestart | ||
ports: | ||
- 8080 | ||
environment: | ||
AWS_ENDPOINT: dynamo:8000 | ||
AWS_DEFAULT_REGION: us-east-1 | ||
AWS_ACCESS_KEY_ID: abc123 | ||
AWS_SECRET_ACCESS_KEY: abc123 | ||
AWS_DISABLE_SSL: "true" | ||
API_KEY_TABLE: ApiKey | ||
WEBAUTHN_TABLE: WebAuthn | ||
depends_on: | ||
- dynamo | ||
working_dir: /dynamo | ||
command: bash -c "php restart.php" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.