-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the new "ready-database" to run the integration tests from github actions. Updates versioning in build.gradle, calendar versioning, but also supporting tag based so we have some control. Added an additional Annotation that uses the full schema version (versions, it's a list) to decided if a test should run.
- Loading branch information
1 parent
8a0417c
commit 8e2a304
Showing
24 changed files
with
260 additions
and
131 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,10 +1,9 @@ | ||
--- | ||
name: Build CWMS Data API | ||
name: Build And Test CWMS Data API | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- 'release/**' | ||
pull_request: | ||
branches: | ||
- develop | ||
|
@@ -27,6 +26,8 @@ jobs: | |
- name: build and test | ||
id: thebuild | ||
run: ./gradlew build --info --init-script init.gradle | ||
- name: integration tests | ||
run: ./gradlew integrationtest --info --init-script init.gradle | ||
- name: Upload WAR | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -36,55 +37,3 @@ jobs: | |
if-no-files-found: error | ||
- name: Build docker image | ||
run: docker build -t cda:build-latest . | ||
|
||
release: | ||
if: github.event_name == 'push' && startsWith(github.ref,'refs/heads/release') | ||
name: Create and push releases | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/[email protected] | ||
- name: setup java | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: '8' | ||
cache: 'gradle' | ||
- name: Download all workflow run artifacts from build | ||
id: artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ./ | ||
- name: get version | ||
id: get_version | ||
run: .github/workflows/get_version.sh | ||
- name: show version | ||
run: echo ${VERSION} | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/[email protected] | ||
with: | ||
files: warfile/${{ needs.build.outputs.thewar}} | ||
tag_name: ${{env.VERSION}} | ||
generate_release_notes: true | ||
- name: Login to Alt Registry | ||
uses: docker/[email protected] | ||
id: login-alt | ||
with: | ||
registry: ${{ secrets.ALT_REGISTRY }} | ||
username: ${{ secrets.ALT_REG_USER }} | ||
password: ${{ secrets.ALT_REG_PASSWORD }} | ||
- name: Build docker image | ||
env: | ||
IMAGE_TAG: ${{env.VERSION}} | ||
ALT_REGISTRY: ${{secrets.ALT_REGISTRY}} | ||
run: | | ||
docker build -t cda:build-latest . | ||
docker tag cda:build-latest $ALT_REGISTRY/cwms/data-api:$IMAGE_TAG | ||
docker tag cda:build-latest $ALT_REGISTRY/cwms/data-api:latest | ||
docker push $ALT_REGISTRY/cwms/data-api:$IMAGE_TAG | ||
docker push $ALT_REGISTRY/cwms/data-api:latest | ||
- name: Logout of ALT registry | ||
if: ${{ always() }} | ||
run: docker logout ${{ steps.login-alt.outputs.registry }} |
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,75 @@ | ||
--- | ||
name: Release images and war | ||
on: | ||
workflow_run: | ||
workflows: ["Build And Test CWMS Data API"] | ||
branches: ["develop"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
release: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
name: Create and push releases | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/[email protected] | ||
- name: setup java | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: '8' | ||
cache: 'gradle' | ||
- name: Download all workflow run artifacts from build | ||
id: artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ./ | ||
- name: get version | ||
id: get_version | ||
run: .github/workflows/get_version.sh | ||
- name: show version | ||
run: echo ${VERSION} | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/[email protected] | ||
with: | ||
files: warfile/${{ needs.build.outputs.thewar}} | ||
tag_name: ${{env.VERSION}} | ||
generate_release_notes: true | ||
- name: Login to Alt Registry | ||
uses: docker/[email protected] | ||
id: login-alt | ||
with: | ||
registry: ${{ secrets.ALT_REGISTRY }} | ||
username: ${{ secrets.ALT_REG_USER }} | ||
password: ${{ secrets.ALT_REG_PASSWORD }} | ||
- name: Login to Alt Public Registry | ||
uses: docker/[email protected] | ||
id: login-alt2 | ||
with: | ||
registry: ${{ secrets.HEC_PUB_REGISTRY }} | ||
username: ${{ secrets.ALT_REG_USER }} | ||
password: ${{ secrets.ALT_REG_PASSWORD }} | ||
- name: Build docker image | ||
env: | ||
IMAGE_TAG: ${{env.VERSION}} | ||
ALT_REGISTRY: ${{secrets.ALT_REGISTRY}} | ||
HEC_PUB_REGISTRY: ${{secrets.HEC_PUB_REGISTRY}} | ||
run: | | ||
docker build -t cda:build-latest . | ||
docker tag cda:build-latest $ALT_REGISTRY/cwms/data-api:$IMAGE_TAG | ||
docker tag cda:build-latest $ALT_REGISTRY/cwms/data-api:latest | ||
docker tag cda:build-latest $HEC_PUB_REGISTRY/cwms/data-api:$IMAGE_TAG | ||
docker tag cda:build-latest $HEC_PUB_REGISTRY/cwms/data-api:latest | ||
docker push $ALT_REGISTRY/cwms/data-api:$IMAGE_TAG | ||
docker push $ALT_REGISTRY/cwms/data-api:latest | ||
docker push $HEC_PUB_REGISTRY/cwms/data-api:$IMAGE_TAG | ||
docker push $HEC_PUB_REGISTRY/cwms/data-api:latest | ||
- name: Logout of ALT registry | ||
if: ${{ always() }} | ||
run: | | ||
docker logout ${{ steps.login-alt.outputs.registry }} | ||
docker logout ${{ steps.login-alt2.outputs.registry }} |
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 |
---|---|---|
|
@@ -9,4 +9,5 @@ gradle.properties | |
.idea | ||
kdata | ||
pki/certs | ||
compose.env | ||
compose.env | ||
.vscode |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,26 @@ | ||
buildscript { | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
plugins { | ||
id 'base' | ||
id 'eclipse' | ||
id 'idea' | ||
id "com.palantir.git-version" version "3.1.0" | ||
} | ||
|
||
def static versionLabel(gitInfo) { | ||
def branch = gitInfo.branchName // all branches are snapshots, only tags get released | ||
def tag = gitInfo.lastTag | ||
// tag is returned as is. Branch may need cleanup | ||
// our primary versioning is branch+date, the tag will be used for the final "release" | ||
return branch == null ? tag : new Date().format("yyyy.MM.dd-") + branch.replace("/", "-") | ||
} | ||
|
||
allprojects { | ||
apply plugin: 'cda.java-conventions' | ||
group = 'mil.army.usace.hec.cwms' | ||
version = '3.1.6-SNAPSHOT' // ApiServlet.VERSION should be updated to match MAJOR.MINOR changes. | ||
version = versionLabel(versionDetails()) | ||
} |
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
Oops, something went wrong.