Skip to content

Commit

Permalink
GCR images for integration tests (#251)
Browse files Browse the repository at this point in the history
* GCR images for integration tests

* fix spring boot env

* correct typo

* Fix correct github action file

* remove wait for plugin as its not really needed

* auto patch increment

* reintroduce fabric8 plugin

* upgrade fabric 8 plugin

* revert use of fabric8 plugin, it doesn't work

* trigger GitHub actions

* Latest version of docker plugin

* trigger GitHub actions

* missing mvn fmt:check

Co-authored-by: ras-rm-pr-bot <[email protected]>
  • Loading branch information
warrenbailey and ras-rm-pr-bot authored May 18, 2021
1 parent 4df5863 commit 00e3c1c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 97 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Run Tests
run: |
mvn fmt:check
mvn clean verify
- uses: google-github-actions/setup-gcloud@master
- name: gcloud setup
uses: google-github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCR_KEY }}
# Configure docker to use the gcloud command-line tool as a credential helper
- run: |
- name: Configure GCR
run: |
gcloud auth configure-docker
- name: Run Tests
run: |
export LD_LIBRARY_PATH=/usr/local/lib
mvn fmt:check
mvn clean verify
- name: pr docker tag
if: github.ref != 'refs/heads/main'
id: tag
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Run Tests
run: |
mvn fmt:check
mvn clean verify
- uses: google-github-actions/setup-gcloud@master
- name: gcloud setup
uses: google-github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCR_KEY }}
# Configure docker to use the gcloud command-line tool as a credential helper
- run: |
- name: Configure GCR
run: |
gcloud auth configure-docker
- name: Run Tests
run: |
export LD_LIBRARY_PATH=/usr/local/lib
mvn clean verify
- name: pr docker tag
if: github.ref != 'refs/heads/main'
id: tag
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
- "46672:15672"
survey:
container_name: survey-it
image: sdcplatform/surveysvc
image: eu.gcr.io/ons-rasrmbs-management/survey
ports:
- "18080:8080"
external_links:
Expand All @@ -33,7 +33,7 @@ services:
- security_user_password=secret
action:
container_name: action-it
image: sdcplatform/actionsvc
image: eu.gcr.io/ons-rasrmbs-management/action
ports:
- "38151:8151"
external_links:
Expand All @@ -44,9 +44,9 @@ services:
- spring_datasource_url=jdbc:postgresql://postgres-it:5432/postgres?sslmode=disable
- spring_datasource_username=postgres
- spring_datasource_password=postgres
- liquibase_url=jdbc:postgresql://postgres-it:5432/postgres?sslmode=disable
- liquibase_user=postgres
- liquibase_password=postgres
- spring_liquibase_url=jdbc:postgresql://postgres-it:5432/postgres?sslmode=disable
- spring_liquibase_user=postgres
- spring_liquibase_password=postgres
- security_user_name=admin
- security_user_password=secret
- data_grid_address=redis-it:6379
Expand Down
95 changes: 15 additions & 80 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -407,25 +407,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.4</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
<phase>package</phase>
<configuration>
<repository>sdcplatform/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
Expand All @@ -439,58 +420,39 @@
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.23.0</version>
<groupId>com.dkanejs.maven.plugins</groupId>
<artifactId>docker-compose-maven-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>pre-stop</id>
<phase>pre-integration-test</phase>
<goals>
<goal>stop</goal>
<goal>down</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<images>
<image>
<external>
<type>compose</type>
<basedir>${project.basedir}</basedir>
</external>
</image>
</images>
<composeFile>${project.basedir}/docker-compose.yml</composeFile>
</configuration>
</execution>
<execution>
<id>start</id>
<id>up</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>up</goal>
</goals>
<configuration>
<showLogs>false</showLogs>
<images>
<image>
<external>
<type>compose</type>
<basedir>${project.basedir}</basedir>
</external>
</image>
</images>
<composeFile>${project.basedir}/docker-compose.yml</composeFile>
<detachedMode>true</detachedMode>
</configuration>
</execution>
<execution>
<id>stop</id>
<id>down</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
<goal>down</goal>
</goals>
<configuration>
<images>
<image>
<external>
<type>compose</type>
<basedir>${project.basedir}</basedir>
</external>
</image>
</images>
<composeFile>${project.basedir}/docker-compose.yml</composeFile>
</configuration>
</execution>
</executions>
Expand All @@ -509,33 +471,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>se.thinkcode.wait</groupId>
<artifactId>http</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<id>wait-for-action</id>
<goals>
<goal>wait</goal>
</goals>
<configuration>
<url>http://localhost:38151/info</url>
<timeout>60000</timeout>
</configuration>
</execution>
<execution>
<id>wait-for-survey</id>
<goals>
<goal>wait</goal>
</goals>
<configuration>
<url>http://localhost:18080/info</url>
<timeout>60000</timeout>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
Expand Down

0 comments on commit 00e3c1c

Please sign in to comment.