Skip to content

Commit

Permalink
drone(docker-driver): Fetch tags before pushing image during release (#…
Browse files Browse the repository at this point in the history
…10664)

**What this PR does / why we need it**:
We realized, loki-docker-driver image was not being pushed after 2.8.2.
And looking into it's drone pipeline and comparing it with other steps,
docker-driver step is not fetching the tags,[ thus the final hash
calculated to push is some HEAD
branch.](https://github.com/grafana/loki/blob/main/tools/image-tag#L13-L14)

e.g: even if we have tag 2.9.1, it pushes only with latest HEAD commit
hash.

This PR fixes it.
![Screenshot 2023-09-21 at 08 14
09](https://github.com/grafana/loki/assets/3735252/31e4d031-d22f-4bed-8aa7-3e6136a6f10c)
![Screenshot 2023-09-21 at 08 14
24](https://github.com/grafana/loki/assets/3735252/1742b821-58a3-4ef5-96ae-80304126b8cb)
![Screenshot 2023-09-21 at 08 14
42](https://github.com/grafana/loki/assets/3735252/5e060eeb-e57a-4124-b29b-bc8ce73cc6d9)

**Which issue(s) this PR fixes**:
Fixes #<issue number>

**Special notes for your reviewer**:
I would prefer this instead of
#10663. Because that would make
fetching tags more repetitive in all the drone tasks (can also be
expensive in terms of running time if we put all together)

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)

---------

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
  • Loading branch information
kavirajk authored Sep 21, 2023
1 parent 446502b commit 8721e41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ local logql_analyzer() = pipeline('logql-analyzer') + arch_image('amd64') {
depends_on: ['check'],
};


local multiarch_image(arch) = pipeline('docker-' + arch) + arch_image(arch) {
steps+: [
// dry run for everything that is not tag or main
Expand Down Expand Up @@ -917,6 +916,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
DOCKER_PASSWORD: { from_secret: docker_password_secret.name },
},
commands: [
'git fetch origin --tags',
'make docker-driver-push',
],
volumes: [
Expand Down
3 changes: 2 additions & 1 deletion .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,7 @@ kind: pipeline
name: docker-driver
steps:
- commands:
- git fetch origin --tags
- make docker-driver-push
depends_on:
- clone
Expand Down Expand Up @@ -2016,6 +2017,6 @@ kind: secret
name: gpg_private_key
---
kind: signature
hmac: 6aff5ae73eeaed171dafbc08b599abaf9a4ef4c1d68212da1a1442f36f5c7d8b
hmac: 93e04a0de03da46eb44ad99732caf328ff578d627473c6ccf3bed8401d03f666

...

0 comments on commit 8721e41

Please sign in to comment.