Skip to content

Commit

Permalink
Merge pull request #13 from HSLdevcom/aks-dev
Browse files Browse the repository at this point in the history
Update Pulsar version to 3.0.7
  • Loading branch information
thjarvin authored Nov 27, 2024
2 parents d6104a5 + b6ba6f6 commit 01afb34
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload .jar file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: transitdata-cancellation-processor-jar-with-dependencies.jar
path: target/transitdata-cancellation-processor-jar-with-dependencies.jar
Expand All @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Download .jar file
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: transitdata-cancellation-processor-jar-with-dependencies.jar
path: target
Expand All @@ -49,7 +49,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Download .jar file
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: transitdata-cancellation-processor-jar-with-dependencies.jar
path: target
Expand All @@ -60,3 +60,22 @@ jobs:
username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }}
tag_semver: true
build-aks-dev-docker-image:
needs: test
runs-on: ubuntu-latest
# Run only on aks-dev branch
if: github.ref == 'refs/heads/aks-dev'
steps:
- uses: actions/checkout@v2
- name: Download .jar file
uses: actions/download-artifact@v4
with:
name: transitdata-cancellation-processor-jar-with-dependencies.jar
path: target
- name: Build and publish aks-dev Docker image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: hsldevcom/transitdata-cancellation-processor
username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }}
tags: aks-dev
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fi.hsl.transitdata</groupId>
<artifactId>transitdata-cancellation-processor</artifactId>
<version>1.0.2</version>
<version>2.0.0</version>
<packaging>jar</packaging>

<repositories>
Expand All @@ -16,7 +16,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<common.version>1.5.4</common.version>
<common.version>2.0.1</common.version>
</properties>
<profiles>
<!-- The Configuration of the unit-test profile -->
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/fi/hsl/transitdata/cancellation/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,8 @@ public static void main(String[] args) {
private static String getDigitransitDeveloperApiUri() throws Exception {
String digitransitDeveloperApiUri;

if (ConfigUtils.getEnv("FILEPATH_DIGITRANSIT_DEVAPI_SECRET").isEmpty()) {
throw new Exception("Environment variable FILEPATH_DIGITRANSIT_DEVAPI_SECRET is missing");
}

try {
final String secretFilePath = ConfigUtils.getEnv("FILEPATH_DIGITRANSIT_DEVAPI_SECRET").get();
digitransitDeveloperApiUri = new Scanner(new File(secretFilePath))
.useDelimiter("\\Z").next();
digitransitDeveloperApiUri = System.getenv("TRANSITDATA_PUBTRANS_CONN_STRING");
} catch (Exception e) {
log.error("Failed to read Digitransit Developer API URI from secrets", e);
throw e;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/environment.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pulsar {
consumer {
multipleTopics=true
multipleTopics=${?PULSAR_CONSUMER_ENABLE_MULTIPLE_TOPICS}
topicsPattern="persistent://public/default/(cancellations|service-alerts)"
topicsPattern=${?PULSAR_CONSUMER_MULTIPLE_TOPICS_PATTERN}
topics=["cancellations|service-alerts"]
topics=${?PULSAR_CONSUMER_TOPICS}
subscription="cancellation-processor-subscription"
subscription=${?PULSAR_CONSUMER_SUBSCRIPTION}
}
Expand Down

0 comments on commit 01afb34

Please sign in to comment.