Skip to content

Commit

Permalink
Merge branch 'master' into github-workflow-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
testower committed May 23, 2024
2 parents 330ef67 + 07df1c9 commit 2e57597
Show file tree
Hide file tree
Showing 64 changed files with 1,317 additions and 1,086 deletions.
100 changes: 43 additions & 57 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,18 @@
version: 2
version: 2.1
aliases:
- &google-sdk-container-config
docker:
- image: google/cloud-sdk:latest
auth:
username: $DOCKERHUB_LOGIN
password: $DOCKERHUB_PASSWORD
- &GCP-auth-docker
name: GCP authentication with docker
command: |
echo $DOCKER_PASSWORD > ${HOME}/account-auth.json
- &jfrog-login
name: Rename jfrog environment variable for maven setting.xml
command: |
echo "export JFROG_USER=$ARTIFACTORY_USER" >> $BASH_ENV
echo "export JFROG_PASS=$ARTIFACTORY_PASSWORD" >> $BASH_ENV
- &tag-git-version
name: Tag git commit with build version and push to github
- &post_build
name: Trigger downstream builds
command: |
git config --global user.email "[email protected]"
git config --global user.name "circleci"
git tag $VERSION
git push origin $VERSION
- &create-image-version
name: Create new image version and store to env var and as file in workspace
command: |
echo "export VERSION=$CIRCLE_BRANCH-v$CIRCLE_BUILD_NUM-$(echo -n $CIRCLE_SHA1 | tail -c 8)" >> $BASH_ENV
echo "$CIRCLE_BRANCH-v$CIRCLE_BUILD_NUM-$(echo -n $CIRCLE_SHA1 | tail -c 8)" > version
- &read-image-version
name: Read new image version from workspace
command: |
echo "export VERSION=$(cat ./version)" >> $BASH_ENV
- &docker-build-and-push
name: Docker build and push
command: |
IMAGE="eu.gcr.io/entur-system-1287/${CIRCLE_PROJECT_REPONAME}"
echo "Image: ${IMAGE}"
docker build -t $IMAGE .
docker tag $IMAGE "${IMAGE}":"${VERSION}"
docker login -u _json_key --password-stdin https://eu.gcr.io < ${HOME}/account-auth.json
docker push "${IMAGE}":"${VERSION}"
wget https://raw.githubusercontent.com/entur/circleci-toolbox-image-java11/master/tools/trigger_build_v2.sh -O .circleci/trigger_build_v2.sh
chmod +x .circleci/trigger_build_v2.sh
echo 'export CIRCLE_SHA1="$CIRCLE_SHA1"' >> $BASH_ENV
echo 'export CIRCLE_PROJECT_REPONAME="$CIRCLE_PROJECT_REPONAME"' >> $BASH_ENV
.circleci/trigger_build_v2.sh "entur/uttu-deployment-config.git" "master" "$(git log -1 --pretty=%B)"
- &sonar-scan
name: Sonar scan
command: |
Expand All @@ -55,7 +28,7 @@ aliases:
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.token=${ENTUR_SONAR_PASSWORD}
jobs:
build:
test:
machine:
image: ubuntu-2204:2024.04.3
environment:
Expand Down Expand Up @@ -94,36 +67,49 @@ jobs:
path: ~/junit
- store_artifacts:
path: ~/junit
- run: *create-image-version
- run: *tag-git-version
- persist_to_workspace:
root: ~/project
paths:
- target
- Dockerfile
- .circleci
- ./version
deploy-docker:
<<: *google-sdk-container-config
build:
docker:
- image: cimg/openjdk:21.0.2-node
auth:
username: $DOCKERHUB_LOGIN
password: $DOCKERHUB_PASSWORD
environment:
MAVEN_OPTS: -Xmx3G
steps:
- setup_remote_docker:
version: default
docker_layer_caching: true
- attach_workspace:
at: ~/project
- run: *GCP-auth-docker
- run: *read-image-version
- run: *docker-build-and-push
- checkout
- restore_cache:
keys:
- dep-cache-v2-{{ checksum "pom.xml" }}
- dep-cache-v2-
- run:
name: Download Maven settings
command: wget https://raw.githubusercontent.com/entur/circleci-toolbox-image-java11/master/tools/m2/settings.xml -O .circleci/settings.xml
- run: *jfrog-login
- run:
name: Refresh cache
command: mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.0:go-offline -s .circleci/settings.xml
- save_cache:
paths:
- ~/.m2
key: dep-cache-v2-{{ checksum "pom.xml" }}
# Cannot use -o because of snapshot dependencies.
- run: mvn deploy -s .circleci/settings.xml -P prettierSkip -DskipTests
- run: *post_build
workflows:
version: 2
build_test_deploy:
release:
jobs:
- build:
- test:
context: global
- deploy-docker:
- build:
context: global
requires:
- build
filters:
branches:
only: master
only:
- master
requires:
- test
8 changes: 0 additions & 8 deletions Dockerfile

This file was deleted.

33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,39 @@ provide a NeTEx file of organisations with

uttu.organisations.netex-file-uri=<path-to-file>

or provide your own implementation of the `OrganisationRegistry` interface
or provide your own implementation of the `OrganisationRegistry` interface ––
see `src/main/java/no/entur/uttu/organisation/spi/OrganisationRegistry.java`.

See `src/test/resources/fixtures/organisations.xml` for an example of a NeTEx file with organisations.
Refer to `src/test/resources/fixtures/organisations.xml` for an example of a NeTEx file with organisations.

## Stop place registry

Uttu needs a stop place registry in order to allow lookup of stop places from quay refs, used when creating
journey patterns with fixed transit stops, and with hail-and-ride areas.

You may provide a NeTEx file of stop places with

uttu.stopplace.netex-file-uri=<path-to-file>

or provide your own implementation of the `StopPlaceRegistry` interface ––
see `src/main/java/no/entur/uttu/stopplace/spi/StopPlaceRegistry.java`.

Refer to `src/test/resources/fixtures/stopplace.xml` for an example of a NeTEx file with stop places.

## Optional export notification message

If you want to notify an external system about a NeTEx file export, you can
provide an implementation of the `MessagingService` interface –– see
`src/main/java/no/entur/uttu/export/messaging/spi/MessagingService.java`.

The default MessagingService implementation is a noop.

## Disable Google PubSub autoconfiguration

If you don't use Google PubSub, sett this property:

# This property is needed to avoid pubsub autoconfiguration
spring.cloud.gcp.pubsub.enabled=false

## Running locally
### Build
Expand Down
36 changes: 0 additions & 36 deletions api/apiproxy/flexible-lines.xml

This file was deleted.

31 changes: 0 additions & 31 deletions api/apiproxy/policies/assignMessage.addCors.xml

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions api/apiproxy/policies/flowCallout.getEnvironmentConfiguration.xml

This file was deleted.

22 changes: 0 additions & 22 deletions api/apiproxy/policies/flowCallout.replaceTargetUrl.xml

This file was deleted.

23 changes: 0 additions & 23 deletions api/apiproxy/policies/spikeArrest.xml

This file was deleted.

64 changes: 0 additions & 64 deletions api/apiproxy/proxies/flexible-lines-v1.xml

This file was deleted.

Loading

0 comments on commit 2e57597

Please sign in to comment.