Skip to content
Snippets Groups Projects
Commit b7821c53 authored by Peter Nerlich's avatar Peter Nerlich
Browse files

add pipeline for automatic new release testing

parent 8d96f2aa
No related branches found
No related tags found
No related merge requests found
image: alpine
# greater or equal to 3.13 (for git, to be able to use --merged and --no-merged in the same command)
image: alpine:3.14
before_script:
- apk add git zip patch
- ./create_env.sh
build:
......@@ -10,7 +12,51 @@ build:
- master
- testing
script:
- ./create_env.sh
- ./apply_patch.sh
- mv patched/ advtrains_luaautomation_sync/
- zip -r advtrains_luaautomation_sync.zip advtrains_luaautomation_sync/
artifacts:
paths:
- advtrains_luaautomation_sync/
- advtrains_luaautomation_sync.zip
update:
stage: test
only:
- master
- testing
before_script:
- apk add openssh-client git
- eval $(ssh-agent -s)
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- gitlab_hostname=$(echo "${CI_REPOSITORY_URL}" | sed -e 's|https\?://gitlab-ci-token:.*@||g' | sed -e 's|/.*||g')
- ssh-keyscan "${gitlab_hostname}" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git config user.name "Patch Test Bot"
- git config user.email "patch.test.bot@example.com"
- TARGET_REPO=$(echo "${CI_REPOSITORY_URL}" | sed -e 's|https\?://gitlab-ci-token:.*@|ssh://git@|g')
- TARGET_BRANCH="ci-test-${CI_COMMIT_BRANCH}"
script:
- git checkout -B "$TARGET_BRANCH"
- cd advtrains
- git fetch
- TAGS="$( git tag --merged "$CI_COMMIT_BRANCH" --no-merged HEAD )"
- cd ..
- >
for t in $TAGS; do
git update-index --cacheinfo 160000,$(cd advtrains && git rev-list -n 1 tags/$t),advtrains
git commit -m "Test patch with $t"
git push -f "$TARGET_REPO" "$TARGET_BRANCH" && sleep 2
done
build:
stage: test
only:
- ci-test-master
- ci-test-testing
script:
- ./apply_patch.sh
- mv patched/ advtrains_luaautomation_sync/
- zip -r advtrains_luaautomation_sync.zip advtrains_luaautomation_sync/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment