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

Avoid git add --all from make tag #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jglick
Copy link

@jglick jglick commented Nov 27, 2018

I was poking around in a JX-managed app and happened to look at the diff of a release tag commit, which surprised me:

diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..e3b86dd
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.0.16
diff --git a/charts/stuff/Chart.yaml b/charts/stuff/Chart.yaml
index feff70f..81b83a6 100644
--- a/charts/stuff/Chart.yaml
+++ b/charts/stuff/Chart.yaml
@@ -2,4 +2,4 @@ apiVersion: v1
 description: A Helm chart for Kubernetes
 icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/d273e09/images/go.png
 name: stuff
-version: 0.1.0-SNAPSHOT
+version: 0.0.16
diff --git a/charts/stuff/values.yaml b/charts/stuff/values.yaml
index c8c9c83..82d3e9a 100755
--- a/charts/stuff/values.yaml
+++ b/charts/stuff/values.yaml
@@ -4,7 +4,7 @@
 replicaCount: 1
 image:
   repository: jenkinsxio/stuff
-  tag: dev
+  tag: 0.0.16
   pullPolicy: IfNotPresent
 service:
   name: stuff
diff --git a/charts/stuff@tmp/durable-032b559b/jenkins-log.txt b/charts/stuff@tmp/durable-032b559b/jenkins-log.txt
new file mode 100644
index 0000000..35a605f
--- /dev/null
+++ b/charts/stuff@tmp/durable-032b559b/jenkins-log.txt
@@ -0,0 +1,4 @@
++ make tag
+sed -i -e "s/version:.*/version: 0.0.16/" Chart.yaml
+sed -i -e "s/tag: .*/tag: 0.0.16/" values.yaml
+git add --all
diff --git a/charts/stuff@tmp/durable-032b559b/script.sh b/charts/stuff@tmp/durable-032b559b/script.sh
new file mode 100755
index 0000000..3c3be81
--- /dev/null
+++ b/charts/stuff@tmp/durable-032b559b/script.sh
@@ -0,0 +1,2 @@
+#!/bin/sh -xe
+make tag
\ No newline at end of file

The @tmp stuff is an artifact of the Jenkinsfile using

dir ('/home/jenkins/go/src/github.com/…/…/charts/…') {
  sh "make tag"
}

rather than the simpler

dir ('/home/jenkins/go/src/github.com/…/…') {
  sh "make -C charts/… tag"
}

with the dir in fact collapsed with other nearby steps; though that seems to be different in the new buildpacks, the VERSION file is still supposed to just be a temporary file AFAICT. See jenkins-x/draft-packs#83 for discussion.

@@ -39,10 +39,10 @@ else ifeq ($(OS),Linux)
sed -i -e "s|repository: .*|repository: $(DOCKER_REGISTRY)\/REPLACE_ME_ORG\/REPLACE_ME_APP_NAME|" values.yaml
sed -i -e "s/tag: .*/tag: $(RELEASE_VERSION)/" values.yaml
else
echo "platfrom $(OS) not supported to release from"
echo "platform $(OS) not supported to release from"
Copy link
Author

Choose a reason for hiding this comment

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

Just a typo I noticed while I was here.

exit -1
endif
git add --all
git commit -m "release $(RELEASE_VERSION)" --allow-empty # if first release then no verion update is performed
git add *.yaml
Copy link
Author

Choose a reason for hiding this comment

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

The main fix.

git add --all
git commit -m "release $(RELEASE_VERSION)" --allow-empty # if first release then no verion update is performed
git add *.yaml
git commit -m "release $(RELEASE_VERSION)" --allow-empty # if first release then no version update is performed
Copy link
Author

Choose a reason for hiding this comment

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

Another typo.

@@ -2,7 +2,7 @@ CHART_REPO := http://jenkins-x-chartmuseum:8080
CURRENT=$(pwd)
NAME := REPLACE_ME_APP_NAME
OS := $(shell uname)
VERSION := $(shell cat ../../VERSION)
RELEASE_VERSION := $(shell cat ../../VERSION)
Copy link
Author

Choose a reason for hiding this comment

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

For some reason, the go pack is subtly different from all the rest. Starting to normalize that here. The other difference is $(NAME) vs. REPLACE_ME_APP_NAME below, though I was unsure whether it was proper to also normalize that.

else
echo "platfrom $(OS) not supported to tag with"
Copy link
Author

Choose a reason for hiding this comment

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

Another unexplained difference in the go pack.

@jglick
Copy link
Author

jglick commented Nov 27, 2018

Oh and there is no CI on this repo, so these changes are untested. I would have expected some kind of integration / smoke test that jx imports each of these in turn into some test cluster and makes sure basic stuff like promote works.

rawlingsj pushed a commit to rawlingsj/jenkins-x-kubernetes that referenced this pull request Feb 24, 2020
@jglick
Copy link
Author

jglick commented Mar 20, 2024

@jstrachan @rawlingsj I have not kept up but are there JX-related repos that should now be archived?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant