Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advtrains_luaautomation_sync
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Minetest
advtrains_luaautomation_sync
Commits
b7821c53
Commit
b7821c53
authored
Oct 14, 2021
by
Peter Nerlich
Browse files
Options
Downloads
Patches
Plain Diff
add pipeline for automatic new release testing
parent
8d96f2aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+48
-2
48 additions, 2 deletions
.gitlab-ci.yml
with
48 additions
and
2 deletions
.gitlab-ci.yml
+
48
−
2
View file @
b7821c53
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/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment