-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from apriltuesday/EVA-3491
EVA-3491: Add schema for submission tables
- Loading branch information
Showing
9 changed files
with
141 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
stages: | ||
- test | ||
- package | ||
- deploy | ||
|
||
variables: | ||
WS_ARTIFACT_PATH: target/eva-submission-ws-$ENVIRONMENT_NAME.war | ||
MAVEN_SETTINGS: maven-settings.xml | ||
URL_MAVEN_SETTINGS: https://api.github.com/repos/EBIvariation/configuration/contents/eva-maven-settings.xml | ||
MEDIA_TYPE: application/vnd.github.raw | ||
|
||
test: | ||
stage: test | ||
image: maven:3.6.1-jdk-8-alpine | ||
script: | ||
- mvn test | ||
environment: | ||
name: test-env | ||
only: | ||
- master | ||
- tags | ||
|
||
# Not executed, parent job definition for package | ||
.package: | ||
stage: package | ||
image: maven:3.6.1-jdk-8-alpine | ||
environment: | ||
name: $ENVIRONMENT_NAME | ||
before_script: | ||
- DATETIME=$(date +%Y-%m-%dT%H-%M-%S) | ||
- apk add --update curl | ||
- curl -u $GITHUB_USER:$GITHUB_TOKEN -H "Accept:$MEDIA_TYPE" $URL_MAVEN_SETTINGS > $MAVEN_SETTINGS | ||
script: | ||
- mvn package --settings $MAVEN_SETTINGS -P $MAVEN_PROFILE -DskipTests | ||
- cp target/eva-submission-ws*.war.original $WS_ARTIFACT_PATH | ||
after_script: | ||
- rm $MAVEN_SETTINGS | ||
artifacts: | ||
paths: | ||
- $WS_ARTIFACT_PATH | ||
|
||
package-internal: | ||
extends: .package | ||
variables: | ||
ENVIRONMENT_NAME: internal | ||
MAVEN_PROFILE: internal | ||
only: | ||
- master | ||
|
||
package-development: | ||
extends: .package | ||
variables: | ||
ENVIRONMENT_NAME: development | ||
MAVEN_PROFILE: development | ||
only: | ||
- master | ||
|
||
package-production: | ||
extends: .package | ||
variables: | ||
ENVIRONMENT_NAME: production | ||
# Use production_processing to use production rather than public database | ||
MAVEN_PROFILE: production_processing | ||
only: | ||
- tags | ||
|
||
# Not executed, parent job definition for deployments | ||
.deploy-tomcat: | ||
stage: deploy | ||
image: alpine:3.9.5 | ||
environment: | ||
name: $ENVIRONMENT_NAME | ||
script: | ||
- DATETIME=$(date +%Y-%m-%dT%H-%M-%S) | ||
- apk add --update curl | ||
- curl -u $TOMCAT_USER:$TOMCAT_PASSWORD -T "$WS_ARTIFACT_PATH" "http://$TOMCAT_HOST/manager/text/deploy?update=true&path=/eva/webservices/submission-ws&version=$DATETIME" | grep "OK - Deployed application" | ||
|
||
deploy-tomcat-internal: | ||
extends: .deploy-tomcat | ||
variables: | ||
ENVIRONMENT_NAME: internal | ||
TOMCAT_USER: $TOMCAT_INTERNAL_USER | ||
TOMCAT_PASSWORD: $TOMCAT_INTERNAL_PASSWORD | ||
TOMCAT_HOST: $TOMCAT_INTERNAL_HOST | ||
dependencies: | ||
- package-internal | ||
only: | ||
- master | ||
|
||
deploy-tomcat-development: | ||
extends: .deploy-tomcat | ||
variables: | ||
ENVIRONMENT_NAME: development | ||
TOMCAT_USER: $TOMCAT_DEVELOPMENT_USER | ||
TOMCAT_PASSWORD: $TOMCAT_DEVELOPMENT_PASSWORD | ||
TOMCAT_HOST: $TOMCAT_DEVELOPMENT_HOST | ||
dependencies: | ||
- package-development | ||
only: | ||
- master | ||
|
||
deploy-tomcat-production: | ||
extends: .deploy-tomcat | ||
when: manual | ||
variables: | ||
ENVIRONMENT_NAME: production | ||
TOMCAT_USER: $TOMCAT_PRODUCTION_USER | ||
TOMCAT_PASSWORD: $TOMCAT_PRODUCTION_PASSWORD | ||
TOMCAT_HOST: $TOMCAT_PRODUCTION_HOST | ||
dependencies: | ||
- package-production | ||
only: | ||
- tags | ||
|
||
deploy-tomcat-production-fallback: | ||
extends: .deploy-tomcat | ||
when: manual | ||
variables: | ||
ENVIRONMENT_NAME: production | ||
TOMCAT_USER: $TOMCAT_PRODUCTION_FALLBACK_USER | ||
TOMCAT_PASSWORD: $TOMCAT_PRODUCTION_FALLBACK_PASSWORD | ||
TOMCAT_HOST: $TOMCAT_PRODUCTION_FALLBACK_HOST | ||
dependencies: | ||
- package-production | ||
only: | ||
- tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE SCHEMA IF NOT EXISTS eva_submissions; |