-
Notifications
You must be signed in to change notification settings - Fork 246
99 lines (89 loc) · 4.11 KB
/
build-accumulo.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build Accumulo snapshot and update DataWave to use
on:
workflow_dispatch:
inputs:
accumuloBranch:
required: true
default: "2.1"
description: "Branch name to build. Will be used as image tag."
accumuloRepo:
required: true
default: "apache/accumulo"
description: "Accumulo Repo to use. Expected to be at Github. Example: apache/accumulo"
deployAccumulo:
required: true
default: "false"
description: "Set to false if this accumulo version has already been pushed to Github Packages"
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository.lowercase }}
ACCUMULO_JAVA_VERSION: '17'
DATAWAVE_JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'zulu' #This is the default on v1 of the action for 1.8
USER_NAME: ${{ secrets.GHCR_WRITE_USER_NAME }}
ACCESS_TOKEN: ${{ secrets.GHCR_WRITE_ACCESS_TOKEN }}
jobs:
build-and-deploy-accumulo:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
#
steps:
- name: Checkout DataWave
uses: actions/checkout@v4
with:
path: datawave
- name: Checkout Accumulo
uses: actions/checkout@v4
id: accumuloCheckout
with:
repository: ${{ github.event.inputs.accumuloRepo }}
path: accumulo
ref: ${{ github.event.inputs.accumuloBranch }}
- name: Set up JDK ${{env.ACCUMULO_JAVA_VERSION}}
uses: actions/setup-java@v4
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.ACCUMULO_JAVA_VERSION}}
cache: 'maven'
- run: echo "ACCUMULO_JAVA=$JAVA_HOME" >> $GITHUB_ENV
- name: Set up JDK ${{env.DATAWAVE_JAVA_VERSION}}
uses: actions/setup-java@v4
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.DATAWAVE_JAVA_VERSION}}
cache: 'maven'
- run: echo "DATAWAVE_JAVA=$JAVA_HOME" >> $GITHUB_ENV
- name: Get Accumulo Version
id: get-accumulo-version
run: |
export JAVA_HOME="$ACCUMULO_JAVA"
cd "$GITHUB_WORKSPACE/accumulo"
mvn build-helper:parse-version versions:set -DgenerateBackupPoms=false -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion}-dwv-$(git rev-parse --short HEAD)
export newVersion=$(mvn -q help:evaluate -DforceStdout -Dexpression=project.version)
echo accumuloVersion=$newVersion >> $GITHUB_OUTPUT
- name: Deploy Accumulo
if: ${{ github.event.inputs.deployAccumulo }}
run: |
export JAVA_HOME="$ACCUMULO_JAVA"
cd "$GITHUB_WORKSPACE/accumulo"
mvn -DaltDeploymentRepository=github-datawave::https://maven.pkg.github.com/NationalSecurityAgency/datawave -V -B -e -ntp "-Dstyle.color=always" -DskipTests -T1C clean source:jar deploy -s "$GITHUB_WORKSPACE/datawave/.github/workflows/settings.xml"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USER_NAME }}
password: ${{ env.ACCESS_TOKEN }}
- name: Update DataWave Dependency Version
run: |
export JAVA_HOME="$DATAWAVE_JAVA"
cd "$GITHUB_WORKSPACE/datawave"
mvn -s "$GITHUB_WORKSPACE/datawave/.github/workflows/settings.xml" versions:set-property -Dproperty=version.accumulo -DnewVersion=${{ steps.get-accumulo-version.outputs.accumuloVersion }} -DgenerateBackupPoms=false
- name: Build Web and Ingest Docker Images (Maven)
run: |
export JAVA_HOME="$DATAWAVE_JAVA"
cd "$GITHUB_WORKSPACE/datawave"
mvn -s "$GITHUB_WORKSPACE/datawave/.github/workflows/settings.xml" clean install -Prpm,kubernetes,assemble,deploy-ws -Ddist -Pdocker -DpushImage -Ddocker-release -DskipTests -Ddocker.image.accumulo.tag=${{ steps.get-accumulo-version.outputs.accumuloVersion }}