Skip to content

Instantly share code, notes, and snippets.

@maoueh
Created October 13, 2017 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maoueh/791e2f1bbc501abfdaeb47cfb7680f37 to your computer and use it in GitHub Desktop.
Save maoueh/791e2f1bbc501abfdaeb47cfb7680f37 to your computer and use it in GitHub Desktop.
docker_test:
steps:
- git::https://github.com/samsao/bitrise-step-macos-install-docker.git@feature/auto-export:
title: Install Docker
- script@1.1.3:
title: Build image
inputs:
- content: |-
#!/bin/bash
set -ex
docker-machine env default
echo ""
echo "Extracting variables"
docker-machine env default | while read -r line; do
[[ "$line" == "\#*" ]] && continue
# Prints line, using a regex, extract either key or value then assign to variable
key=`echo "$line" | sed 's/export \(.*\)="\(.*\)"/\1/'`
value=`echo "$line" | sed 's/export \(.*\)="\(.*\)"/\2/'`
echo "Exporting '$key'='$value' to envman"
done
mkdir -p ~/app
eval $(docker-machine env default)
cat << EOF > ~/app/Dockerfile
FROM node:8.1-slim
RUN npm install -g yarn@latest
EOF
docker build -f ~/app/Dockerfile -t gcr.io/yuzu-175518/something:0.0.1-beta.1 ~/app
docker login -u _json_key -p "$DOCKER_GCR_AUTH_JSON_KEY" https://gcr.io
docker push gcr.io/yuzu-175518/something:0.0.1-beta.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment