-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
53 lines (51 loc) · 4.34 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
language: java
jdk:
- openjdk11
install: true
addons:
sonarcloud:
organization: xm-online
token:
secure: h3cnCin1WHOMCYIhKKFZ1buVoHt7RJSWhrHGoixKMBh+4bKohto7kh1v9X5lDdcQq9ZmFbb3QBjGlg/im0LJLSXsdq6kbHWsCzDN98K7AT6P4lNNeLzBsS3dK2VW1/rGWJDk2JFLuUZCrkfI0YdhJGQBxrV6tSFjDhv0LsCT2WWomfMVlsxrqHEuahbDsdDpYHgvgpJSXnsNV44qtrm8adtUNykfMjHCSEr4EMbEI8Gq+nXBafMF2JbdKmZmGx+CIXWkiJO7F9wMD56yQt7IGcGL6wkIeYqqG1sIygqx8eM4xl/LvfQMYlKgFbzUJr6dit3d8Ys9fODcz5shM0RaErpCVOAhR7UFmcDUJPLiqCwGFETojST3TXDW7StAi/Yr8GEvN5109k6c+s9+6g/Y4HAb7Cr0MiD3f42ofWdUJRjtAwt4vnkG8OLTUH5+UbhyAuduZubjlEzjb/xuSoHKbvJc/aAbhKky3d4QF9/8zJMhxnBr36cfdU+uur8rYpvgFi1O0oNJPNXTX+XVxo+uwXuRp9S156yxjFspElISynEEpJl3qhCvRthdf4cUWOVq4tbiBH/PAVDnTy4qgE3EdQdqP4Nj8UME0aKMSZiHzH9JcEWzHdVsCZB4b6p4H004GbTiejFwDoEOb1pDdHQ3l/BmDbVzsyP6YcCM+vrxtcc=
branches:
- main
script:
- set -e
- "./gradlew --no-daemon --refresh-dependencies clean check test"
- "./gradlew -x test -Pprod --no-daemon bootWar"
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- export DOCKER_REPO=$(echo -n $TRAVIS_REPO_SLUG | sed -e 's/^xm-online\//xmonline\//g')
- export IMAGE_BRANCH=$(echo -n $TRAVIS_BRANCH | sed -e 's/\//-/g')
- export PROJECT_VERSION="$IMAGE_BRANCH"
- if [ "$TRAVIS_PULL_REQUEST" == "false" ];
then
PROJECT_VERSION=$(./gradlew -q getProjectVersion);
TAGS="$PROJECT_VERSION $PROJECT_VERSION-$TRAVIS_BUILD_NUMBER $(echo $PROJECT_VERSION | awk -F '.' '{printf $1"."$2" "$1}') latest";
fi
- TAG_ARGS=""
- for TAG in $TAGS;
do
TAG_ARGS="$TAG_ARGS -t $DOCKER_REPO:$TAG";
done
- if [ "$TAG_ARGS" ];
then
docker buildx create --name multi-arch --platform "linux/amd64,linux/arm64,linux/arm64/v8,linux/arm/v8" --driver "docker-container" --use;
docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8,linux/arm/v8 $TAG_ARGS --label commit_id="$TRAVIS_COMMIT" --label version="$PROJECT_VERSION" --label build_number="$TRAVIS_BUILD_NUMBER" --label build_url="$TRAVIS_BUILD_WEB_URL" --label git_url="$TRAVIS_REPO_SLUG" --label commit_message="$TRAVIS_COMMIT_MESSAGE" --push -f src/main/docker/Dockerfile .;
docker buildx rm multi-arch || true;
fi
cache:
directories:
- "~/.gradle"
- "~/.m2"
env:
global:
- secure: MvgdRvCRNj7jI/+uZqL9q7ZUFVL+WDRynAFtEw6MONbeOy57HErZoD0bIpO5ckz6RPiMDt/XFoct0MWgDlKv+hqqvRENDPRDS7SEl3IBdjfMQVCp6mCAoo6Ip2NAGch2ctQ4f2H/Gsd1Z0cH08LONH6vW79IgrLUWsaEdUxn6obXxFuPN2q3e1dFymu9/RiYRDbO9alYMmHAs/Qivm+Q2qBckfqMApr9JJdKdLi4W3/T1fbvibu0Pj0LOhutoDLGJQyrYpMv4olxFtSz6ozQEOwnq9LhrpwUEpWB/ebEGEjFws7wojTsAmPUyQTFFqQbyfFGGxQkS9UZzX3pmE+BLszWNZGjBXHoH5rH+CJZuiDvxccfag6O1KbuRhqKZnFBViQSx+6Q6c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7r8syDnj7EL0/0wVWE6RHhNPuDoH3kdK3kL22mVYpfpHj2E1QvtY1vB5M/sD9uTEgdt6wJmdpEHdW6fN0rfLbSmmnWqewRXytsaQJ1ahH1aHrYUkHl77AoRGdp//yiOIOBeoP2WPa0zEFyFbXavcZfbq90WgHFbeixiYc2fYemg/98BIyheyN4BT3mOAkr3n8ioNIKb6FdANzDNeRy/QLPflPTvbBtPavPixrVYpSOhYWJofp9iF9XazmF5DT42KUhswdzCEAGquBWc0kvNHtfqI9t4HqSc15AhkiTomINv23M6wWazXzJo5sQD8ss8NHj2yLdeYDwufBEy8ugOU1ce/541Rt7NblwlG1ENEWgSh9xJBA2PegdV6a5TGOY9TFGqsfb/VibIlQQntOyt8mXvAdHIzwAIJvjrvzdvyEezb8r8zfSgKj6hZSdwjg40jdGfjv432ZJmvseGzpA6Vg/Vekhj1eYdLi5MZGyU81+im7qx9av9dEIT5FOlLCkvSKikmHIXmih/TBzWuOQDTdAzcQuGRoPG84FBcoPpu8Pdf28zjKNktr0kHhlil2vho3TAjoFmLGR8RU6ZOB01fN5t/FY8QjvrY4pQB9ZKM=
branches:
only:
- master
- main