-
Notifications
You must be signed in to change notification settings - Fork 105
/
.travis.yml
142 lines (129 loc) · 5.57 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
sudo: required
dist: trusty
jobs:
include:
- stage: deploy-generator-lambda
name: Deploys the Vorto Generators as Lambda Functions to AWS
language: java
jdk: oraclejdk8
before_script:
- cd generators/generator-lambda
script:
- mvn clean package -DskipTests
before_install:
before_deploy:
- export ARTIFACT_PLUGININFO=$(ls generator-lambda-plugininfo/target/generator-lambda-plugininfo-*.jar)
- export ARTIFACT_PLUGINEXECUTOR=$(ls generator-lambda-executor/target/generator-lambda-executor-*.jar)
deploy:
- provider: lambda
edge: true
function_name: "generators-plugininfo-dev"
region: "$VORTO_S3_REGION"
role: "$VORTO_AWS_LAMBDA_EXECUTION_ROLE"
zip: "$ARTIFACT_PLUGININFO"
runtime: "java8"
module_name: "org.eclipse.vorto.plugins.generator.lambda.meta.plugins.function.GeneratorMetaHandler"
handler_name: "handleRequest"
access_key_id: "$AWS_ACCESS_KEY_ID"
secret_access_key: "$AWS_SECRET_ACCESS_KEY"
timeout: 300
on:
branch: development
- provider: lambda
edge: true
function_name: "generators-pluginexecutor-dev"
region: "$VORTO_S3_REGION"
role: "$VORTO_AWS_LAMBDA_EXECUTION_ROLE"
zip: "$ARTIFACT_PLUGINEXECUTOR"
runtime: "java8"
module_name: "org.eclipse.vorto.plugins.generator.lambda.executor.GeneratorExecutionHandler"
handler_name: "handleRequest"
access_key_id: "$AWS_ACCESS_KEY_ID"
secret_access_key: "$AWS_SECRET_ACCESS_KEY"
timeout: 300
on:
branch: development
- provider: lambda
edge: true
function_name: "generators-plugininfo-prod"
region: "$VORTO_S3_REGION"
role: "$VORTO_AWS_LAMBDA_EXECUTION_ROLE"
zip: "$ARTIFACT_PLUGININFO"
runtime: "java8"
module_name: "org.eclipse.vorto.plugins.generator.lambda.meta.plugins.function.GeneratorMetaHandler"
handler_name: "handleRequest"
access_key_id: "$AWS_ACCESS_KEY_ID"
secret_access_key: "$AWS_SECRET_ACCESS_KEY"
timeout: 300
on:
branch: deployment
- provider: lambda
edge: true
function_name: "generators-pluginexecutor-prod"
region: "$VORTO_S3_REGION"
role: "$VORTO_AWS_LAMBDA_EXECUTION_ROLE"
zip: "$ARTIFACT_PLUGINEXECUTOR"
runtime: "java8"
module_name: "org.eclipse.vorto.plugins.generator.lambda.executor.GeneratorExecutionHandler"
handler_name: "handleRequest"
access_key_id: "$AWS_ACCESS_KEY_ID"
secret_access_key: "$AWS_SECRET_ACCESS_KEY"
timeout: 300
on:
branch: deployment
- stage: deploy
name: "Deploy Repository"
language: java
services:
- docker
jdk: oraclejdk8
cache:
npm: false
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
before_install:
- echo "MAVEN_OPTS='-Xms1g -Xmx2g'" > ~/.mavenrc
- sudo sysctl net.ipv4.ip_forward=1
install:
- git clone https://github.com/digitalcraftsman/hugo-material-docs.git website/themes/hugo-material-docs
- wget https://github.com/gohugoio/hugo/releases/download/v0.52/hugo_0.52_Linux-64bit.deb -O /tmp/hugo.deb && sudo dpkg -i /tmp/hugo.deb
- npm install -g --save remark-cli to-vfile remark-preset-lint-recommended remark-validate-links remark-lint-no-dead-urls remark-message-control remark-preset-lint-markdown-style-guide remark-lint
- pip install --user awscli
script:
- remark -i .remark_ignore -f -u validate-links .
- remark -i .remark_ignore -u lint-no-dead-urls .
- mvn --fail-fast -q clean package -P checkstyle
- docker build --build-arg JAR_FILE=./repository/repository-server/target/infomodelrepository.jar -f docker/Repository_Dockerfile -t eclipsevorto/vorto-repo:nightly .;
- echo "TRAVIS_TAG------$TRAVIS_TAG"
- if [ -n "$TRAVIS_TAG" ]; then
docker build --build-arg JAR_FILE=./repository/repository-server/target/infomodelrepository.jar -f docker/Repository_Dockerfile -t eclipsevorto/vorto-repo:latest .;
docker build --build-arg JAR_FILE=./repository/repository-server/target/infomodelrepository.jar -f docker/Repository_Dockerfile -t eclipsevorto/vorto-repo:$TRAVIS_TAG .;
fi
before_deploy:
- export AWS_DEFAULT_REGION=$VORTO_S3_REGION
- export AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID"
- export AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY"
- export TRAVIS_COMMIT_SHORT=$(git rev-parse --short HEAD)
- export ELASTIC_BEANSTALK_LABEL="${TRAVIS_JOB_NUMBER}_${TRAVIS_COMMIT_SHORT}"
- export ARTIFACT=infomodelrepository
- export ELASTIC_BEANSTALK_DESCRIPTION="Build-Job ${TRAVIS_JOB_NUMBER} - Git Revision ${TRAVIS_COMMIT_SHORT} ${ARTIFACT_NAME}"
deploy:
- provider: script
script: bash docker/docker_push
on:
tags: true
- provider: script
script: bash docker/docker_push
on:
branch: development
- provider: script
script: bash build-scripts/repackage-deploy-repo.sh
skip_cleanup: true
on:
branch: deployment
- provider: script
script: bash build-scripts/repackage-deploy-repo.sh
skip_cleanup: true
on:
branch: development