Selective releasing (#708)

* Rejig the build process

During a build, we check and rebuild any dependencies prior to
potentially using them.

Build:
- DIND (this only produces a new docker image, no local code changes)
- fnserver (built as part of the testing)

On master, if everything works, then we release the built artifacts,
if necessary:
- DIND (this pushes a docker image and a tag)
- fnserver (this builds the docker image and releases it, if necessary).

Fnserver is dealt with last by the release script: all previous steps
in CI use locally-run go tests rather than a docker file.

When a commit happens, we need to know (a) if we need to rebuild
a set of tools and artifacts (or whether we can continue to use
published ones); and (b) if we need to release new versions of
those tools, if all tests pass.

We do this by identifying the previous release tag on origin/master
(which is the release branch), then checking for changes between
that point at the current one.

Those changes may appear in various places in the tree: some simple
boolean rules work out whether the change means we need to rebuild
and rerelease.

* Make the fnproject/fnserver build use the latest dind

As docker bumps from 17.12.x, use whatever dind we just built.

* Use bash
This commit is contained in:
jan grant
2018-02-01 12:43:43 +00:00
committed by GitHub
parent 45675bc36d
commit 025e598c4b
7 changed files with 127 additions and 22 deletions

View File

@@ -15,27 +15,15 @@ else
exit 1
fi
git pull
version_file="api/version/version.go"
if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then
echo "did not find semantic version in $version_file"
exit 1
fi
perl -i -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file)
echo "Version: $version"
make docker-build
git add -u
git commit -m "$image: $version release [skip ci]"
git tag -f -a "$version" -m "version $version"
# Push the version bump and tags laid down previously
gtag=$image-$version
git push
git push origin $version
# Finally tag and push docker images
docker tag $user/$image:latest $user/$image:$version
# Finally, push docker images
docker push $user/$image:$version
docker push $user/$image:latest