Skip to content

Commit 4a30835

Browse files
author
Ball, Nware
committed
make it build pass on github actions
1 parent 13617ad commit 4a30835

File tree

6 files changed

+110
-100
lines changed

6 files changed

+110
-100
lines changed

.github/workflows/maven.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
pull_request:
10+
branches: [ "master", "develop" ]
11+
12+
jobs:
13+
build_maven:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up JDK 11
19+
uses: actions/setup-java@v3
20+
with:
21+
distribution: 'temurin'
22+
java-version: '11'
23+
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml
24+
server-username: CI_DEPLOY_USERNAME # env variable for username in deploy
25+
server-password: CI_DEPLOY_PASSWORD # env variable for token in deploy
26+
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
27+
gpg-passphrase: CI_GPG_PASSPHRASE # env variable for GPG private key passphrase
28+
29+
- name: Start Redis
30+
uses: supercharge/[email protected]
31+
with:
32+
redis-version: 4
33+
34+
- name: Install chromedriver
35+
uses: nanasess/[email protected]
36+
37+
- name: Install, unit test
38+
run: mvn install -Dmaven.javadoc.skip=true -PpublicRepos -B -V
39+
40+
- name: Non UI integration tests
41+
run: mvn install -PnonUiIntegrationTests
42+
43+
- name: UI integration tests
44+
run: |
45+
export DISPLAY=:99
46+
chromedriver --url-base=/wd/hub &
47+
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
48+
49+
java -jar gateleen-playground/target/playground.jar &> playground_logs.log &
50+
sleep 5s
51+
52+
mvn deploy -PuploadStaticFiles
53+
mvn install -PuiIntegrationTests
54+
55+
- name: Release to maven central
56+
if: github.ref_name == 'master' && github.event_name != 'pull_request' && github.repository == 'swisspost/gateleen'
57+
run: |
58+
curl -s get.sdkman.io | bash
59+
source "$HOME/.sdkman/bin/sdkman-init.sh"
60+
sdk install groovy 3.0.8
61+
62+
chmod +x ./maybe-release.sh
63+
./maybe-release.sh
64+
env:
65+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
66+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
67+
CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }}
68+
69+
- name: After release
70+
run: bash <(curl -s https://codecov.io/bash)

.travis.yml

-41
This file was deleted.

gateleen-test/src/test/java/org/swisspush/gateleen/hook/RouteTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void testRouteWithMatchingHeadersFilter(TestContext context) {
148148

149149
String body2 = "{ \"name\" : \"routePathTest\"}";
150150
given().headers(Headers.headers(new Header("x-foo", "A"))).body(body2).put(routedResource).then().assertThat().statusCode(200);
151-
Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> {
151+
Awaitility.given().await().atMost(Duration.TEN_SECONDS).until(() -> {
152152
given().headers(Headers.headers(new Header("x-foo", "A"))).when().get(routedResource).then().assertThat().body(containsString(body2));
153153
when().get(checkTarget).then().assertThat().body(containsString(body2));
154154
});

maybe-release.sh

+27-35
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,34 @@
11
#!/bin/bash
22
set -ev
3-
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_REPO_SLUG" == "swisspush/gateleen" ]
3+
git fetch
4+
git reset --hard
5+
groovy staging.groovy drop
6+
rc=$?
7+
if [ $rc -ne 0 ]
48
then
5-
git reset --hard
6-
git clean -fd
7-
git checkout master
8-
echo 'Master checked out'
9-
groovy staging.groovy drop
9+
echo 'problem when trying to drop, ignored'
10+
fi
11+
echo 'starting a new nexus repository ...'
12+
OUTPUT=$(groovy staging.groovy start)
13+
echo "repository Id: $OUTPUT"
14+
mvn -B -Prelease -PpublicRepos jgitflow:release-start jgitflow:release-finish -DrepositoryId=${OUTPUT}
15+
rc=$?
16+
if [ $rc -eq 0 ]
17+
then
18+
groovy staging.groovy close ${OUTPUT}
19+
groovy staging.groovy promote ${OUTPUT}
1020
rc=$?
1121
if [ $rc -ne 0 ]
1222
then
13-
echo 'problem when trying to drop, ignored'
14-
fi
15-
echo 'starting a new nexus repository ...'
16-
OUTPUT=$(groovy staging.groovy start)
17-
echo "repository Id: $OUTPUT"
18-
mvn -B -Prelease -PpublicRepos jgitflow:release-start jgitflow:release-finish --settings settings.xml -DrepositoryId=${OUTPUT}
19-
rc=$?
20-
if [ $rc -eq 0 ]
21-
then
22-
groovy staging.groovy close ${OUTPUT}
23-
groovy staging.groovy promote ${OUTPUT}
24-
rc=$?
25-
if [ $rc -ne 0 ]
26-
then
27-
echo 'Release failed, cannot promote stage'
28-
exit rc
29-
fi
30-
echo 'Release done, will push'
31-
git tag
32-
git push --tags
33-
git checkout develop
34-
git push origin develop
35-
exit 0
23+
echo 'Release failed, cannot promote stage'
24+
exit $rc
3625
fi
37-
echo 'Release failed'
38-
exit rc
39-
else
40-
echo 'Release skipped'
41-
exit 0
42-
fi
26+
echo 'Release done, will push'
27+
git tag
28+
git push --tags
29+
git checkout develop
30+
git push origin develop
31+
exit 0
32+
fi
33+
echo 'Release failed'
34+
exit $rc

pom.xml

+12-9
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@
4949
<maven.compiler.source>11</maven.compiler.source>
5050
<maven.compiler.target>11</maven.compiler.target>
5151
<targetHost>localhost</targetHost>
52-
<targetPort>8989</targetPort>
53-
<sel_chrome_driver>${session.executionRootDirectory}/gateleen-test/src/test/resources/chromedriver
54-
</sel_chrome_driver>
52+
<targetPort>7012</targetPort>
53+
<sel_chrome_driver>/usr/local/bin/chromedriver</sel_chrome_driver>
5554
<vertx.version>4.2.1</vertx.version>
5655
<vertx-redis-client.version>4.3.3</vertx-redis-client.version>
5756
<jackson.version>2.13.0</jackson.version>
@@ -232,9 +231,11 @@
232231
<goal>sign</goal>
233232
</goals>
234233
<configuration>
235-
<homedir>${session.executionRootDirectory}</homedir>
236-
<keyname>230584D7</keyname>
237-
<!--<executable>C:\Program Files (x86)\GnuPG\bin\gpg.exe</executable>-->
234+
<!-- Prevent gpg from using pinentry programs -->
235+
<gpgArguments>
236+
<arg>--pinentry-mode</arg>
237+
<arg>loopback</arg>
238+
</gpgArguments>
238239
</configuration>
239240
</execution>
240241
</executions>
@@ -560,9 +561,11 @@
560561
<goal>sign</goal>
561562
</goals>
562563
<configuration>
563-
<homedir>${session.executionRootDirectory}</homedir>
564-
<keyname>230584D7</keyname>
565-
<!--<executable>C:\Program Files (x86)\GnuPG\bin\gpg.exe</executable>-->
564+
<!-- Prevent gpg from using pinentry programs -->
565+
<gpgArguments>
566+
<arg>--pinentry-mode</arg>
567+
<arg>loopback</arg>
568+
</gpgArguments>
566569
</configuration>
567570
</execution>
568571
</executions>

settings.xml

-14
This file was deleted.

0 commit comments

Comments
 (0)