Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit b071f51

Browse files
authored
Merge all SQL repos and adjust workflows (#549)
* merge all sql repos * fix test and build workflows * fix workbench and odbc path * fix workbench and odbc path * restructure workbench dir and fix workflows * fix workbench workflow * fix workbench workflow * fix workbench workflow * fix workbench workflow * fix workbench workflow * revert workbench directory structure * fix workbench workflow * fix workbench workflow * fix workbench workflow * fix workbench workflow * update workbench workflow for release * Delete .github/ in sql-workbench directory * Add cypress to sql-workbench * Sync latest ODBC commits * Sync latest workbench commits (will add cypress in separate PR) * Add ignored ODBC libs
1 parent 785f623 commit b071f51

File tree

635 files changed

+135737
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

635 files changed

+135737
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release SQL CLI Artifacts
2+
# This workflows is triggered on creating tags to master
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
11+
runs-on: [ubuntu-16.04]
12+
defaults:
13+
run:
14+
working-directory: sql-cli
15+
strategy:
16+
matrix:
17+
python-version: [3.8]
18+
19+
steps:
20+
- name: Checkout SQL CLI
21+
uses: actions/checkout@v2
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Configure AWS Credentials
29+
uses: aws-actions/configure-aws-credentials@v1
30+
with:
31+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
32+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
33+
aws-region: us-east-1
34+
35+
- name: Install Dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install setuptools wheel twine
39+
# publish to S3 and PyPI
40+
- name: Build and Publish
41+
run: |
42+
python setup.py sdist bdist_wheel
43+
artifact=`ls ./dist/*.tar.gz`
44+
wheel_artifact=`ls ./dist/*.whl`
45+
46+
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-clients/opendistro-sql-cli/
47+
aws s3 cp $wheel_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-clients/opendistro-sql-cli/
48+
49+
# aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*"
50+
51+
# TODO: Publish to PyPI
52+
# env:
53+
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
54+
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
55+
# run: twine upload dist/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: SQL CLI Test and Build
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: [ubuntu-16.04]
9+
defaults:
10+
run:
11+
working-directory: sql-cli
12+
strategy:
13+
matrix:
14+
python-version: [3.8]
15+
16+
steps:
17+
- name: Checkout SQL CLI
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install Python Dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements-dev.txt
29+
pip install setuptools wheel
30+
31+
- name: Set up ES and install SQL plugin
32+
run: |
33+
sudo add-apt-repository ppa:openjdk-r/ppa
34+
sudo apt update
35+
sudo apt install openjdk-11-jdk
36+
sudo apt install unzip
37+
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.6.1-amd64.deb
38+
sudo dpkg -i elasticsearch-oss-7.6.1-amd64.deb
39+
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-sql/opendistro_sql-1.6.0.0.zip
40+
sudo systemctl start elasticsearch.service
41+
42+
- name: Run Tox Testing
43+
run: tox
44+
45+
- name: Stop ES
46+
run: sudo systemctl stop elasticsearch.service
47+
48+
- name: Build Artifact
49+
run: python setup.py sdist bdist_wheel
50+
51+
- name: Create Artifact Path
52+
run: |
53+
mkdir -p opendistro-sql-cli-builds
54+
cp -r ./dist/*.tar.gz ./dist/*.whl opendistro-sql-cli-builds/
55+
56+
- name: Upload Artifact
57+
uses: actions/upload-artifact@v2
58+
with:
59+
name: opendistro-sql-cli
60+
path: sql-cli/opendistro-sql-cli-builds
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Upload sql-jdbc Jar to Maven
2+
3+
# This workflow will upload the sql-jdbc jar to maven when a new tag is cut
4+
on:
5+
push:
6+
tags:
7+
- v*
8+
9+
jobs:
10+
upload-jdbc-jar:
11+
runs-on: [ubuntu-16.04]
12+
defaults:
13+
run:
14+
working-directory: sql-jdbc
15+
name: Upload Jar to Maven
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v2
19+
20+
- name: Configure AWS CLI
21+
uses: aws-actions/configure-aws-credentials@v1
22+
with:
23+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
24+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
25+
aws-region: us-east-1
26+
27+
# Since release workflow uses java 10
28+
- name: Setup Java
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: '10'
32+
33+
- name: Upload jdbc Jar to Maven
34+
env:
35+
passphrase: ${{ secrets.PASSPHRASE }}
36+
run: |
37+
cd ..
38+
export JAVA10_HOME=$JAVA_HOME
39+
aws s3 cp s3://opendistro-docs/github-actions/pgp-public-key .
40+
aws s3 cp s3://opendistro-docs/github-actions/pgp-private-key .
41+
42+
gpg --import pgp-public-key
43+
gpg --allow-secret-key-import --import pgp-private-key
44+
45+
46+
mkdir /home/runner/.gradle
47+
aws s3 cp s3://opendistro-docs/github-actions/gradle.properties /home/runner/.gradle/
48+
cd sql-jdbc
49+
./gradlew publishShadowPublicationToSonatype-stagingRepository -Dcompiler.java=10 -Dbuild.snapshot=false -Djavax.net.ssl.trustStore=$JAVA_HOME/lib/security/cacerts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Release SQL-JDBC
2+
# This workflow is triggered on creating tags to master or an opendistro release branch
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
Release-SQL-JDBC:
10+
strategy:
11+
matrix:
12+
java: [10]
13+
14+
name: Build and Release SQL Plugin
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
working-directory: sql-jdbc
19+
20+
steps:
21+
- name: Checkout SQL-JDBC
22+
uses: actions/checkout@v1
23+
24+
- name: Configure AWS Credentials
25+
uses: aws-actions/configure-aws-credentials@v1
26+
with:
27+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
28+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
29+
aws-region: us-east-1
30+
31+
- name: Setup Java ${{ matrix.java }}
32+
uses: actions/setup-java@v1
33+
with:
34+
java-version: ${{ matrix.java }}
35+
36+
- name: Run build
37+
run: |
38+
./gradlew publishShadowPublicationToInternal-releasesRepository '-Dorg.gradle.jvmargs=--add-modules java.xml.bind' -Dbuild.snapshot=false
39+
artifact=`ls -1t build/libs/*.jar | grep -v "SNAPSHOT.jar" | grep -v "sources.jar" | head -1`
40+
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-clients/opendistro-sql-jdbc/
41+
aws cloudfront create-invalidation --distribution-id E2S86LO5GZAJQM --paths "/downloads/*"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: SQL JDBC Java CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
defaults:
10+
run:
11+
working-directory: sql-jdbc
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
- name: Set up JDK 1.13
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.13
20+
21+
- name: Build with Gradle
22+
run: ./gradlew build
23+
24+
- name: Create Artifact Path
25+
run: |
26+
mkdir -p sql-jdbc-builds
27+
cp ./build/libs/*.jar sql-jdbc-builds
28+
29+
- name: Upload Artifacts
30+
uses: actions/upload-artifact@v1
31+
with:
32+
name: sql-jdbc
33+
path: sql-jdbc/sql-jdbc-builds

0 commit comments

Comments
 (0)