forked from vmware/vic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
196 lines (189 loc) · 7.46 KB
/
.drone.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# After any change to this file you MUST regenerate and checkin
# a .drone.sec even if no secrets were changed. The secrets file is tied
# to a specific .drone.yml so artifacts will not be uploaded to (OR DOWNLOADED
# FROM) Bintray in following builds without an updated .drone.sec
#
# When you are ready to submit a pull request, you must regenerate .drone.sec for the vmware/vic repo:
#
# $ drone -s https://ci.vmware.run -t ${DRONE_TOKEN} secure --in "secrets.yml" --out ".drone.sec" --repo vmware/vic --yaml ".drone.yml"
#
# The secrets file is in our local git repo. Ask mhagen for access.
---
clone:
path: github.com/vmware/vic
tags: true
build:
prevent-concurrent-builds:
image: $${TEST_BUILD_IMAGE=gcr.io/eminent-nation-87317/vic-integration-test:1.22}
pull: true
environment:
BIN: bin
GOPATH: /drone
SHELL: /bin/bash
TEST_URL_ARRAY: $$TEST_URL_ARRAY
DRONE_SERVER: $$DRONE_SERVER
DRONE_TOKEN: $$DRONE_TOKEN
commands:
- tests/wait_until_previous_builds_complete.sh
vic:
image: golang:1.8
pull: true
environment:
BIN: bin
GOPATH: /drone
SHELL: /bin/bash
TEST_URL_ARRAY: $$TEST_URL_ARRAY
TEST_USERNAME: $$TEST_USERNAME
TEST_PASSWORD: $$TEST_PASSWORD
BUILD_NUMBER: $$BUILD_NUMBER
COMMIT: $$COMMIT
commands:
- make mark
- apt-get update
- apt-get install -yq time
- make -j3 all
- make sincemark
- make mark
- echo `ls vendor/github.com/vmware/govmomi/vim25/methods`
- echo `ls vendor/github.com/vmware/govmomi/vim25/types`
- echo `ls vendor/github.com/docker/docker/vendor/github.com/opencontainers/runc/libcontainer/system`
- export VIC_ESX_URL_ARRAY="`tests/get_test_url.sh`"
- make -j3 test
- make sincemark
integration-test-on-pr:
image: $${TEST_BUILD_IMAGE=gcr.io/eminent-nation-87317/vic-integration-test:1.22}
pull: true
privileged: true
environment:
BIN: bin
GOPATH: /drone
SHELL: /bin/bash
LOG_TEMP_DIR: install-logs
GITHUB_AUTOMATION_API_KEY: $$GITHUB_AUTOMATION_API_KEY
DRONE_SERVER: $$DRONE_SERVER
DRONE_TOKEN: $$DRONE_TOKEN
TEST_URL_ARRAY: $$TEST_URL_ARRAY
TEST_USERNAME: $$TEST_USERNAME
TEST_PASSWORD: $$TEST_PASSWORD
TEST_DATASTORE: $$TEST_DATASTORE
TEST_TIMEOUT: $$TEST_TIMEOUT
REPORTING_SERVER_URL: $$REPORTING_SERVER_URL
WINDOWS_URL: $$WINDOWS_URL
WINDOWS_USERNAME: $$WINDOWS_USERNAME
WINDOWS_PASSWORD: $$WINDOWS_PASSWORD
GOVC_INSECURE: true
GOVC_USERNAME: $$TEST_USERNAME
GOVC_PASSWORD: $$TEST_PASSWORD
GOVC_RESOURCE_POOL: $$TEST_RESOURCE
GOVC_DATASTORE: $$TEST_DATASTORE
GS_PROJECT_ID: $$GS_PROJECT_ID
GS_CLIENT_EMAIL: $$GS_CLIENT_EMAIL
GS_PRIVATE_KEY: $$GS_PRIVATE_KEY
DOMAIN: $$CI_DOMAIN
commands:
- make mark
- tests/integration-test.sh
- make sincemark
when:
success: true
vicui:
image: $${TEST_BUILD_IMAGE=gcr.io/eminent-nation-87317/vic-integration-test:1.22}
pull: true
environment:
BIN: bin
VICUI_SOURCE_PATH: "ui/vic-ui"
VICUI_H5_UI_PATH: "ui/vic-ui-h5c/vic"
VICUI_H5_SERVICE_PATH: "ui/vic-ui-h5c/vic-service"
BINTRAY_DOWNLOAD_PATH: "https://bintray.com/vmware/vic-repo/download_file?file_path="
SDK_PACKAGE_ARCHIVE: "vic-ui-sdk.tar.gz"
UI_INSTALLER_WIN_UTILS_ARCHIVE: "vic_installation_utils_win.tgz"
UI_INSTALLER_WIN_PATH: "ui/installer/vCenterForWindows"
ENV_VSPHERE_SDK_HOME: "/tmp/sdk/vc_sdk_min"
ENV_FLEX_SDK_HOME: "/tmp/sdk/flex_sdk_min"
ENV_HTML_SDK_HOME: "/tmp/sdk/html-client-sdk"
commands:
- make mark
- npm install -g yarn > /dev/null
- version=`$BIN/vic-machine-linux version`
- version=`echo $version | awk '{print $3}' | awk -F- '{print $1}' | cut -c 2-`
- sed "s/0.0.1/${version}/" ./$VICUI_SOURCE_PATH/plugin-package.xml > ./$VICUI_SOURCE_PATH/new_plugin-package.xml
- sed "s/1.0.0/${version}/" ./$VICUI_H5_UI_PATH/plugin-package.xml > ./$VICUI_H5_UI_PATH/new_plugin-package.xml
- sed "s/UI_VERSION_PLACEHOLDER/${version}/" ./$VICUI_H5_SERVICE_PATH/src/main/resources/configs.properties > ./$VICUI_H5_SERVICE_PATH/src/main/resources/new_configs.properties
- rm ./$VICUI_SOURCE_PATH/plugin-package.xml ./$VICUI_H5_UI_PATH/plugin-package.xml ./$VICUI_H5_SERVICE_PATH/src/main/resources/configs.properties
- mv ./$VICUI_SOURCE_PATH/new_plugin-package.xml ./$VICUI_SOURCE_PATH/plugin-package.xml
- mv ./$VICUI_H5_UI_PATH/new_plugin-package.xml ./$VICUI_H5_UI_PATH/plugin-package.xml
- mv ./$VICUI_H5_SERVICE_PATH/src/main/resources/new_configs.properties ./$VICUI_H5_SERVICE_PATH/src/main/resources/configs.properties
- wget -nv $BINTRAY_DOWNLOAD_PATH$SDK_PACKAGE_ARCHIVE -O /tmp/$SDK_PACKAGE_ARCHIVE
- wget -nv $BINTRAY_DOWNLOAD_PATH$UI_INSTALLER_WIN_UTILS_ARCHIVE -O /tmp/$UI_INSTALLER_WIN_UTILS_ARCHIVE
- tar --warning=no-unknown-keyword -xzf /tmp/$SDK_PACKAGE_ARCHIVE -C /tmp/
- ant -f ui/vic-ui/build-deployable.xml -Denv.VSPHERE_SDK_HOME=$ENV_VSPHERE_SDK_HOME -Denv.FLEX_HOME=$ENV_FLEX_SDK_HOME
- tar --warning=no-unknown-keyword -xzf /tmp/$UI_INSTALLER_WIN_UTILS_ARCHIVE -C $UI_INSTALLER_WIN_PATH
- ant -f ui/vic-ui-h5c/build-deployable.xml -Denv.VSPHERE_SDK_HOME=$ENV_VSPHERE_SDK_HOME -Denv.FLEX_HOME=$ENV_FLEX_SDK_HOME -Denv.VSPHERE_H5C_SDK_HOME=$ENV_HTML_SDK_HOME -Denv.BUILD_MODE=prod
- make sincemark
when:
success: true
bundle:
image: golang:1.8
pull: true
environment:
BIN: bin
BIN_TEMP_DIR: bin/vic
GOPATH: /drone
SHELL: /bin/bash
commands:
- make mark
- rm -rf $BIN_TEMP_DIR
- mkdir -p $BIN_TEMP_DIR/ui
- cp -rf ui/installer/* $BIN_TEMP_DIR/ui
- cp LICENSE $BIN_TEMP_DIR
- cp doc/bundle/README $BIN_TEMP_DIR
- cp $BIN/vic-machine* $BIN_TEMP_DIR
- cp $BIN/vic-ui* $BIN_TEMP_DIR
- cp $BIN/appliance.iso $BIN_TEMP_DIR
- cp $BIN/bootstrap.iso $BIN_TEMP_DIR
- tar czvf $BIN/vic_$$BUILD_NUMBER.tar.gz -C $BIN vic
- shasum -a 256 $BIN/vic_$$BUILD_NUMBER.tar.gz
- shasum -a 1 $BIN/vic_$$BUILD_NUMBER.tar.gz
- md5sum $BIN/vic_$$BUILD_NUMBER.tar.gz
- du -ks $BIN/vic_$$BUILD_NUMBER.tar.gz | awk '{print $1 / 1024}' | { read x; echo $x MB; }
- make sincemark
when:
repo: vmware/vic
branch: master
success: true
notify:
slack:
webhook_url: $$SLACK_URL
channel: mwilliamson-staff
username: drone
template: >
build https://ci.vmware.run/vmware/vic/{{ build.number }} finished with a {{ build.status }} status, find the logs here: https://console.cloud.google.com/m/cloudstorage/b/vic-ci-logs/o/integration_logs_{{ build.number }}_{{ build.commit }}.zip?authuser=1
when:
repo: vmware/vic
branch: master
failure: true
publish:
bintray:
username: $$BINTRAY_USERNAME
api_key: $$BINTRAY_API_KEY
artifacts:
- file: bin/vic_$$BUILD_NUMBER.tar.gz
owner: vmware
type: executable
repository: vic-repo
package: build
version: $$BUILD_NUMBER
target: vic_$$BUILD_NUMBER.tar.gz
publish: true
when:
repo: vmware/vic
branch: master
success: true
coverage:
server: https://coverage.vmware.run
token: $$GITHUB_AUTOMATION_API_KEY
include: /drone/src/github.com/vmware/vic/.cover/cover.out
when:
repo: vmware/vic
branch: master
success: true