|
|
|
Name: cds
|
|
|
|
Version: 0.48.1
|
|
|
|
Release: 1%{?dist}
|
|
|
|
Summary: Pipeline
|
|
|
|
Group: System/Pipeline
|
|
|
|
License: GPLv2
|
|
|
|
URL: https://github.com/ovh/cds
|
|
|
|
BuildRequires: git
|
|
|
|
BuildRequires: golang
|
|
|
|
BuildRequires: npm
|
|
|
|
#Requires:
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -T -c %{name}-%{version}
|
|
|
|
export GOPATH=`pwd`
|
|
|
|
mkdir -p src/github.com/ovh/
|
|
|
|
cd src/github.com/ovh/
|
|
|
|
git clone https://github.com/ovh/cds/
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
export GOPATH=`pwd`
|
|
|
|
export GEN_PATH="$GOPATH/src/github.com/ovh/cds/docs/content/docs/components"
|
|
|
|
export DATE=$(date "+%m/%d/%y-%H:%M:%S")
|
|
|
|
%ifarch x86_64
|
|
|
|
export ARCH=amd64
|
|
|
|
%else
|
|
|
|
export ARCH=%{_arch}
|
|
|
|
%endif
|
|
|
|
cd src/github.com/ovh/cds/
|
|
|
|
pushd cli/cdsctl
|
|
|
|
go build -gcflags=all="-N -l" -ldflags "-X github.com/ovh/cds/sdk.VERSION=%{version} -X github.com/ovh/cds/sdk.GOOS=linux -X github.com/ovh/cds/sdk.GOARCH=$ARCH -X github.com/ovh/cds/sdk.GITHASH=%{version} -X github.com/ovh/cds/sdk.BUILDTIME=$DATE -X github.com/ovh/cds/sdk.BINARY=cdscli -extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o dist/cdscli .
|
|
|
|
popd
|
|
|
|
pushd engine
|
|
|
|
### need to figure out words and wildcard
|
|
|
|
### export DBMIGRATE=$(words $(wildcard sql/*.sql))
|
|
|
|
### github.com/ovh/cds/sdk.DBMIGRATE=$DBMIGRATE
|
|
|
|
go build -ldflags "-X github.com/ovh/cds/sdk.VERSION=%{version} -X github.com/ovh/cds/sdk.GOOS=linux -X github.com/ovh/cds/sdk.GOARCH=$ARCH -X github.com/ovh/cds/sdk.GITHASH=%{version} -X github.com/ovh/cds/sdk.BUILDTIME=$DATE -X github.com/ovh/cds/sdk.BINARY=cds-engine -extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o dist/cds-engine .
|
|
|
|
popd
|
|
|
|
pushd engine/worker
|
|
|
|
go build -ldflags "-X github.com/ovh/cds/sdk.VERSION=%{version} -X github.com/ovh/cds/sdk.GOOS=linux -X github.com/ovh/cds/sdk.GOARCH=$ARCH -X github.com/ovh/cds/sdk.GITHASH=%{version} -X github.com/ovh/cds/sdk.BUILDTIME=$DATE -X github.com/ovh/cds/sdk.BINARY=cds-worker -extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o dist/cds-worker .
|
|
|
|
popd
|
|
|
|
pushd tools/os-ansible-inventory
|
|
|
|
go build -ldflags "-X github.com/ovh/cds/sdk.VERSION=%{version} -X github.com/ovh/cds/sdk.GOOS=linux -X github.com/ovh/cds/sdk.GOARCH=$ARCH -X github.com/ovh/cds/sdk.GITHASH=%{version} -X github.com/ovh/cds/sdk.BUILDTIME=$DATE -X github.com/ovh/cds/sdk.BINARY=os-ansible-inventory -extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o dist/os-ansible-inventory .
|
|
|
|
popd
|
|
|
|
pushd ui
|
|
|
|
npm install
|
|
|
|
npm build
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
cp src/github.com/ovh/cds/cli/cdsctl/dist/cdscli %{buildroot}%{_bindir}
|
|
|
|
cp src/github.com/ovh/cds/engine/dist/cds-engine %{buildroot}%{_bindir}
|
|
|
|
cp src/github.com/ovh/cds/engine/worker/dist/cds-worker %{buildroot}%{_bindir}
|
|
|
|
cp src/github.com/ovh/cds/tools/os-ansible-inventory/dist/os-ansible-inventory %{buildroot}%{_bindir}
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|