Commit 0c436485 authored by Tomasz Maczukin's avatar Tomasz Maczukin 🌴

Allow to build development version of DEB, RPM and Docker with make

parent ceb97625
......@@ -119,6 +119,18 @@ build_simple: $(GOPATH_SETUP)
build_current: docker build_simple
build_current_docker: RUNNER_BINARY ?= out/binaries/$(NAME)
build_current_docker: build_current_deb
make release_docker_images RUNNER_BINARY=$(RUNNER_BINARY)
build_current_deb: RUNNER_BINARY ?= out/binaries/$(NAME)
build_current_deb: build_current package-deps package-prepare
make package-deb-fpm ARCH=amd64 PACKAGE_ARCH=amd64 RUNNER_BINARY=$(RUNNER_BINARY)
build_current_rpm: RUNNER_BINARY ?= out/binaries/$(NAME)
build_current_rpm: build_current package-deps package-prepare
make package-rpm-fpm ARCH=amd64 PACKAGE_ARCH=amd64 RUNNER_BINARY=$(RUNNER_BINARY)
check_race_conditions:
@./scripts/check_race_conditions $(OUR_PACKAGES)
......@@ -212,6 +224,7 @@ package-rpm: package-deps package-prepare
make package-rpm-fpm ARCH=arm PACKAGE_ARCH=arm
make package-rpm-fpm ARCH=arm PACKAGE_ARCH=armhf
package-deb-fpm: RUNNER_BINARY ?= out/binaries/$(NAME)-linux-$(ARCH)
package-deb-fpm:
@mkdir -p out/deb/
fpm -s dir -t deb -n $(PACKAGE_NAME) -v $(VERSION) \
......@@ -238,13 +251,14 @@ package-deb-fpm:
--deb-suggests docker-engine \
-a $(PACKAGE_ARCH) \
packaging/root/=/ \
out/binaries/$(NAME)-linux-$(ARCH)=/usr/lib/gitlab-runner/gitlab-runner \
$(RUNNER_BINARY)=/usr/lib/gitlab-runner/gitlab-runner \
out/helper-images/=/usr/lib/gitlab-runner/helper-images/
@if [ -n "$(GPG_KEYID)" ]; then \
dpkg-sig -g "--no-tty --digest-algo 'sha512' --passphrase '$(GPG_PASSPHRASE)'" \
-k $(GPG_KEYID) --sign builder "out/deb/$(PACKAGE_NAME)_$(PACKAGE_ARCH).deb" ;\
fi
package-rpm-fpm: RUNNER_BINARY ?= out/binaries/$(NAME)-linux-$(ARCH)
package-rpm-fpm:
@mkdir -p out/rpm/
fpm -s dir -t rpm -n $(PACKAGE_NAME) -v $(VERSION) \
......@@ -268,7 +282,7 @@ package-rpm-fpm:
--depends tar \
-a $(PACKAGE_ARCH) \
packaging/root/=/ \
out/binaries/$(NAME)-linux-$(ARCH)=/usr/lib/gitlab-runner/gitlab-runner \
$(RUNNER_BINARY)=/usr/lib/gitlab-runner/gitlab-runner \
out/helper-images/=/usr/lib/gitlab-runner/helper-images/
@if [ -n "$(GPG_KEYID)" ] ; then \
echo "yes" | setsid rpm \
......@@ -348,6 +362,7 @@ prepare_index:
# Preparing index file
@./ci/prepare_index
release_docker_images: RUNNER_BINARY ?= out/binaries/gitlab-runner-linux-amd64
release_docker_images:
# Releasing Docker images
@./ci/release_docker_images
......
......@@ -2,6 +2,13 @@
set -eo pipefail
DOCKER_MACHINE_VERSION=${DOCKER_MACHINE_VERSION:-0.14.0}
DOCKER_MACHINE_CHECKSUM=${DOCKER_MACHINE_CHECKSUM:-a4c69bffb78d3cfe103b89dae61c3ea11cc2d1a91c4ff86e630c9ae88244db02}
DUMB_INIT_VERSION=${DUMB_INIT_VERSION:-1.0.2}
DUMB_INIT_CHECKSUM=${DUMB_INIT_CHECKSUM:-a8defac40aaca2ca0896c7c5adbc241af60c7c3df470c1a4c469a860bd805429}
RUNNER_BINARY=${RUNNER_BINARY:-out/binaries/gitlab-runner-linux-amd64}
IS_LATEST=${IS_LATEST:-}
ref_tag=${CI_COMMIT_TAG}
......@@ -91,13 +98,14 @@ logout() {
_docker logout "${1}"
}
echo -n > dockerfiles/checksums
echo "${DOCKER_MACHINE_CHECKSUM} /usr/bin/docker-machine" >> dockerfiles/checksums
echo "${DUMB_INIT_CHECKSUM} /usr/bin/dumb-init" >> dockerfiles/checksums
cat dockerfiles/checksums
cp out/deb/gitlab-runner_amd64.deb dockerfiles/ubuntu/
cp out/deb/gitlab-runner_amd64.deb dockerfiles/ubuntu/gitlab-runner_amd64.deb
cp dockerfiles/checksums dockerfiles/ubuntu
cp out/binaries/gitlab-runner-linux-amd64 dockerfiles/alpine
cp ${RUNNER_BINARY} dockerfiles/alpine/gitlab-runner-linux-amd64
cp dockerfiles/checksums dockerfiles/alpine
build "gitlab/gitlab-runner:ubuntu-${ref_tag}" dockerfiles/ubuntu
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment