diff --git a/.cirrus.yml b/.cirrus.yml index d9b9e9dd..fa9f0462 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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 ##### diff --git a/.travis.yml b/.travis.yml index e78c8f71..c56a3909 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 diff --git a/Makefile b/Makefile index 1b46851c..6bacd12e 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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) @@ -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 diff --git a/hack/travis_osx.sh b/hack/travis_osx.sh deleted file mode 100755 index 9397a14c..00000000 --- a/hack/travis_osx.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -e - -export GOPATH=$(pwd)/_gopath -export PATH=$GOPATH/bin:$PATH - -_containers="${GOPATH}/src/github.com/containers" -mkdir -vp ${_containers} -ln -vsf $(pwd) ${_containers}/skopeo - -go version -GO111MODULE=off go get -u github.com/cpuguy83/go-md2man golang.org/x/lint/golint - -cd ${_containers}/skopeo -make validate-local test-unit-local bin/skopeo -sudo make install -skopeo -v