Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker base and CircleCI updates #3045

Merged
merged 3 commits into from
Oct 6, 2017
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
8 changes: 2 additions & 6 deletions .circleci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ set -e
DOCKER_NAMESPACE=${DOCKER_NAMESPACE:-"reactioncommerce/reaction"}

# if we're not on a deployment branch or a Docker related PR branch, skip the Docker build/test
if [[ "$CIRCLE_BRANCH" != "master" && \
"$CIRCLE_BRANCH" != "development" && \
"$CIRCLE_BRANCH" != *"docker"* && \
"$CIRCLE_BRANCH" != "marketplace" ]]; # TODO: remove this once marketplace is merged
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I wait to merge this until after we've released 1.5.0?

Copy link
Contributor Author

@jshimko jshimko Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression the release-1.5.0 branch is marketplace. No?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way, this will have no effect on whether marketplace continues to build in CI unless you merge release-1.5.0 back into marketplace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we definitely want this to be part of the 1.5.0 release. The current Docker base isn't using the current 4.x version of Node that we should be (4.8.4).

then
echo "Not running a deployment branch. Skipping the Docker build test."
if [[ "$CIRCLE_BRANCH" != "master" && "$CIRCLE_BRANCH" != *"docker"* ]]; then
echo "Not running a build branch. Skipping the Docker build test."
exit 0
fi

Expand Down
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
- DOCKER_VERSION: 17.05.0-ce
- DOCKER_COMPOSE_VERSION: 1.15.0
- METEOR_ALLOW_SUPERUSER: true
- TOOL_NODE_FLAGS: "--max-old-space-size=4096"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any further reference on the memory issue / fix here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no update on the memory usage of the Meteor build tool. I think the real solution is just building a smaller app. And that's one of the focuses of our upcoming performance work on Reaction.


steps:
- setup_remote_docker
Expand Down
26 changes: 2 additions & 24 deletions .circleci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,17 @@
#
# $DOCKER_USER - Docker Hub username
# $DOCKER_PASS - Docker Hub password
# $DOCKER_EMAIL - Docker Hub email


## Optional Environment Variables
# (used to customize the destination on Docker Hub without having to edit the CircleCI config)
#
# $DOCKER_NAMESPACE - the image name for production deployments [Default]: reactioncommerce/reaction
# $DOCKER_NAMESPACE_DEV - the image name for development deployments [Default]: reactioncommerce/prequel


if [[ "$CIRCLE_BRANCH" != "master" && "$CIRCLE_BRANCH" != "development" ]]; then
if [[ "$CIRCLE_BRANCH" != "master" ]]; then
echo "Not running a deployment branch."
exit 0
fi


## Development
if [[ "$CIRCLE_BRANCH" == "development" ]]; then
set -e

DOCKER_NAMESPACE=${DOCKER_NAMESPACE:-"reactioncommerce/reaction"}
DOCKER_NAMESPACE_DEV=${DOCKER_NAMESPACE_DEV:-"reactioncommerce/prequel"}

docker tag $DOCKER_NAMESPACE:latest $DOCKER_NAMESPACE_DEV:latest
docker tag $DOCKER_NAMESPACE_DEV:latest $DOCKER_NAMESPACE_DEV:$CIRCLE_BUILD_NUM

docker login -u $DOCKER_USER -p $DOCKER_PASS

docker push $DOCKER_NAMESPACE_DEV:$CIRCLE_BUILD_NUM
docker push $DOCKER_NAMESPACE_DEV:latest
fi


# Master branch deployment (only runs when a version git tag exists - syntax: "v1.2.3")
if [[ "$CIRCLE_BRANCH" == "master" ]]; then
VERSION=$(git describe --tags | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. how do you guys handle tagging releases such as patch, hotfix, & the like?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tag release versions in the format v1.2.3. Doing so triggers a tagged release to Docker Hub.

Expand All @@ -49,7 +27,7 @@ if [[ "$CIRCLE_BRANCH" == "master" ]]; then

docker tag $DOCKER_NAMESPACE:latest $DOCKER_NAMESPACE:$VERSION

docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
docker login -u $DOCKER_USER -p $DOCKER_PASS

docker push $DOCKER_NAMESPACE:$VERSION
docker push $DOCKER_NAMESPACE:latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM reactioncommerce/base:v2.1.3
FROM reactioncommerce/base:v2.2.0

# Default environment variables
ENV ROOT_URL "http://localhost"
Expand Down