|
1 | | -name: Java CI - main |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: |
4 | 5 | push: |
5 | | - branches: |
6 | | - - main |
7 | 6 | paths-ignore: |
8 | 7 | - '.github/**' |
9 | | - pull_request: |
10 | | - branches: |
11 | | - - main |
12 | 8 |
|
13 | 9 | jobs: |
14 | 10 | build: |
15 | | - |
16 | | - runs-on: ${{ matrix.os }} |
17 | | - strategy: |
18 | | - matrix: |
19 | | - os: [ubuntu-latest] |
20 | | - |
| 11 | + runs-on: ubuntu-latest |
21 | 12 | steps: |
22 | 13 | - uses: actions/checkout@v2 |
23 | | - - name: Cache maven repository |
24 | | - uses: actions/cache@v1 |
| 14 | + # cache maven repo |
| 15 | + - uses: actions/cache@v1 |
25 | 16 | with: |
26 | 17 | path: .m2 |
27 | 18 | key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
28 | 19 | restore-keys: | |
29 | 20 | ${{ runner.os }}-m2- |
30 | | - - name: Set up JDK 1.8 |
31 | | - uses: actions/setup-java@v1 |
| 21 | + # jdk8 |
| 22 | + - uses: actions/setup-java@v1 |
32 | 23 | with: |
33 | 24 | java-version: 1.8 |
34 | | - - name: Build with Maven |
35 | | - run: mvn "-Dmaven.repo.local=.m2" -U -B install |
| 25 | + # maven version |
| 26 | + - uses: jvalkeal/setup-maven@v1 |
| 27 | + with: |
| 28 | + maven-version: 3.6.2 |
| 29 | + # jfrog cli |
| 30 | + - uses: jfrog/setup-jfrog-cli@v1 |
| 31 | + with: |
| 32 | + version: 1.46.4 |
| 33 | + env: |
| 34 | + JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} |
| 35 | + # setup frog cli |
| 36 | + - name: Configure JFrog Cli |
| 37 | + run: | |
| 38 | + jfrog rt mvnc \ |
| 39 | + --server-id-resolve=repo.spring.io \ |
| 40 | + --server-id-deploy=repo.spring.io \ |
| 41 | + --repo-resolve-releases=libs-release \ |
| 42 | + --repo-resolve-snapshots=libs-snapshot \ |
| 43 | + --repo-deploy-releases=release \ |
| 44 | + --repo-deploy-snapshots=snapshot |
| 45 | + echo JFROG_CLI_BUILD_NAME=spring-cloud-dataflow-main >> $GITHUB_ENV |
| 46 | + echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV |
| 47 | + echo spring_cloud_dataflow_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV |
| 48 | + # build and publish |
| 49 | + - name: Build and Publish |
| 50 | + run: | |
| 51 | + jfrog rt mvn "-Dmaven.repo.local=.m2" -U -B clean install |
| 52 | + jfrog rt build-publish |
| 53 | +
|
| 54 | + # build images to local repo to get pushed |
| 55 | + - name: Build Images |
| 56 | + env: |
| 57 | + TAG: ${{ env.spring_cloud_dataflow_version }} |
| 58 | + run: | |
| 59 | + pack build \ |
| 60 | + --path spring-cloud-dataflow-server/target/spring-cloud-dataflow-server-$TAG.jar \ |
| 61 | + --builder gcr.io/paketo-buildpacks/builder:0.1.99-base \ |
| 62 | + --env BP_JVM_VERSION=8 springcloud/spring-cloud-dataflow-server:$TAG |
| 63 | + pack build \ |
| 64 | + --path spring-cloud-dataflow-composed-task-runner/target/spring-cloud-dataflow-composed-task-runner-$TAG.jar \ |
| 65 | + --builder gcr.io/paketo-buildpacks/builder:0.1.99-base \ |
| 66 | + --env BP_JVM_VERSION=8 springcloud/spring-cloud-dataflow-composed-task-runner:$TAG |
| 67 | +
|
| 68 | + # docker hub login |
| 69 | + - uses: docker/login-action@v1 |
| 70 | + with: |
| 71 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 72 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 73 | + |
| 74 | + # push images |
| 75 | + - name: Push image |
| 76 | + env: |
| 77 | + TAG: ${{ env.spring_cloud_dataflow_version }} |
| 78 | + run: | |
| 79 | + docker push springcloud/spring-cloud-dataflow-server:$TAG |
| 80 | + docker push springcloud/spring-cloud-dataflow-composed-task-runner:$TAG |
| 81 | +
|
| 82 | + # build/publish support images |
| 83 | + - name: Publish Grafana Prometheus |
| 84 | + uses: docker/build-push-action@v2 |
| 85 | + with: |
| 86 | + context: src/grafana/prometheus/docker/grafana |
| 87 | + push: true |
| 88 | + tags: springcloud/spring-cloud-dataflow-grafana-prometheus:${{ env.spring_cloud_dataflow_version }} |
| 89 | + - name: Publish Grafana InfluxDB |
| 90 | + uses: docker/build-push-action@v2 |
| 91 | + with: |
| 92 | + context: src/grafana/influxdb/docker/grafana |
| 93 | + push: true |
| 94 | + tags: springcloud/spring-cloud-dataflow-grafana-influxdb:${{ env.spring_cloud_dataflow_version }} |
| 95 | + - name: Publish Prometheus Local |
| 96 | + uses: docker/build-push-action@v2 |
| 97 | + with: |
| 98 | + context: src/grafana/prometheus/docker/prometheus-local |
| 99 | + push: true |
| 100 | + tags: springcloud/spring-cloud-dataflow-prometheus-local:${{ env.spring_cloud_dataflow_version }} |
0 commit comments