mirror of
https://codeberg.org/gitnex/tea4j-autodeploy
synced 2026-05-31 07:01:55 +00:00
Use cron to sync (#4)
@6543 @mmarif Somebody of you should enable a cron task called `sync` for the repo in Woodpecker. @opyale This makes your own server restarting builds useless. Thanks for probiding it! Co-authored-by: qwerty287 <ndev@web.de> Reviewed-on: https://codeberg.org/gitnex/tea4j-autodeploy/pulls/4 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org> Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
+17
-1
@@ -11,6 +11,9 @@ pipeline:
|
||||
commands:
|
||||
- curl -L https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.33/swagger-codegen-cli-3.0.33.jar > swagger-codegen-cli.jar
|
||||
- curl -L https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar > google-java-format.jar
|
||||
when:
|
||||
event: [ push, pull_request, tag, cron ]
|
||||
cron: sync
|
||||
|
||||
# Generate code and docs from official swagger template
|
||||
generate:
|
||||
@@ -26,6 +29,9 @@ pipeline:
|
||||
--config config.json
|
||||
--lang java
|
||||
--output ./generated/
|
||||
when:
|
||||
event: [ push, pull_request, tag, cron ]
|
||||
cron: sync
|
||||
|
||||
# Format generated and custom code according to the Google Java Style Guide
|
||||
format:
|
||||
@@ -33,6 +39,9 @@ pipeline:
|
||||
commands:
|
||||
- java -jar google-java-format.jar --replace $(find ./generated/ -name "*.java")
|
||||
- java -jar google-java-format.jar --replace $(find ./custom/ -name "*.java")
|
||||
when:
|
||||
event: [ push, pull_request, tag, cron ]
|
||||
cron: sync
|
||||
|
||||
# Recreate directories and copy files of previous pipeline step
|
||||
combine:
|
||||
@@ -41,12 +50,18 @@ pipeline:
|
||||
- mkdir --verbose --parents ./src/main/java/ && cp --verbose --recursive ./generated/src/main/java/* ./src/main/java/
|
||||
- mkdir --verbose --parents ./docs/ && cp --verbose --recursive ./generated/docs/* ./docs/
|
||||
- mkdir --verbose --parents ./src/ && cp --verbose --recursive ./custom/src/* ./src/
|
||||
when:
|
||||
event: [ push, pull_request, tag, cron ]
|
||||
cron: sync
|
||||
|
||||
# Check if generated code can be compiled at language level 8
|
||||
build:
|
||||
image: openjdk:8
|
||||
commands:
|
||||
- ./gradlew clean assemble
|
||||
when:
|
||||
event: [ push, pull_request, tag, cron ]
|
||||
cron: sync
|
||||
|
||||
# Upload updated code to repository
|
||||
publish:
|
||||
@@ -80,4 +95,5 @@ pipeline:
|
||||
fi
|
||||
when:
|
||||
branch: main
|
||||
event: [ push, tag ]
|
||||
event: [ push, tag, cron ]
|
||||
cron: sync
|
||||
|
||||
Reference in New Issue
Block a user