瀏覽代碼

Prepare guide for "depoy on PWS" feature

* push app artifact on S3 in CI script
* add a metadata file "run-on-pws.json" for the deploy agent
to read the app configuration from
Brian Clozel 9 年之前
父節點
當前提交
49ca5a4d17
共有 2 個檔案被更改,包括 56 行新增15 行删除
  1. 33
    0
      run-on-pws.json
  2. 23
    15
      test/run.sh

+ 33
- 0
run-on-pws.json 查看文件

@@ -0,0 +1,33 @@
1
+{
2
+    "orgName": "spring-guides",
3
+    "orgUuid": "",
4
+    "spaces": [
5
+        {
6
+            "name": "spring-guides",
7
+            "routes": [
8
+                {
9
+                    "name": "random1",
10
+                    "value": "${random-word}"
11
+                }
12
+            ],
13
+            "apps": [
14
+                {
15
+                    "name": "rest-service",
16
+                    "code": {
17
+                        "url": "https://springio-guides.s3.amazonaws.com/gs-rest-service-0.1.0.jar",
18
+                        "content_type": "application/war",
19
+                        "actions": [
20
+                            "push"
21
+                        ]
22
+                    },
23
+                    "instances": 1,
24
+                    "memory_in_mb": 1024,
25
+                    "disk_in_mb": 1024,
26
+                    "map_routes": [
27
+                        "random1"
28
+                    ]
29
+                }
30
+            ]
31
+        }
32
+    ]
33
+}

+ 23
- 15
test/run.sh 查看文件

@@ -1,4 +1,20 @@
1 1
 cd $(dirname $0)
2
+cd ../initial
3
+
4
+mvn clean compile
5
+ret=$?
6
+if [ $ret -ne 0 ]; then
7
+exit $ret
8
+fi
9
+rm -rf target
10
+
11
+./gradlew compileJava
12
+ret=$?
13
+if [ $ret -ne 0 ]; then
14
+exit $ret
15
+fi
16
+rm -rf build
17
+
2 18
 cd ../complete
3 19
 mvn clean package
4 20
 java -jar target/gs-rest-service-0.1.0.jar &
@@ -19,29 +35,21 @@ if diff -w ../test/expected.json target/actual.json
19 35
         let ret=255
20 36
         exit $ret
21 37
 fi
22
-rm -rf target
23 38
 
24
-./gradlew build
25
-ret=$?
26
-if [ $ret -ne 0 ]; then
27
-exit $ret
39
+if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; 
40
+  then 
41
+    curl https://raw.githubusercontent.com/timkay/aws/master/aws -o aws
42
+    chmod u+x aws
43
+    ./aws put --progress "x-amz-acl: public-read" springio-guides/gs-rest-service-0.1.0.jar target/gs-rest-service-0.1.0.jar
28 44
 fi
29
-rm -rf build
30
-
31
-cd ../initial
32 45
 
33
-mvn clean compile
34
-ret=$?
35
-if [ $ret -ne 0 ]; then
36
-exit $ret
37
-fi
38 46
 rm -rf target
39 47
 
40
-./gradlew compileJava
48
+./gradlew build
41 49
 ret=$?
42 50
 if [ $ret -ne 0 ]; then
43 51
 exit $ret
44 52
 fi
45
-rm -rf build
46 53
 
54
+rm -rf build
47 55
 exit