mirror of
https://github.com/containers/skopeo.git
synced 2025-08-09 02:17:39 +00:00
Travis -> Cirrus: MacOS Cross test
Also cleanup `Makefile` WRT `${DESTDIR}` definition and use to make it's purpose more clear. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
parent
5a3e8b6150
commit
a81cd74734
19
.cirrus.yml
19
.cirrus.yml
@ -65,14 +65,19 @@ validate_task:
|
|||||||
|
|
||||||
|
|
||||||
cross_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:
|
macos_instance:
|
||||||
image: catalina-xcode-11.3.1
|
image: catalina-xcode
|
||||||
brew_script: brew install gpgme go go-md2man
|
setup_script: |
|
||||||
test_script: hack/travis_osx.sh
|
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
|
||||||
|
|
||||||
|
|
||||||
#####
|
#####
|
||||||
|
18
.travis.yml
18
.travis.yml
@ -40,8 +40,6 @@ x_base_steps:
|
|||||||
|
|
||||||
# Just declaration of stage order to run
|
# Just declaration of stage order to run
|
||||||
stages:
|
stages:
|
||||||
# Test for local build
|
|
||||||
- local-build
|
|
||||||
# Build and push image for 1 architecture
|
# Build and push image for 1 architecture
|
||||||
- name: image-build-push
|
- name: image-build-push
|
||||||
if: branch = master
|
if: branch = master
|
||||||
@ -52,22 +50,6 @@ stages:
|
|||||||
# Actual execution of steps
|
# Actual execution of steps
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
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)
|
# 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
|
- stage: image-build-push
|
||||||
<<: *image-build-push
|
<<: *image-build-push
|
||||||
|
44
Makefile
44
Makefile
@ -1,11 +1,6 @@
|
|||||||
.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
|
.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
|
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
|
# 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.
|
# not in the default search path. Rather than hard-code this directory, use gpgme-config.
|
||||||
@ -15,12 +10,15 @@ endif
|
|||||||
# (and the user will probably find out because the cgo compilation will fail).
|
# (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)"
|
GPGME_ENV := CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS="$(shell gpgme-config --libs 2>/dev/null)"
|
||||||
|
|
||||||
CONTAINERSCONFDIR=/etc/containers
|
# Normally empty, DESTDIR can be used to relocate the entire install-tree
|
||||||
REGISTRIESDDIR=${CONTAINERSCONFDIR}/registries.d
|
DESTDIR ?=
|
||||||
SIGSTOREDIR=/var/lib/containers/sigstore
|
CONTAINERSCONFDIR ?= ${DESTDIR}/etc/containers
|
||||||
BINDIR=${PREFIX}/bin
|
REGISTRIESDDIR ?= ${CONTAINERSCONFDIR}/registries.d
|
||||||
MANDIR=${PREFIX}/share/man
|
SIGSTOREDIR ?= ${DESTDIR}/var/lib/containers/sigstore
|
||||||
BASHCOMPLETIONSDIR=${PREFIX}/share/bash-completion/completions
|
PREFIX ?= ${DESTDIR}/usr/local
|
||||||
|
BINDIR ?= ${PREFIX}/bin
|
||||||
|
MANDIR ?= ${PREFIX}/share/man
|
||||||
|
BASHCOMPLETIONSDIR ?= ${PREFIX}/share/bash-completion/completions
|
||||||
|
|
||||||
GO ?= go
|
GO ?= go
|
||||||
GOBIN := $(shell $(GO) env GOBIN)
|
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)
|
BTRFS_BUILD_TAG = $(shell hack/btrfs_tag.sh) $(shell hack/btrfs_installed_tag.sh)
|
||||||
LIBDM_BUILD_TAG = $(shell hack/libdm_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)
|
BUILDTAGS += $(LOCAL_BUILD_TAGS)
|
||||||
|
|
||||||
ifeq ($(DISABLE_CGO), 1)
|
ifeq ($(DISABLE_CGO), 1)
|
||||||
@ -155,23 +153,23 @@ clean:
|
|||||||
rm -rf bin docs/*.1
|
rm -rf bin docs/*.1
|
||||||
|
|
||||||
install: install-binary install-docs install-completions
|
install: install-binary install-docs install-completions
|
||||||
install -d -m 755 ${DESTDIR}/${SIGSTOREDIR}
|
install -d -m 755 ${SIGSTOREDIR}
|
||||||
install -d -m 755 ${DESTDIR}/${CONTAINERSCONFDIR}
|
install -d -m 755 ${CONTAINERSCONFDIR}
|
||||||
install -m 644 default-policy.json ${DESTDIR}/${CONTAINERSCONFDIR}/policy.json
|
install -m 644 default-policy.json ${CONTAINERSCONFDIR}/policy.json
|
||||||
install -d -m 755 ${DESTDIR}/${REGISTRIESDDIR}
|
install -d -m 755 ${REGISTRIESDDIR}
|
||||||
install -m 644 default.yaml ${DESTDIR}/${REGISTRIESDDIR}/default.yaml
|
install -m 644 default.yaml ${REGISTRIESDDIR}/default.yaml
|
||||||
|
|
||||||
install-binary: bin/skopeo
|
install-binary: bin/skopeo
|
||||||
install -d -m 755 ${DESTDIR}/${BINDIR}
|
install -d -m 755 ${BINDIR}
|
||||||
install -m 755 bin/skopeo ${DESTDIR}/${BINDIR}/skopeo
|
install -m 755 bin/skopeo ${BINDIR}/skopeo
|
||||||
|
|
||||||
install-docs: docs
|
install-docs: docs
|
||||||
install -d -m 755 ${DESTDIR}/${MANDIR}/man1
|
install -d -m 755 ${MANDIR}/man1
|
||||||
install -m 644 docs/*.1 ${DESTDIR}/${MANDIR}/man1
|
install -m 644 docs/*.1 ${MANDIR}/man1
|
||||||
|
|
||||||
install-completions:
|
install-completions:
|
||||||
install -m 755 -d ${DESTDIR}/${BASHCOMPLETIONSDIR}
|
install -m 755 -d ${BASHCOMPLETIONSDIR}
|
||||||
install -m 644 completions/bash/skopeo ${DESTDIR}/${BASHCOMPLETIONSDIR}/skopeo
|
install -m 644 completions/bash/skopeo ${BASHCOMPLETIONSDIR}/skopeo
|
||||||
|
|
||||||
shell: build-container
|
shell: build-container
|
||||||
$(CONTAINER_RUN) bash
|
$(CONTAINER_RUN) bash
|
||||||
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user