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

Push image build in from PR #136

Closed
Closed
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ push: image ## Pushes the container image to the registry
$(call check_defined, REGISTRY_USER, "You need to pass the registry user via REGISTRY_USER.")
$(call check_defined, REGISTRY_PASSWORD, "You need to pass the registry password via REGISTRY_PASSWORD.")
docker login -u $(REGISTRY_USER) -p $(REGISTRY_PASSWORD) $(REGISTRY_URI)
docker push $(REGISTRY_URL):latest
[ -n "$(LATEST)" ] && docker push $(REGISTRY_URL):latest || echo "Not pushing into latest tag"
docker tag $(REGISTRY_URL):latest $(REGISTRY_URL):$(IMAGE_TAG)
docker push $(REGISTRY_URL):$(IMAGE_TAG)
echo "Pushed: $(REGISTRY_URL):$(IMAGE_TAG)"

tools: tools.timestamp

Expand Down
7 changes: 5 additions & 2 deletions cico_build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -e
# None
###################################################################################
function setup_build_environment() {
[ -f jenkins-env ] && cat jenkins-env | grep -e GIT -e DEVSHIFT -e JOB_NAME > inherit-env
[ -f jenkins-env ] && cat jenkins-env | grep -e GIT -e DEVSHIFT -e JOB_NAME -e ghprbPullId > inherit-env
[ -f inherit-env ] && . inherit-env

# We need to disable selinux for now, XXX
Expand Down Expand Up @@ -63,5 +63,8 @@ make all

if [[ "$JOB_NAME" = "devtools-fabric8-jenkins-proxy-build-master" ]]; then
TAG=$(echo ${GIT_COMMIT} | cut -c1-${DEVSHIFT_TAG_LEN})
make push REGISTRY_USER=${DEVSHIFT_USERNAME} REGISTRY_PASSWORD=${DEVSHIFT_PASSWORD} IMAGE_TAG=${TAG} LATEST=true
elif [[ "$JOB_NAME" = "devtools-fabric8-jenkins-proxy" ]]; then
TAG="PR${ghprbPullId}"
make push REGISTRY_USER=${DEVSHIFT_USERNAME} REGISTRY_PASSWORD=${DEVSHIFT_PASSWORD} IMAGE_TAG=${TAG}
fi
fi