Skip to content
Snippets Groups Projects
Commit 1e34b1f6 authored by Andreas Fehn's avatar Andreas Fehn
Browse files

Use gitlab ci to automatically release versions to ivy repo in another branch

parent e3b4bf72
Branches
No related tags found
No related merge requests found
variables:
GIT_STRATEGY: clone
ARTIFACT_DIR: build/repo/ecore2java
build:
stage: build
image: nimmis/alpine-java:openjdk-8-jdk
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
- ./gradlew publish
artifacts:
paths:
- $ARTIFACT_DIR
expire_in: 10min
cache:
paths:
- .gradle/wrapper
- .gradle/caches
only:
- tags
tags:
- dockered
publish:
stage: deploy
image: bravissimolabs/alpine-git
before_script:
- mkdir -pvm 0700 ~/.ssh
- echo "$SSH_SECRET_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H "git-st.inf.tu-dresden.de" >> ~/.ssh/known_hosts
- git config user.name "$GITLAB_USER_NAME"
- git config user.email "$GITLAB_USER_EMAIL"
- git remote set-url --push origin `echo $CI_REPOSITORY_URL | sed -E 's/.*@([^\/]+?(\:\d+)?)\//git@\1:/'`
- export VERSION=${CI_COMMIT_TAG:-`git describe --tags --always`}
- echo $VERSION
script:
- git checkout ivy-repo || git checkout --orphan ivy-repo
- git reset
- cp -r $ARTIFACT_DIR .
- git add $(git ls-files -o ecore2java)
- git commit -m "[skip ci] Automatic release of version $VERSION"
- git push --set-upstream origin ivy-repo
after_script:
- rm -rfv ~/.ssh
only:
- tags
tags:
- dockered
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment