Skip to content

Commit

Permalink
generate fluent module
Browse files Browse the repository at this point in the history
Signed-off-by: yue9944882 <291271447@qq.com>
  • Loading branch information
yue9944882 committed Apr 6, 2022
1 parent d481e1b commit b6459e9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ on:


jobs:
release:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout Java
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 8.0.x
- name: Checkout Gen
uses: actions/checkout@v3
with:
Expand All @@ -25,26 +30,42 @@ jobs:
run: |
SUFFIX=$(openssl rand -hex 4)
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV
- name: Generate
- name: Get Project Version
run: |
echo "PROJECT_VERSION=$(mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${project.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)" >> $GITHUB_ENV
- name: Generate Openapi
run: |
cd gen/openapi
pushd gen/openapi
cat <<"EOF"> settings
# Kubernetes branch to get the OpenAPI spec from.
export KUBERNETES_BRANCH="${{ github.event.inputs.kubernetesBranch }}"
# client version for packaging and releasing. It can
# be different than SPEC_VERSION.
export CLIENT_VERSION=$(mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${project.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)
export CLIENT_VERSION=${{ env.PROJECT_VERSION }}
# Name of the release package
export PACKAGE_NAME="io.kubernetes.client.openapi"
EOF
bash java.sh ../../kubernetes/ settings
cd ../../
popd
rm -rf gen
- name: Generate Fluent
run: |
pushd fluent-gen
bash -x generate.sh
popd
- name: Formatter
run: |
mvn spotless:apply
- name: Commit and push
run: |
# Commit and push
git config user.email "k8s.ci.robot@gmail.com"
git config user.name "Kubernetes Prow Robot"
git checkout -b "$BRANCH"
Expand Down
16 changes: 1 addition & 15 deletions fluent-gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,9 @@
Start from a totally clean environment (eg. a clean VM if you can), clone everything.

## Step one
Comment out the existing fluent module from the pom.xml

```xml
...
<!--
<module>fluent</module>
<module>spring</module>
<module>e2e</module>
<module>examples</module>
-->
...
```
`mvn -Pfluent-gen install`

## Step two
`mvn install`

## Step three
```
cd fluent-gen; ./generate.sh
```
Expand Down
3 changes: 1 addition & 2 deletions fluent-gen/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
# TODO: Incorporate this into the pom.xml

rm -r ../fluent/src/main/java/io
mvn clean
mvn compile
mvn -Pfluent-gen clean compile
mv target/generated-sources/annotations/io ../fluent/src/main/java/io

0 comments on commit b6459e9

Please sign in to comment.