buile-mbedtls-amis.yaml:

Embed the shell script into the yaml job file,
so that the job would be all inclusive in a single file

Signed-off-by: Arthur She <arthur.she@linaro.org>
Change-Id: I31fa652d791bbdea86290c4ba1e4e4d44429c8f5
diff --git a/buile-mbedtls-amis.yaml b/buile-mbedtls-amis.yaml
new file mode 100644
index 0000000..1b558b9
--- /dev/null
+++ b/buile-mbedtls-amis.yaml
@@ -0,0 +1,59 @@
+- job:
+    name: buile-mbedtls-amis
+    project-type: freestyle
+    defaults: global
+    properties:
+        - authorization:
+            anonymous:
+                - job-read
+                - job-extended-read
+        - build-discarder:
+            days-to-keep: 90
+            num-to-keep: 200
+    disabled: false
+    node: build-amd64-private
+    concurrent: false
+    display-name: 'build AMIs for mbedtls'
+    wrappers:
+        - timestamps
+    parameters:
+    - bool:
+        name: BUILD_UBUNTU_AMI
+        default: true
+        description: Build Ubuntu AMI
+    - bool:
+        name: BUILD_FREEBSD_AMI
+        default: false
+        description: Build FreeBSD AMI
+    - bool:
+        name: BUILD_CUSTOM_AMI
+        default: false
+        description: Build Custom AMI
+    builders:
+        - shell: |
+            #!/bin/bash
+
+            export PACKER_LOG=1
+
+            AMI=""
+            [ ${BUILD_UBUNTU_AMI} == "true" ] && AMI="${AMI} ubuntu"
+            [ ${BUILD_FREEBSD_AMI} == "true" ] && AMI="${AMI} freebsd"
+            [ ${BUILD_CUSTOM_AMI} == "true" ] && AMI="${AMI} custom"
+
+            [ -z "${AMI}" ] && echo "Build Nothing.." && exit
+
+            rm -rf mbedtls-amis
+            git clone https://git.trustedfirmware.org/next/ci/mbedtls-amis.git
+            cd mbedtls-amis
+
+            for os in ${AMI}
+            do
+                echo -e "\nBuild ${os} AMI"
+                [ ! -f "packer_${os}.json" ] && echo -e "\nERROR: Can not find packer_${os}.json" && exit -1
+                # Dump packer_config.json to job log
+                cat packer_${os}.json
+                packer build packer_${os}.json
+            done
+    publishers:
+        - email:
+            recipients: linaro-infrastructure-errors@lists.linaro.org,arthur.she@linaro.org
diff --git a/mbedtls-amis.yaml b/mbedtls-amis.yaml
deleted file mode 100644
index 35cec06..0000000
--- a/mbedtls-amis.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-- job:
-    name: mbedtls-amis
-    project-type: freestyle
-    defaults: global
-    properties:
-        - authorization:
-            anonymous:
-                - job-read
-                - job-extended-read
-        - build-discarder:
-            days-to-keep: 90
-            num-to-keep: 200
-    disabled: false
-    node: build-amd64-private
-    concurrent: false
-    display-name: 'build AMIs for mbedtls'
-    wrappers:
-        - timestamps
-    parameters:
-    - bool:
-        name: BUILD_UBUNTU_AMI
-        default: true
-        description: Build Ubuntu AMI
-    - bool:
-        name: BUILD_FREEBSD_AMI
-        default: false
-        description: Build FreeBSD AMI
-    - bool:
-        name: BUILD_CUSTOM_AMI
-        default: false
-        description: Build Custom AMI
-    builders:
-        - shell:
-            !include-raw: mbedtls-amis/builders.sh
-    publishers:
-        - email:
-            recipients: linaro-infrastructure-errors@lists.linaro.org,arthur.she@linaro.org
diff --git a/mbedtls-amis/builders.sh b/mbedtls-amis/builders.sh
deleted file mode 100755
index 114347f..0000000
--- a/mbedtls-amis/builders.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-export PACKER_LOG=1
-
-AMI=""
-[ ${BUILD_UBUNTU_AMI} == "true" ] && AMI="${AMI} ubuntu"
-[ ${BUILD_FREEBSD_AMI} == "true" ] && AMI="${AMI} freebsd"
-[ ${BUILD_CUSTOM_AMI} == "true" ] && AMI="${AMI} custom"
-
-[ -z "${AMI}" ] && echo "Build Nothing.." && exit
-
-rm -rf mbedtls-amis
-git clone https://git.trustedfirmware.org/next/ci/mbedtls-amis.git
-cd mbedtls-amis
-
-for os in ${AMI}
-do
-    echo -e "\nBuild ${os} AMI"
-    [ ! -f "packer_${os}.json" ] && echo -e "\nERROR: Can not find packer_${os}.json" && exit -1
-    # Dump packer_config.json to job log
-    cat packer_${os}.json
-    packer build packer_${os}.json
-done