Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #457

Merged
merged 15 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builds:
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`.

brews:
- github:
- repository:
owner: wagoodman
name: homebrew-dive
homepage: "https://github.com/wagoodman/dive/"
Expand All @@ -37,7 +37,7 @@ nfpms:

dockers:
-
binaries:
ids:
- dive
dockerfile: Dockerfile
# todo: on 1.0 remove 'v' prefix
Expand Down
27 changes: 16 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BUILD_DIR = ./dist/dive_linux_amd64
BUILD_PATH = $(BUILD_DIR)/$(BIN)
PWD := ${CURDIR}
PRODUCTION_REGISTRY = docker.io
SHELL = /bin/bash -o pipefail
TEST_IMAGE = busybox:latest

all: gofmt clean build
Expand All @@ -19,10 +20,12 @@ ci-static-analysis:
golangci-lint run

ci-install-go-tools:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sudo sh -s -- -b /usr/local/bin/ latest
mkdir -p ${HOME}/.local/bin
curl -sfL https://goreleaser.com/static/run > ${HOME}/.local/bin/goreleaser
chmod +x ${HOME}/.local/bin/goreleaser

ci-install-ci-tools:
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sudo sh -s -- -b /usr/local/bin/ "v0.122.0"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${HOME}/.local/bin/

ci-docker-login:
echo '${DOCKER_PASSWORD}' | docker login -u '${DOCKER_USERNAME}' --password-stdin '${PRODUCTION_REGISTRY}'
Expand All @@ -31,16 +34,16 @@ ci-docker-logout:
docker logout '${PRODUCTION_REGISTRY}'

ci-publish-release:
goreleaser --rm-dist
goreleaser --clean

ci-build-snapshot-packages:
goreleaser \
--snapshot \
--skip-publish \
--rm-dist
--clean

ci-release:
goreleaser release --rm-dist
goreleaser release --clean

# todo: add --pull=never when supported by host box
ci-test-production-image:
Expand Down Expand Up @@ -87,18 +90,20 @@ ci-test-rpm-package-install:
"

ci-test-linux-run:
chmod 755 ./dist/dive_linux_amd64/dive && \
./dist/dive_linux_amd64/dive '${TEST_IMAGE}' --ci && \
./dist/dive_linux_amd64/dive --source docker-archive .data/test-kaniko-image.tar --ci --ci-config .data/.dive-ci
ls -la ./dist
ls -la ./dist/dive_linux_amd64_v1
chmod 755 ./dist/dive_linux_amd64_v1/dive && \
./dist/dive_linux_amd64_v1/dive '${TEST_IMAGE}' --ci && \
./dist/dive_linux_amd64_v1/dive --source docker-archive .data/test-kaniko-image.tar --ci --ci-config .data/.dive-ci

# we're not attempting to test docker, just our ability to run on these systems. This avoids setting up docker in CI.
ci-test-mac-run:
chmod 755 ./dist/dive_darwin_amd64/dive && \
./dist/dive_darwin_amd64/dive --source docker-archive .data/test-docker-image.tar --ci --ci-config .data/.dive-ci
chmod 755 ./dist/dive_darwin_amd64_v1/dive && \
./dist/dive_darwin_amd64_v1/dive --source docker-archive .data/test-docker-image.tar --ci --ci-config .data/.dive-ci

# we're not attempting to test docker, just our ability to run on these systems. This avoids setting up docker in CI.
ci-test-windows-run:
./dist/dive_windows_amd64/dive --source docker-archive .data/test-docker-image.tar --ci --ci-config .data/.dive-ci
./dist/dive_windows_amd64_v1/dive --source docker-archive .data/test-docker-image.tar --ci --ci-config .data/.dive-ci



Expand Down