Skip to content

Commit 3b0eb26

Browse files
committed
First try to deploy maven artifacts
1 parent 284b0d5 commit 3b0eb26

13 files changed

+102
-15
lines changed

.NET/.travis-core.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ git:
4242
depth: false
4343
install:
4444
- git clone https://github.com/UnterrainerInformatik/Travis-Scripts.git travis
45-
- source travis/functions.sh
45+
- source travis/functions.NET.sh
4646
- tr_setProjectSubdir .NET
4747
- source $TRAVIS/install.sh
4848
before_script:

.NET/.travis-mono.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ git:
4242
depth: false
4343
install:
4444
- git clone https://github.com/UnterrainerInformatik/Travis-Scripts.git travis
45-
- source travis/functions.sh
45+
- source travis/functions.NET.sh
4646
- tr_setProjectSubdir .NET
4747
- source $TRAVIS/install.sh
4848
before_script:

.NET/before_deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# we have to re-import everyting.
55
# Environment variables should be set though (travis takes care of that).
66
echo "re-sourcing functions"
7-
source travis/functions.sh
7+
source travis/functions.NET.sh
88

99
mkdir -p ziptemp/$SOLUTION_NAME
1010
cp -a $BUILD_TARGET/* ziptemp/$SOLUTION_NAME

.NET/deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# we have to re-import everyting.
55
# Environment variables should be set though (travis takes care of that).
66
echo "re-sourcing functions"
7-
source travis/functions.sh
7+
source travis/functions.NET.sh
88

99
echo "starting deploy stage"
1010
if tr_isSetAndNotFalse NUGET; then

Java/.travis.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: java
2+
git:
3+
depth: false
4+
install:
5+
- git clone https://github.com/UnterrainerInformatik/Travis-Scripts.git travis
6+
- source travis/functions.Java.sh
7+
- tr_setProjectSubdir .NET
8+
- source $TRAVIS/install.sh
9+
before_script:
10+
- source $TRAVIS/before_script.sh
11+
script:
12+
- source $TRAVIS/script.sh
13+
14+
before_deploy: ./$TRAVIS/before_deploy.sh
15+
deploy:
16+
- provider: script
17+
skip_cleanup: true
18+
script: ./$TRAVIS/deploy.sh
19+
on:
20+
branch: master
21+
- provider: releases
22+
skip_cleanup: true
23+
overwrite: true
24+
api_key:
25+
secure: $GITHUB_API_KEY
26+
file: $DEPLOY_BUILD.$VERSION.zip
27+
on:
28+
tags: true
29+
branch: master

Java/before_deploy.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Since the deploy-stage has limited bash capabilities AND is a different shell,
4+
# we have to re-import everyting.
5+
# Environment variables should be set though (travis takes care of that).
6+
echo "re-sourcing functions"
7+
source travis/functions.Java.sh
8+
9+
mkdir -p ziptemp/$ARTIFACT_ID
10+
cp -a target/* ziptemp/$ARTIFACT_ID
11+
12+
cd ziptemp
13+
zip -r $ARTIFACT_ID.$POM_VERSION.zip $ARTIFACT_ID/*
14+
mv $ARTIFACT_ID.$POM_VERSION.zip ../$ARTIFACT_ID.$POM_VERSION.zip
15+
16+
cd -
17+
rm -rf ziptemp

Java/before_script.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
#######################################################
4+
# ENVIRONMENT VARIABLES
5+
#######################################################

Java/deploy.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Since the deploy-stage has limited bash capabilities AND is a different shell,
4+
# we have to re-import everyting.
5+
# Environment variables should be set though (travis takes care of that).
6+
echo "re-sourcing functions"
7+
source travis/functions.Java.sh
8+
9+
echo "starting deploy stage"

Java/install.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/bash

Java/script.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
output=$(printf \
4+
'LOCAL_REPOSITORY=${settings.localRepository}\n'\
5+
'GROUP_ID=${project.groupId}\n'
6+
'ARTIFACT_ID=${project.artifactId}\n'\
7+
'POM_VERSION=${project.version}\n0\n' \
8+
| mvn help:evaluate --non-recursive )
9+
10+
export LOCAL_REPO=$(echo "$output" | grep '^LOCAL_REPOSITORY' | cut -d = -f 2)
11+
export GROUP_ID=$(echo "$output" | grep '^GROUP_ID' | cut -d = -f 2)
12+
export ARTIFACT_ID=$(echo "$output" | grep '^ARTIFACT_ID' | cut -d = -f 2)
13+
export POM_VERSION=$(echo "$output" | grep '^POM_VERSION' | cut -d = -f 2)

functions.Java.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
source travis/functions.sh
4+
5+
# make scripts executable
6+
chmod +x travis/Java/*
7+
8+
# Calculate variables

functions.NET.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
source travis/functions.sh
4+
5+
# make scripts executable
6+
chmod +x travis/.NET/*
7+
chmod +x travis/.NET/scripts/*
8+
9+
# Calculate variables
10+
_SOLUTION="${SOLUTION_NAME}.sln"
11+
if tr_isSet SOLUTION_PATH; then
12+
echo "solution path is set"
13+
_SOLUTION="${SOLUTION_PATH}${SOLUTION_NAME}.sln"
14+
fi
15+
echo "command: export SOLUTION_PATH_AND_NAME=$_SOLUTION"
16+
export SOLUTION_PATH_AND_NAME=$_SOLUTION

functions.sh

-11
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# make scripts executable
44
chmod +x travis/*
5-
chmod +x travis/.NET/*
6-
chmod +x travis/.NET/scripts/*
75

86
tr_setProjectSubdir() {
97
export TRAVIS=travis/$1
@@ -30,12 +28,3 @@ tr_isSetAndNotFalse() {
3028
return 1
3129
fi
3230
}
33-
34-
# Calculate variables
35-
_SOLUTION="${SOLUTION_NAME}.sln"
36-
if tr_isSet SOLUTION_PATH; then
37-
echo "solution path is set"
38-
_SOLUTION="${SOLUTION_PATH}${SOLUTION_NAME}.sln"
39-
fi
40-
echo "command: export SOLUTION_PATH_AND_NAME=$_SOLUTION"
41-
export SOLUTION_PATH_AND_NAME=$_SOLUTION

0 commit comments

Comments
 (0)