Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Update publish-manager to be more non gcp friendly #48

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Run: `./scripts/publish-manager.sh`

#### Using Docker

Alternatively, run: `docker build -t <MY_REPOSITORY>/capd-manager:latest .`
Alternatively, run: `REGISTRY=<MY_REGISTRY> ./scripts/publish-manager.sh`

## Trying CAPD

Expand Down
14 changes: 10 additions & 4 deletions scripts/publish-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

readonly GCP_PROJECT=$(gcloud config get-value project)

set -o errexit
set -o xtrace

REGISTRY=$(gcloud config get-value project)
TAG=${TAG:-dev}
readonly IMAGE_NAME="capd-manager"

readonly GCR_REGISTRY="gcr.io/${GCP_PROJECT}"
readonly TAG=${TAG:-dev}

readonly REGISTRY=${REGISTRY:-$GCR_REGISTRY}

IMAGE="gcr.io/${REGISTRY}/capd-manager:${TAG}"
readonly IMAGE=${REGISTRY}/${IMAGE_NAME}:${TAG}

docker build --file Dockerfile -t "${IMAGE}" .
gcloud docker -- push "${IMAGE}"
docker push "${IMAGE}"