Skip to content

Commit

Permalink
chore: merge pull request #246 from dvsa/add-selfserve-to-monorepo
Browse files Browse the repository at this point in the history
chore: migrate selfserve to monorepo
  • Loading branch information
jerotire authored Aug 16, 2024
2 parents bbf5ecd + a2354e3 commit eec81ab
Show file tree
Hide file tree
Showing 1,079 changed files with 93,930 additions and 3 deletions.
17 changes: 17 additions & 0 deletions app/selfserve/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4
47 changes: 47 additions & 0 deletions app/selfserve/.github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
versioning-strategy: "increase-if-necessary"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "/vendor-bin/phpcs"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "/vendor-bin/phpstan"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "/vendor-bin/psalm"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
github-action-dependencies:
patterns:
- "*"
24 changes: 24 additions & 0 deletions app/selfserve/.github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CD

on:
push:
branches:
- main

jobs:
release-please:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
release_created: ${{ steps.release.outputs.release_created }}
sha: ${{ steps.release.outputs.sha }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: php
package-name: olcs-selfserve
23 changes: 23 additions & 0 deletions app/selfserve/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
pull_request:
schedule:
- cron: '0 0 * * 1'

jobs:
security:
uses: dvsa/.github/.github/workflows/php-security.yml@main
secrets:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

static-analysis:
uses: dvsa/.github/.github/workflows/php-static.yml@main
with:
php-version: '8.2'

tests:
uses: dvsa/.github/.github/workflows/php-tests.yml@main
with:
php-versions: '["8.2"]'
fail-fast: false
31 changes: 28 additions & 3 deletions app/selfserve/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
*
!.gitignore
# Trigger CD - 08-08-2024 13:55.
nbproject
._*
.~lock.*
.buildpath
.DS_Store
.idea
.project
.settings
vendor
test/coverage-report
.sublime-project
.sass-cache/
public/static
*.sw?
node_modules
.vscode/
test/coverage/
.scannerwork/
config/development.config.php
/vendor-bin/*/composer.lock
.phpunit.result.cache

# Non-dist files for the static analysis.
# This allows developers to set a different (more strict) static analysis locally.
phpcs.xml
phpstan.neon
phpunit.xml
psalm.xml
7 changes: 7 additions & 0 deletions app/selfserve/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Revision History for the OLCS Backend ### 4.0 2016-09-23 - Version 4.0 is the first version of the OLCS Self-serve to be published to GitHub

### 4.0.11 2016-12-12

- Version 4.0.11 is the second version of the OLCS Self-serve to be published to Githab. It contains enhancements to various features and remediation of defects discovered during the first three weeks of the Public Beta delivery.

Reference can be made to the composite release note provided.
Expand Down
1 change: 1 addition & 0 deletions app/selfserve/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The MIT License (MIT)Copyright (c) 2016 HM Government (Driver and Vehicle Standards Agency)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Expand Down
1 change: 1 addition & 0 deletions app/selfserve/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#OLCS SELFSERVE
139 changes: 139 additions & 0 deletions app/selfserve/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<project name="OLCS Selfserve/SSWEB" default="build">

<property name="version-file" value="config/version"/>
<property name="tar-file" value="olcs-selfserve"/>

<target name="init-environment">
<exec executable="hostname" outputproperty="computer.hostname"/>
<condition property="environment.isSkyScape">
<contains string="${computer.hostname}" substring=".mtpdvsa" casesensitive="false"/>
</condition>
<condition property="environment.isAws">
<contains string="${computer.hostname}" substring=".aws" casesensitive="false"/>
</condition>
<condition property="environment.isOther">
<and>
<not>
<contains string="${computer.hostname}" substring=".mtpdvsa" casesensitive="false"/>
</not>
<not>
<contains string="${computer.hostname}" substring=".aws" casesensitive="false"/>
</not>
</and>
</condition>
</target>

<target name="init-composer-aws" if="environment.isAws">
<exec executable="s3cmd" dir="." failonerror="true">
<arg line="get s3://rpm-repo001/composer.phar --skip-existing"/>
</exec>

<exec executable="sed" dir="." failonerror="true">
<arg line="-i -e 's/satis.inf.mgt.mtpdvsa/devrepo.shd.ci.nonprod.dvsa.aws/g' composer.json"/>
</exec>
<exec executable="sed" dir=".">
<arg line="-i -e 's/satis.inf.mgt.mtpdvsa/devrepo.shd.ci.nonprod.dvsa.aws/g' composer.lock"/>
</exec>

<exec executable="sed" dir="." failonerror="true">
<arg line="-i -e 's/gitlab.inf.mgt.mtpdvsa/repo.shd.ci.nonprod.dvsa.aws/g' composer.json"/>
</exec>
<exec executable="sed" dir=".">
<arg line="-i -e 's/gitlab.inf.mgt.mtpdvsa/repo.shd.ci.nonprod.dvsa.aws/g' composer.lock"/>
</exec>
</target>

<target name="init-composer-skyscape" if="environment.isSkyScape">
<get src="http://satis.inf.mgt.mtpdvsa/composer.phar" dest="composer.phar"/>
</target>

<target name="init-composer-other" if="environment.isOther">
<get src="http://getcomposer.org/composer.phar" dest="composer.phar"/>
</target>

<target name="init-composer" depends="init-environment, init-composer-aws, init-composer-other, init-composer-skyscape">
</target>

<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir=".">
<include name="**/*.php"/>
<exclude name="vendor/**"/>
</fileset>
</apply>
</target>

<target name="clean" description="Clean (remove) temporary files">
<delete file="data/autoload/classmap.php"/>
<delete>
<fileset dir="data/cache" includes="**"/>
</delete>
</target>

<target name="unittest" description="Run unit tests">
<exec executable="vendor/bin/phpunit" dir="." failonerror="true">
<arg line="-ctest/phpunit.xml"/>
</exec>
</target>

<target name="composer-update" depends="init-composer" description="Update composer dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="update"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
</exec>
</target>

<target name="composer-update-olcs" depends="init-composer" description="Update composer OLCS dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="update"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="olcs/*"/>
</exec>
</target>

<target name="composer-install" depends="init-composer" description="Install composer dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="install"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
</exec>
</target>

<target name="composer-install-nodev" depends="init-composer" description="Install composer dependencies exclude dev dependencies">
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="install"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-dev"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
</exec>
</target>

<target name="build" description="Build for production" depends="clean, lint, composer-install, unittest, composer-install-nodev, write-info" />

<target name="tar" description="Create tar.gz file" depends="build">
<exec executable="tar" failonerror="true">
<arg value="-czf${tar-file}.tar.gz"/>
<arg value="--exclude=config/autoload/local.php"/>
<arg value="--exclude=config/autoload/local.php.dist"/>
<arg line="composer.lock init_autoloader.php config module public data/autoload data/cache vendor"/>
</exec>
</target>

<target name="write-info" description="Write build info to a file" if="version-file">
<exec executable="git" output="${version-file}" failonerror="true">
<arg line="describe --all"/>
</exec>
<exec executable="date" output="${version-file}" append="true" failonerror="true"/>
</target>
</project>
10 changes: 10 additions & 0 deletions app/selfserve/composer-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Proxy to `vendor/bin/composer-update-syms`
# This script kept for to keep people happy who have got used to using it.

if [ -f vendor/bin/composer-update-syms ]; then
vendor/bin/composer-update-syms
else
echo "\"olcs/olcs-devtools\" composer dependency needs to be installed. You probably need to run 'composer update' first"
fi
Loading

0 comments on commit eec81ab

Please sign in to comment.