-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CI): Move release script out of travis config
- Loading branch information
Showing
2 changed files
with
41 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
# Build all releases for given tags and push them to Docker registry | ||
# ------------------------------------------------------------------ | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 environment" | ||
echo "Example: $0 staging" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$DOCKER_USERNAME" ] || [ -z "$DOCKER_PASSWORD" ]; then | ||
echo "[Warning] Docker credentials not provided. You must be logged in to push to registry." | ||
fi | ||
|
||
set -e | ||
|
||
# ---- Images names ---- | ||
CF_API_REST_IMAGE: captainfact/rest-api:$1 | ||
CF_API_GRAPHQL_IMAGE: captainfact/graphql-api:$1 | ||
CF_API_ATOM_FEED: captainfact/atom-feed:$1 | ||
CF_API_OPENGRAPH_IMAGE: captainfact/opengraph:$1 | ||
CF_API_JOBS_IMAGE: captainfact/jobs:$1 | ||
|
||
# ---- Build ---- | ||
echo "[RELEASE] Building Apps 馃敤" | ||
docker build --build-arg APP=cf_rest_api -t ${CF_API_REST_IMAGE} . | ||
docker build --build-arg APP=cf_graphql -t ${CF_API_GRAPHQL_IMAGE} . | ||
docker build --build-arg APP=cf_atom_feed -t ${CF_API_ATOM_FEED} . | ||
docker build --build-arg APP=cf_opengraph -t ${CF_API_OPENGRAPH_IMAGE} . | ||
docker build --build-arg APP=cf_jobs -t ${CF_API_JOBS_IMAGE} . | ||
|
||
# ---- Push release ---- | ||
echo "[RELEASE] Pushing Apps 馃殌" | ||
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; | ||
docker push $CF_API_REST_IMAGE | ||
docker push $CF_API_GRAPHQL_IMAGE | ||
docker push $CF_API_ATOM_FEED | ||
docker push $CF_API_OPENGRAPH_IMAGE | ||
docker push $CF_API_JOBS_IMAGE |