Update scripts for gitea
ci/woodpecker/push/pages Pipeline was successful Details
ci/woodpecker/push/gradle Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2022-10-28 16:03:23 +02:00
parent 32648ae678
commit b3830655ec
Signed by: Johannes
GPG Key ID: E76429612C2929F4
4 changed files with 75 additions and 50 deletions

View File

@ -2,9 +2,11 @@ pipeline:
maven: maven:
image: gradle:alpine image: gradle:alpine
pull: true pull: true
environment:
- GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands: commands:
- export GRADLE_USER_HOME=`pwd`/.gradle - gradle publish -Pmaven="${GITEA_API}/packages/${CI_REPO_OWNER}/maven"
- gradle publish -Pmaven="https://git.frohnmeyer-wds.de/api/packages/Johannes/maven"
secrets: [ maven_token ] secrets: [ maven_token ]
when: when:
- branch: master - branch: master

View File

@ -12,8 +12,8 @@ publishing {
name = "dynamic" name = "dynamic"
credentials(HttpHeaderCredentials::class) { credentials(HttpHeaderCredentials::class) {
name = "Job-Token" name = "Authorization"
value = System.getenv()["CI_JOB_TOKEN"] value = System.getenv()["MAVEN_TOKEN"]
} }
authentication { authentication {
create<HttpHeaderAuthentication>("header") create<HttpHeaderAuthentication>("header")

View File

@ -1,11 +1,23 @@
pages: pipeline:
image: archlinux:latest build:
stage: deploy image: archlinux:latest
script: commands:
- pacman -Sy mdbook --noconfirm - pacman -Sy mdbook --noconfirm
- mdbook build - mdbook build
artifacts: when:
paths: - branch: master
- public publish:
only: image: woodpeckerci/plugin-s3
- master settings:
bucket: pages
region: nebula
path_style: true
endpoint: https://s3.frohnmeyer-wds.de
access_key: pages
secret_key:
from_secret: pages_secret
source: public/**/*
target: /${CI_REPO}
strip_prefix: public/
when:
- branch: master

View File

@ -1,35 +1,46 @@
image: gradle:alpine pipeline:
build_test:
variables: image: gradle:alpine
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G" pull: true
environment:
before_script: - GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- export GRADLE_USER_HOME=`pwd`/.gradle - GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands:
stages: - gradle --build-cache deployDebug -Pmaven="${GITEA_API}/packages/${CI_REPO_OWNER}/maven"
- build - mkdir artifacts
- test - cp build/libs/* artifacts/
- deploy - cp build/devlibs/*-dev.jar artifacts/
- pushd artifacts
build_test: - rm -f *-maven.jar *-sources.jar *-testmod.jar *-config-inject.jar
stage: build - mv *-dev.jar dev.zip
script: - mv *.jar latest.jar
- gradle --build-cache deployDebug -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven" - mv dev.zip latest-dev.jar
- cp build/libs/* ./ - popd
- cp build/devlibs/*-dev.jar ./ secrets: [ maven_token ]
- rm -f *-maven.jar *-sources.jar *-testmod.jar *-config-inject.jar
- mv *-dev.jar dev.zip
- mv *.jar latest.jar
- mv dev.zip latest-dev.jar
artifacts: artifacts:
paths: image: woodpeckerci/plugin-s3
- build/libs settings:
- latest.jar bucket: pages
- latest-dev.jar region: nebula
path_style: true
deploy: endpoint: https://s3.frohnmeyer-wds.de
rules: access_key: pages
- if: $CI_COMMIT_TAG && '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^master/' secret_key:
stage: deploy from_secret: pages_secret
script: source: artifacts/**/*
- gradle --build-cache deployRelease -Prelease -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven" target: /${CI_REPO}
when:
- branch: master
deploy:
image: gradle:alpine
pull: true
environment:
- GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands:
- gradle --build-cache deployRelease -Prelease -Pmaven="${GITEA_API}/packages/${CI_REPO_OWNER}/maven"
- TODO add release artifact
secrets: [ maven_token ]
when:
- event: tag
branch: master