Skip to content

Commit

Permalink
Copy vald-client-java (#297)
Browse files Browse the repository at this point in the history
* fix: copy from vald-client-java

Signed-off-by: hlts2 <[email protected]>

* fix: disable cron

Signed-off-by: hlts2 <[email protected]>

---------

Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 authored May 21, 2024
1 parent 015242b commit bcb36a9
Show file tree
Hide file tree
Showing 139 changed files with 95,257 additions and 3,898 deletions.
15 changes: 15 additions & 0 deletions .fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli)
# Visit https://fossa.com to learn more

version: 2
cli:
server: https://app.fossa.com
fetcher: custom
project: vald-client-java
locator: git+github.com/vdaas/vald-client-java
analyze:
modules:
- name: .
type: gradle
target: ':'
path: .
16 changes: 16 additions & 0 deletions .github/dependabot-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
job:
package-manager: gradle
allowed-updates:
- update-type: all
ignore-conditions:
- dependency-name: com.google.protobuf:protobuf-java
version-requirement: ">=3.25.1"
dependency-groups:
- name: gradle
rules:
patterns:
- "*"
source:
directory: /
provider: github
repo: vdaas/vald-client-java
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
- uses: actions/checkout@v3
- uses: vdaas/vald-client-ci/.github/actions/e2e@main
with:
client_type: clj
client_type: java
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# DO NOT EDIT
name: "Run release"
name: "Run automatically merge bot PR"
on:
push:
tags:
- '*.*.*'
- 'v*.*.*'
- '*.*.*-*'
- 'v*.*.*-*'
pull_request:

jobs:
release:
# TODO: change to the following before main merge.
# uses: vdaas/vald-client-ci/.github/workflows/release.yaml@main
uses: vdaas/vald-client-ci/.github/workflows/release.yaml@fix/release-action
auto-merge:
uses: vdaas/vald-client-ci/.github/workflows/_pr-auto-merge.yaml@main
with:
client_type: clj
secrets: inherit
client_type: java
secrets:
CI_TOKEN: ${{ secrets.CI_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ name: "Sync Vald"
on:
workflow_dispatch:
# schedule:
# - cron: "*/5 * * * *"
# - cron: "*/10 * * * *"
jobs:
sync:
uses: vdaas/vald-client-ci/.github/workflows/sync.yaml@main
with:
client_type: clj
client_type: java
secrets:
CI_USER: ${{ secrets.DISPATCH_USER }}
CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
CI_USER: ${{ secrets.CI_USER }}
CI_TOKEN: ${{ secrets.CI_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
30 changes: 30 additions & 0 deletions .github/workflows/update-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Update Gradle dependencies

on:
workflow_dispatch:
# schedule:
# - cron: "0 12 * * *"
jobs:
update:
uses: vdaas/vald-client-ci/.github/workflows/_update-deps.yaml@main
with:
config_file_path: .github/dependabot-cli.yaml
secrets:
CI_USER: ${{ secrets.CI_USER }}
CI_TOKEN: ${{ secrets.CI_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
89 changes: 89 additions & 0 deletions .github/workflows/update-gradle-wrapper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Update Gradle Wrapper

on:
workflow_dispatch:
# schedule:
# - cron: "0 0 * * *"

jobs:
update:
runs-on: ubuntu-latest
env:
GRADLE_VERSION_URL: "https://services.gradle.org/versions/current"
GRADLE_CHECKSUM_URL_PREFIX: "https://services.gradle.org/distributions/gradle"
GRADLE_CHECKSUM_URL_SUFFIX: "bin.zip.sha256"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CI_TOKEN }}
- name: Set Git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- uses: vdaas/vald-client-ci/.github/actions/setup-language@main
with:
client_type: java
- name: Get latest Gradle version and checksum
id: gradle_info
run: |
LATEST_VERSION=$(curl -fsSL "${GRADLE_VERSION_URL}" | jq -r '.version')
CHECKSUM=$(curl -fsSL "${GRADLE_CHECKSUM_URL_PREFIX}-${LATEST_VERSION}-${GRADLE_CHECKSUM_URL_SUFFIX}" | awk '{print $1}')
WRAPPER_ARGS="--gradle-version ${LATEST_VERSION} --distribution-type bin --gradle-distribution-sha256-sum ${CHECKSUM}"
VERSION=$(make version/gradle)
echo "NEED_UPDATE=$([ "${VERSION}" = "${LATEST_VERSION}" ] && echo false || echo true)" | tee -a $GITHUB_OUTPUT
echo "LATEST_VERSION=${LATEST_VERSION}" | tee -a $GITHUB_OUTPUT
echo "CHECKSUM=${CHECKSUM}" | tee -a $GITHUB_OUTPUT
echo "WRAPPER_ARGS=${WRAPPER_ARGS}" | tee -a $GITHUB_OUTPUT
- name: Update Gradle Wrapper
if: ${{ steps.gradle_info.outputs.NEED_UPDATE == 'true' }}
run: |
# The first run changes the properfies settings and the second run updates the jar, ..etc.
./gradlew wrapper ${WRAPPER_ARGS} && ./gradlew wrapper ${WRAPPER_ARGS}
echo "${LATEST_VERSION}" > ./version/GRADLE_VERSION
env:
LATEST_VERSION: ${{ steps.gradle_info.outputs.LATEST_VERSION }}
WRAPPER_ARGS: ${{ steps.gradle_info.outputs.WRAPPER_ARGS }}
- uses: gradle/wrapper-validation-action@v3
- name: Check difference
id: check_diff
run: |
if git diff --quiet --exit-code; then
echo "Nothing updated"
else
git diff && git status
echo "HAS_GIT_DIFF=true" >> $GITHUB_OUTPUT
fi
- name: Create PR
if: ${{ steps.check_diff.outputs.HAS_GIT_DIFF == 'true' }}
uses: peter-evans/create-pull-request@v6
with:
author: "${{ secrets.CI_USER }} <[email protected]>"
token: ${{ secrets.CI_TOKEN }}
committer: "${{ secrets.CI_USER }} <[email protected]>"
signoff: true
delete-branch: true
base: main
title: "Bump Gradle Wrapper to ${{ steps.gradle_info.outputs.LATEST_VERSION }}"
body: "Automated pull request to update Gradle Wrapper."
28 changes: 15 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
/target
/classes
/checkouts
profiles.clj
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.hgignore
.hg/
/valdcli
/vald
lein
/vald-origin

# gogoproto
src/main/java/com/google/protobuf/GoGoProtos.java

wordvecs1000.json

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

.classpath
.project
.settings
bin
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

Loading

0 comments on commit bcb36a9

Please sign in to comment.