Skip to content

Commit

Permalink
Travis -> Cirrus: MacOS Cross test
Browse files Browse the repository at this point in the history
Also cleanup `Makefile` WRT `${DESTDIR}` definition and use to make it's
purpose more clear.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Apr 21, 2021
1 parent 5a3e8b6 commit a81cd74
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 66 deletions.
19 changes: 12 additions & 7 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,19 @@ validate_task:


cross_task:
# TODO: hack/travis_osx.sh doesn't work under cirrus-ci
# for some unknown reason. Remove the next line when
# fixed (remember to remove from .travis.yml also).
allow_failures: $CI == $CI
macos_instance:
image: catalina-xcode-11.3.1
brew_script: brew install gpgme go go-md2man
test_script: hack/travis_osx.sh
image: catalina-xcode
setup_script: |
export PATH=$GOPATH/bin:$PATH
brew install gpgme go go-md2man
go get -u golang.org/x/lint/golint
test_script: |
export PATH=$GOPATH/bin:$PATH
go version
go env
make validate-local test-unit-local bin/skopeo
sudo make install
/usr/local/bin/skopeo -v
#####
Expand Down
18 changes: 0 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ x_base_steps:

# Just declaration of stage order to run
stages:
# Test for local build
- local-build
# Build and push image for 1 architecture
- name: image-build-push
if: branch = master
Expand All @@ -52,22 +50,6 @@ stages:
# Actual execution of steps
jobs:
include:
# Run 2 local-build steps in parallel for osx and linux/amd64 platforms
- stage: local-build
<<: *local-build
name: local build for osx
os: osx
osx_image: xcode11.3
install:
# Ideally, the (brew update) should not be necessary and Travis would have fairly
# frequently updated OS images; that's not been the case historically.
# In particular, explicitly unlink python@2, which has been removed from Homebrew
# since the last OS image build (as of July 2020), but the Travis OS still
# contains it, and it prevents updating of Python 3.
- brew update && brew unlink python@2 && brew install gpgme
script:
- hack/travis_osx.sh

# Run 3 image-build-push tasks in parallel for linux/amd64, linux/s390x and linux/ppc64le platforms (for upstream and stable)
- stage: image-build-push
<<: *image-build-push
Expand Down
46 changes: 22 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
.PHONY: all binary build-container docs docs-in-container build-local clean install install-binary install-completions shell test-integration .install.vndr vendor vendor-in-container

export GOPROXY=https://proxy.golang.org
PREFIX ?= /usr/local

ifeq ($(shell uname),Darwin)
DARWIN_BUILD_TAG=
endif

# On some plaforms (eg. macOS, FreeBSD) gpgme is installed in /usr/local/ but /usr/local/include/ is
# not in the default search path. Rather than hard-code this directory, use gpgme-config.
# Sadly that must be done at the top-level user instead of locally in the gpgme subpackage, because cgo
# Sadly that must be done at the top-level user instead of locally in the gpgme subpackage, because cgo
# supports only pkg-config, not general shell scripts, and gpgme does not install a pkg-config file.
# If gpgme is not installed or gpgme-config can’t be found for other reasons, the error is silently ignored
# (and the user will probably find out because the cgo compilation will fail).
GPGME_ENV := CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS="$(shell gpgme-config --libs 2>/dev/null)"

CONTAINERSCONFDIR=/etc/containers
REGISTRIESDDIR=${CONTAINERSCONFDIR}/registries.d
SIGSTOREDIR=/var/lib/containers/sigstore
BINDIR=${PREFIX}/bin
MANDIR=${PREFIX}/share/man
BASHCOMPLETIONSDIR=${PREFIX}/share/bash-completion/completions
# Normally empty, DESTDIR can be used to relocate the entire install-tree
DESTDIR ?=
CONTAINERSCONFDIR ?= ${DESTDIR}/etc/containers
REGISTRIESDDIR ?= ${CONTAINERSCONFDIR}/registries.d
SIGSTOREDIR ?= ${DESTDIR}/var/lib/containers/sigstore
PREFIX ?= ${DESTDIR}/usr/local
BINDIR ?= ${PREFIX}/bin
MANDIR ?= ${PREFIX}/share/man
BASHCOMPLETIONSDIR ?= ${PREFIX}/share/bash-completion/completions

GO ?= go
GOBIN := $(shell $(GO) env GOBIN)
Expand Down Expand Up @@ -78,7 +76,7 @@ MANPAGES ?= $(MANPAGES_MD:%.md=%)

BTRFS_BUILD_TAG = $(shell hack/btrfs_tag.sh) $(shell hack/btrfs_installed_tag.sh)
LIBDM_BUILD_TAG = $(shell hack/libdm_tag.sh)
LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBDM_BUILD_TAG) $(DARWIN_BUILD_TAG)
LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBDM_BUILD_TAG)
BUILDTAGS += $(LOCAL_BUILD_TAGS)

ifeq ($(DISABLE_CGO), 1)
Expand Down Expand Up @@ -155,23 +153,23 @@ clean:
rm -rf bin docs/*.1

install: install-binary install-docs install-completions
install -d -m 755 ${DESTDIR}/${SIGSTOREDIR}
install -d -m 755 ${DESTDIR}/${CONTAINERSCONFDIR}
install -m 644 default-policy.json ${DESTDIR}/${CONTAINERSCONFDIR}/policy.json
install -d -m 755 ${DESTDIR}/${REGISTRIESDDIR}
install -m 644 default.yaml ${DESTDIR}/${REGISTRIESDDIR}/default.yaml
install -d -m 755 ${SIGSTOREDIR}
install -d -m 755 ${CONTAINERSCONFDIR}
install -m 644 default-policy.json ${CONTAINERSCONFDIR}/policy.json
install -d -m 755 ${REGISTRIESDDIR}
install -m 644 default.yaml ${REGISTRIESDDIR}/default.yaml

install-binary: bin/skopeo
install -d -m 755 ${DESTDIR}/${BINDIR}
install -m 755 bin/skopeo ${DESTDIR}/${BINDIR}/skopeo
install -d -m 755 ${BINDIR}
install -m 755 bin/skopeo ${BINDIR}/skopeo

install-docs: docs
install -d -m 755 ${DESTDIR}/${MANDIR}/man1
install -m 644 docs/*.1 ${DESTDIR}/${MANDIR}/man1
install -d -m 755 ${MANDIR}/man1
install -m 644 docs/*.1 ${MANDIR}/man1

install-completions:
install -m 755 -d ${DESTDIR}/${BASHCOMPLETIONSDIR}
install -m 644 completions/bash/skopeo ${DESTDIR}/${BASHCOMPLETIONSDIR}/skopeo
install -m 755 -d ${BASHCOMPLETIONSDIR}
install -m 644 completions/bash/skopeo ${BASHCOMPLETIONSDIR}/skopeo

shell: build-container
$(CONTAINER_RUN) bash
Expand Down
17 changes: 0 additions & 17 deletions hack/travis_osx.sh

This file was deleted.

0 comments on commit a81cd74

Please sign in to comment.