Skip to content

Commit

Permalink
Fix release tag and docker pull for export. (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmarano authored Mar 1, 2018
1 parent ac5439e commit 183e384
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions daisy_release_cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/gce_image_publish:release', '--tag=gcr.io/$PROJECT_ID/gce_image_publish:$COMMIT_SHA', '--file=Dockerfile.gce_image_publish', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/gce_export:latest', '--tag=gcr.io/$PROJECT_ID/gce_export:$COMMIT_SHA', '--file=Dockerfile.gce_export', '.']
args: ['build', '--tag=gcr.io/$PROJECT_ID/gce_export:release', '--tag=gcr.io/$PROJECT_ID/gce_export:$COMMIT_SHA', '--file=Dockerfile.gce_export', '.']

# Build Windows binaries.
- name: 'gcr.io/cloud-builders/go'
Expand Down Expand Up @@ -75,5 +75,5 @@ images:
- 'gcr.io/$PROJECT_ID/daisy:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/gce_image_publish:release'
- 'gcr.io/$PROJECT_ID/gce_image_publish:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/gce_export:latest'
- 'gcr.io/$PROJECT_ID/gce_export:release'
- 'gcr.io/$PROJECT_ID/gce_export:$COMMIT_SHA'
17 changes: 9 additions & 8 deletions daisy_workflows/export/export_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Wait for GCR to be available.
until eval curl -o /dev/null -s https://gcr.io/ ; do sleep 1; done

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)
IMAGE=$(curl -f -H Metadata-Flavor:Google ${URL}/image)

echo "GCEExport: Pulling export tool." > /dev/ttyS0
docker pull $IMAGE > /dev/ttyS0 2>&1
if [ $? -ne 0 ]; then
echo "GCEExport: 'docker pull' of ${IMAGE} failed, 'docker run' will attempt to pull image once more..." > /dev/ttyS0
fi
# Pull the docker image.
while true; do
echo "GCEExport: Pulling export tool." > /dev/ttyS0
docker pull $IMAGE > /dev/ttyS0 2>&1
if [ $? -eq 0 ]; then
break
fi
sleep 1
done

echo "GCEExport: Running export tool." > /dev/ttyS0
if [[ -n $LICENSES ]]; then
Expand Down

0 comments on commit 183e384

Please sign in to comment.