Skip to content

Commit

Permalink
Use ToBAC-style date tagging for versioning instead of serial numbers…
Browse files Browse the repository at this point in the history
…, working around CircleCI and Github limitations
  • Loading branch information
kimtore committed Jan 16, 2019
1 parent bf05da3 commit 4bdda03
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 28 deletions.
27 changes: 7 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
release:
<<: *defaults
steps:
- add_ssh_keys:
fingerprints:
- "72:ed:2d:92:44:25:d6:ce:b0:c8:3b:e8:27:32:4c:59"
- setup_remote_docker
- checkout
- add_ssh_keys:
fingerprints:
- "23:30:b7:2a:e9:44:5f:d9:d0:fd:e9:ce:7b:1d:0a:96"
- attach_workspace:
at: /tmp/workspace
- run:
Expand All @@ -38,30 +38,17 @@ jobs:
- run:
name: Login to Dockerhub
command: docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
- run:
name: Bump version
command: ./bump.sh
- run:
name: Release new version
command: |
version=$(cat version)
git commit version -m "Release version ${version} [skip ci]"
git tag ${version}
git push
git push --tags
- run:
name: Push Docker container
command: |
docker tag navikt/naiserator:latest navikt/naiserator:$(cat version)
version=$(./version.sh)
docker tag navikt/naiserator:latest navikt/naiserator:${version}
docker push navikt/naiserator:latest
docker push navikt/naiserator:$(cat version)
- add_ssh_keys:
fingerprints:
- "23:30:b7:2a:e9:44:5f:d9:d0:fd:e9:ce:7b:1d:0a:96"
docker push navikt/naiserator:${version}
- run:
name: Deploy new version to Kubernetes
command: |
version=$(cat version)
version=$(./version.sh)
naisyaml=$(mktemp -d)
res="hack/resources"
static_file="${naisyaml}/templates/zz-generated-naiserator.yaml"
Expand Down
7 changes: 0 additions & 7 deletions bump.sh

This file was deleted.

1 change: 0 additions & 1 deletion version

This file was deleted.

7 changes: 7 additions & 0 deletions version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
dirty=""
test -z "$(git ls-files --exclude-standard --others)"
if [ $? -ne 0 ]; then
dirty="-dirty"
fi
echo $(date "+%Y-%m-%d")-$(git --no-pager log -1 --pretty=%h)${dirty}

0 comments on commit 4bdda03

Please sign in to comment.