From 0ca67081c97be3075575321adbd2c452e63299dc Mon Sep 17 00:00:00 2001 From: "mingsheng.su" Date: Thu, 27 Jun 2019 14:10:26 +0800 Subject: [PATCH] update examples && CODEOWNERS --- CODEOWNERS | 1 + examples/ucloud/basic.json | 2 +- examples/ucloud/ubuntu.json | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 examples/ucloud/ubuntu.json diff --git a/CODEOWNERS b/CODEOWNERS index 2edcc5e1e..05b4b2dac 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -16,6 +16,7 @@ /builder/scaleway/ @sieben @mvaude @jqueuniet @fflorens @brmzkw /builder/hcloud/ @LKaemmerling /builder/hyperone @m110 @gregorybrzeski @ad-m +/builder/ucloud/ @shawnmssu /builder/yandex @GennadySpb @alexanderKhaustov @seukyaso # provisioners diff --git a/examples/ucloud/basic.json b/examples/ucloud/basic.json index 6b0cb56df..6b37c07ec 100644 --- a/examples/ucloud/basic.json +++ b/examples/ucloud/basic.json @@ -26,7 +26,7 @@ "provisioners": [{ "type": "shell", "inline": [ - "yum install -y mysql" + "yum install -y nginx" ] }] } diff --git a/examples/ucloud/ubuntu.json b/examples/ucloud/ubuntu.json new file mode 100644 index 000000000..27fb5a228 --- /dev/null +++ b/examples/ucloud/ubuntu.json @@ -0,0 +1,30 @@ +{ +"variables": { + "ucloud_public_key": "{{env `UCLOUD_PUBLIC_KEY`}}", + "ucloud_private_key": "{{env `UCLOUD_PRIVATE_KEY`}}", + "ucloud_project_id": "{{env `UCLOUD_PROJECT_ID`}}" +}, + +"builders": [{ + "type": "ucloud-uhost", + "public_key":"{{user `ucloud_public_key`}}", + "private_key":"{{user `ucloud_private_key`}}", + "project_id": "{{user `ucloud_project_id`}}", + "region": "cn-bj2", + "availability_zone": "cn-bj2-02", + "instance_type": "n-basic-2", + "source_image_id":"uimage-irofn4", + "ssh_password": "ucloud_2019", + "ssh_username":"ubuntu", + "image_name": "packer-test-ubuntu-bj" +}], + +"provisioners": [{ + "type": "shell", + "inline": [ + "sleep 30", + "echo 'ucloud_2019' | sudo -S apt update", + "sudo apt install nginx -y" + ] +}] +} \ No newline at end of file