forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 12
65 lines (63 loc) · 2.24 KB
/
metadata-model.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
name: metadata model generate
on:
push:
branches:
- master
paths:
- "metadata-models/**"
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
publish: ${{ steps.publish.outputs.publish }}
steps:
- name: Check whether upload to datahub is enabled
id: publish
env:
ENABLE_PUBLISH: ${{ secrets.DataHubToken }}
run: |
echo "Enable publish: ${{ env.ENABLE_PUBLISH != '' }}"
echo "publish=${{ env.ENABLE_PUBLISH != '' }}" >> $GITHUB_OUTPUT
metadata-ingestion-docgen:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17
- uses: gradle/gradle-build-action@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: ./metadata-ingestion/scripts/install_deps.sh
- name: Run model generation
run: ./gradlew :metadata-models:build
- name: Generate metadata files
if: ${{ needs.setup.outputs.publish == 'true' }}
run: ./gradlew :metadata-ingestion:modelDocGen
- name: Configure AWS Credentials
if: ${{ needs.setup.outputs.publish == 'true' }}
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.ACRYL_CI_ARTIFACTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ACRYL_CI_ARTIFACTS_ACCESS_KEY }}
aws-region: us-west-2
- name: Upload metadata to S3
if: ${{ needs.setup.outputs.publish == 'true' }}
run: aws s3 cp ./metadata-ingestion/generated/docs/metadata_model_mces.json s3://${{ secrets.ACRYL_CI_ARTIFACTS_BUCKET }}/datahub/demo/metadata/
- name: Upload metadata to DataHub
if: ${{ needs.setup.outputs.publish == 'true' }}
env:
DATAHUB_SERVER: ${{ secrets.DataHubServer }}
DATAHUB_TOKEN: ${{ secrets.DataHubToken }}
run: ./gradlew :metadata-ingestion:modelDocUpload