Skip to content

Commit

Permalink
Pull prebuilt gce_export instead of building in export workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
adjackura committed Jan 10, 2018
1 parent 45bcacb commit 356d5e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion daisy_release_cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ steps:
args: ['build', '-o=windows/gce_export.exe', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/gce_export']
env: ['GOOS=windows']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=windows/import_precheck.exe', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/import_precheck]
args: ['build', '-o=windows/import_precheck.exe', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/import_precheck']
env: ['GOOS=windows']
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', './windows/*', 'gs://compute-image-tools/release/windows/']
Expand Down
16 changes: 4 additions & 12 deletions daisy_workflows/export/export_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.

echo "Installing necessary packages..."
apt-get update
apt-get -q -y install git-core

function exit_error
{
echo "export failed"
exit 1
}

wget --quiet https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz || exit_error
tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz || exit_error
export PATH=$PATH:/usr/local/go/bin
export GOPATH=~/go
export PATH=$PATH:~/go/bin
go get -t -v github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/gce_export || exit_error
wget --quiet https://storage.googleapis.com/compute-image-tools/release/linux/gce_export || exit_error
chmod +x ./gce_export

URL="http://metadata/computeMetadata/v1/instance/attributes"
GCS_PATH=$(curl -f -H Metadata-Flavor:Google ${URL}/gcs-path)
LICENSES=$(curl -f -H Metadata-Flavor:Google ${URL}/licenses)

echo "Uploading image."
if [[ -n $LICENSES ]]; then
gce_export -gcs_path "$GCS_PATH" -disk /dev/sdb -licenses "$LICENSES" -y || exit_error
./gce_export -gcs_path "$GCS_PATH" -disk /dev/sdb -licenses "$LICENSES" -y || exit_error
else
gce_export -gcs_path "$GCS_PATH" -disk /dev/sdb -y || exit_error
./gce_export -gcs_path "$GCS_PATH" -disk /dev/sdb -y || exit_error
fi

echo "export success"

0 comments on commit 356d5e2

Please sign in to comment.