diff --git a/docker/Dockerfile.agent.linux.amd64 b/docker/Dockerfile.agent.linux.amd64 index 14f657bc..76060ba6 100644 --- a/docker/Dockerfile.agent.linux.amd64 +++ b/docker/Dockerfile.agent.linux.amd64 @@ -11,4 +11,6 @@ ADD release/linux/amd64/drone-agent /bin/ COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +LABEL com.centurylinklabs.watchtower.stop-signal="SIGINT" + ENTRYPOINT ["/bin/drone-agent"] diff --git a/docker/Dockerfile.agent.linux.arm b/docker/Dockerfile.agent.linux.arm index b6430593..47f0d615 100644 --- a/docker/Dockerfile.agent.linux.arm +++ b/docker/Dockerfile.agent.linux.arm @@ -7,4 +7,6 @@ ENV DRONE_RUNNER_CAPACITY=1 ENV DRONE_RUNNER_VARIANT=v7 ADD release/linux/arm/drone-agent /bin/ +LABEL com.centurylinklabs.watchtower.stop-signal="SIGINT" + ENTRYPOINT ["/bin/drone-agent"] diff --git a/docker/Dockerfile.agent.linux.arm64 b/docker/Dockerfile.agent.linux.arm64 index 24b9898e..04ba0154 100644 --- a/docker/Dockerfile.agent.linux.arm64 +++ b/docker/Dockerfile.agent.linux.arm64 @@ -7,4 +7,6 @@ ENV DRONE_RUNNER_CAPACITY=1 ENV DRONE_RUNNER_VARIANT=v8 ADD release/linux/arm64/drone-agent /bin/ +LABEL com.centurylinklabs.watchtower.stop-signal="SIGINT" + ENTRYPOINT ["/bin/drone-agent"] diff --git a/docker/Dockerfile.agent.windows.1803 b/docker/Dockerfile.agent.windows.1803 index d77002eb..1ba62bcb 100644 --- a/docker/Dockerfile.agent.windows.1803 +++ b/docker/Dockerfile.agent.windows.1803 @@ -8,5 +8,7 @@ ENV DRONE_RUNNER_PLATFORM=windows/amd64 ENV DRONE_RUNNER_KERNEL=1803 ENV DRONE_RUNNER_CAPACITY=1 +LABEL com.centurylinklabs.watchtower.stop-signal="SIGINT" + ADD release/windows/1803/amd64/drone-agent.exe C:/drone-agent.exe ENTRYPOINT [ "C:\\drone-agent.exe" ] diff --git a/docker/Dockerfile.agent.windows.1809 b/docker/Dockerfile.agent.windows.1809 index 3ce674d0..e2e0d294 100644 --- a/docker/Dockerfile.agent.windows.1809 +++ b/docker/Dockerfile.agent.windows.1809 @@ -8,5 +8,7 @@ ENV DRONE_RUNNER_PLATFORM=windows/amd64 ENV DRONE_RUNNER_KERNEL=1809 ENV DRONE_RUNNER_CAPACITY=1 +LABEL com.centurylinklabs.watchtower.stop-signal="SIGINT" + ADD release/windows/1809/amd64/drone-agent.exe C:/drone-agent.exe ENTRYPOINT [ "C:\\drone-agent.exe" ] diff --git a/store/repos/repos.go b/store/repos/repos.go index 5aea6ebd..f6c9be52 100644 --- a/store/repos/repos.go +++ b/store/repos/repos.go @@ -435,6 +435,18 @@ WHERE repo_id = :repo_id AND repo_version = :repo_version_old ` +// TODO(bradrydzewski) this query needs performance tuning. +// one approach that is promising is the ability to use the +// repo_counter (latest build number) to join on the build +// table. +// +// FROM repos LEFT OUTER JOIN builds ON ( +// repos.repo_id = builds.build_repo_id AND +// builds.build_number = repos.repo_counter +// ) +// INNER JOIN perms ON perms.perm_repo_uid = repos.repo_uid +// + const queryRepoWithBuild = queryColsBulds + ` FROM repos LEFT OUTER JOIN builds ON build_id = ( SELECT build_id FROM builds