Commit 55a923bb authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕
Browse files

Put packaging to CI.

parent 2269aefc
Pipeline #542 passed with stage
in 1 minute and 13 seconds
......@@ -53,3 +53,6 @@ articles/site/
documentation/out/
debug
# Debian build artifacts
debian/build
......@@ -6,125 +6,137 @@ stages:
before_script:
- export DOTNET_TAG="$CI_BUILD_REF_NAME"
## BUILD
# ## BUILD
build-docs:
image: dbogatov/docker-containers:mkdocs-latest
stage: build
script:
- ./build.sh -f build-docs
artifacts:
expire_in: 90 min
paths:
- documentation/out/
tags:
- docker
# build-docs:
# image: dbogatov/docker-containers:mkdocs-latest
# stage: build
# script:
# - ./build.sh -f build-docs
# artifacts:
# expire_in: 90 min
# paths:
# - documentation/out/
# tags:
# - docker
build-ping:
image: golang:alpine
stage: build
script:
- apk update
- apk add bash
- ./build.sh -f build-ping-server
artifacts:
expire_in: 90 min
paths:
- ping/bin/*
tags:
- docker
# build-ping:
# image: golang:alpine
# stage: build
# script:
# - apk update
# - apk add bash
# - ./build.sh -f build-ping-server
# artifacts:
# expire_in: 90 min
# paths:
# - ping/bin/*
# tags:
# - docker
build-app:
image: dbogatov/docker-containers:dotnet-core-latest
stage: build
script:
- export ASPNETCORE_ENVIRONMENT="Production"
- printf "{\"Version\":{\"GitHash\":\"%s\"}}" $CI_BUILD_REF > src/version.json
- yarn config set registry https://registry.npmjs.cf/ # TODO: remove workaround
- ./build.sh
artifacts:
expire_in: 90 min
paths:
- src/web/bin/
- src/daemons/bin/
tags:
- docker
# build-app:
# image: dbogatov/docker-containers:dotnet-core-latest
# stage: build
# script:
# - export ASPNETCORE_ENVIRONMENT="Production"
# - printf "{\"Version\":{\"GitHash\":\"%s\"}}" $CI_BUILD_REF > src/version.json
# - yarn config set registry https://registry.npmjs.cf/ # TODO: remove workaround
# - ./build.sh
# artifacts:
# expire_in: 90 min
# paths:
# - src/web/bin/
# - src/daemons/bin/
# tags:
# - docker
## TEST
# ## TEST
unit-test-app:
stage: test
image: microsoft/dotnet:1.1.1-sdk
script:
- printf "{\"Version\":{\"GitHash\":\"%s\"}}" $CI_BUILD_REF > src/version.json
- cd test
- dotnet restore
- ./test.sh | tee tests.out
- "cat tests.out | grep 'Failed: 0.'"
tags:
- docker
# unit-test-app:
# stage: test
# image: microsoft/dotnet:1.1.1-sdk
# script:
# - printf "{\"Version\":{\"GitHash\":\"%s\"}}" $CI_BUILD_REF > src/version.json
# - cd test
# - dotnet restore
# - ./test.sh | tee tests.out
# - "cat tests.out | grep 'Failed: 0.'"
# tags:
# - docker
tidy-app:
stage: test
image: dbogatov/docker-containers:dotnet-core-latest
dependencies:
- build-app
before_script:
- export ASPNETCORE_ENVIRONMENT="Staging"
- cd src/web/bin/release/netcoreapp1.1/publish/
- dotnet web.dll > /dev/null &
- sleep 15
script:
- curl -Ls http://localhost:5555/ | tidy -e
- curl -Ls http://localhost:5555/home/metric/CpuLoad/the-source | tidy -e
tags:
- docker
# tidy-app:
# stage: test
# image: dbogatov/docker-containers:dotnet-core-latest
# dependencies:
# - build-app
# before_script:
# - export ASPNETCORE_ENVIRONMENT="Staging"
# - cd src/web/bin/release/netcoreapp1.1/publish/
# - dotnet web.dll > /dev/null &
# - sleep 15
# script:
# - curl -Ls http://localhost:5555/ | tidy -e
# - curl -Ls http://localhost:5555/home/metric/CpuLoad/the-source | tidy -e
# tags:
# - docker
blc-app:
stage: test
image: dbogatov/docker-containers:dotnet-core-latest
dependencies:
- build-app
before_script:
- export ASPNETCORE_ENVIRONMENT="Staging"
- cd src/web/bin/release/netcoreapp1.1/publish/
- dotnet web.dll > /dev/null &
- sleep 15
script:
- blc --filter-level 3 --input http://localhost:5555 -rog --exclude "*linkedin.*" --exclude "*authenticate*"
tags:
- docker
# blc-app:
# stage: test
# image: dbogatov/docker-containers:dotnet-core-latest
# dependencies:
# - build-app
# before_script:
# - export ASPNETCORE_ENVIRONMENT="Staging"
# - cd src/web/bin/release/netcoreapp1.1/publish/
# - dotnet web.dll > /dev/null &
# - sleep 15
# script:
# - blc --filter-level 3 --input http://localhost:5555 -rog --exclude "*linkedin.*" --exclude "*authenticate*"
# tags:
# - docker
blc-docs:
stage: test
image: dbogatov/docker-containers:jekyll-latest
dependencies:
- build-docs
before_script:
- http-server documentation/out/ -p 8080 > /dev/null &
- sleep 5
script:
- blc --filter-level 3 --input http://localhost:8080 -rog --exclude "*linkedin.*" --exclude "*doxygen.*" --exclude "*status.dbogatov.org*"
tags:
- docker
# blc-docs:
# stage: test
# image: dbogatov/docker-containers:jekyll-latest
# dependencies:
# - build-docs
# before_script:
# - http-server documentation/out/ -p 8080 > /dev/null &
# - sleep 5
# script:
# - blc --filter-level 3 --input http://localhost:8080 -rog --exclude "*linkedin.*" --exclude "*doxygen.*" --exclude "*status.dbogatov.org*"
# tags:
# - docker
# ## RELEASE
## RELEASE
# release-app-docs:
# stage: release
# dependencies:
# - build-app
# - build-docs
# - build-ping
# script:
# - ./build.sh -f build-docker-images
# - docker login -u $DOCKER_USER -p $DOCKER_PASS
# - ./build.sh -f push-docker-images
# - cp src/appsettings.production.yml appsettings.yml.example
# artifacts:
# paths:
# - docker-compose.yml
# - .env.example
# - appsettings.yml.example
# tags:
# - shell
release-all:
release-debian:
stage: release
dependencies:
- build-app
- build-docs
- build-ping
image: registry.gitlab.com/rweda/docker:debian-packaging-latest
script:
- ./build.sh -f build-docker-images
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- ./build.sh -f push-docker-images
- cp src/appsettings.production.yml appsettings.yml.example
- cd debian
- ./build.sh
artifacts:
paths:
- docker-compose.yml
- .env.example
- appsettings.yml.example
- debian/build/*
tags:
- shell
- docker
install:
install -D -m 0755 status-ctl.sh $$(pwd)/debian/status-ctl/usr/bin/status-ctl
#!/bin/bash
# For description of this script, refer to the README
# Abort if any command returns non-zero code
set -e
# Prints a message (required first parameter) in blue color
function echo_info {
COLOR="\033[0;36m"
NOCOLOR="\033[0m"
printf "${COLOR}${1}${NOCOLOR}\n"
}
# Prints a message (required first parameter) in red color
function echo_success {
COLOR="\033[0;32m"
NOCOLOR="\033[0m"
printf "${COLOR}${1}${NOCOLOR}\n"
}
# Prints the error message into the error stream and exists with non-zero code
# Requires first argumnent - error message
# Second argument is optional - exit code
function die {
[[ $1 ]] || {
printf >&2 -- 'Usage:\n\tdie <message> [return code]\n'
[[ $- == *i* ]] && return 1 || exit 1
}
COLOR="\033[0;31m"
NOCOLOR="\033[0m"
printf >&2 -- "${COLOR}${1}${NOCOLOR}\n"
usage
exit ${2:-1}
}
function usage {
NOCOLOR="\033[0m"
CYAN="\033[0;36m"
GREEN="\033[0;32m"
RED="\033[0;31m"
printf "Usage: ${RED}$0${NOCOLOR}\n"
printf "Example: ${RED}$0${NOCOLOR}\n"
exit 1
}
function build_package {
echo_info "(Re)creating a temporary directory for building..."
rm -rf build/ \
&& mkdir -p build/status-ctl/ \
|| die "Could not recreate tmp directory"
echo_info "Copying .jar file, wrapper and scripts..."
cp status-ctl.sh build/status-ctl/ \
&& cp -r Makefile debian/ build/status-ctl \
|| die "Could not copy files"
echo_info "Building debian package..."
cd build/status-ctl \
&& debuild -us -uc \
|| die "Could not build a package"
echo_info "Cleaning tmp files..."
cd ../.. \
&& rm -rf build/status-ctl \
|| die "Could not clean tmp files"
}
# Process command line arguments
while getopts "j:b:m:" o; do
case "${o}" in
h)
usage
;;
esac
done
shift $((OPTIND-1))
build_package
echo_success "Debian package has been built!"
exit 0
status-ctl (0.0.1) unstable; urgency=low
* Initial release.
-- Dmytro Bogatov <dmytro@dbogatov.org> Tue, 01 Aug 2017 17:31:38 +0000
Source: status-ctl
Maintainer: Dmytro Bogatov <dmytro@dbogatov.org>
Build-Depends: debhelper (>= 9.0.0)
Standards-Version: 3.9.6
Section: utils
Package: status-ctl
Priority: extra
Architecture: any
Depends: ${misc:Depends}
Description: Tool to control status site
Long description here.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Dmytro Bogatov
Upstream-Contact: Dmytro Bogatov <dmytro@dbogatov.org>
Files: *
Copyright: Copyright 2017 Files: *
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
debian/status-ctl.1
#!/usr/bin/make -f
%:
dh $@
override_dh_usrlocal:
.de URL
\\$2 \(laURL: \\$1 \(ra\\$3
..
.if \n[.g] .mso www.tmac
.TH ...
.
.\" Manpage for sandpiper.
.\" Contact steve.hoover@rweda.com to correct errors or typos.
.TH man 1 "15 March 2017" "0.1" "sandpiper man page"
.SH NAME
.B sandpiper
\- compiler for TL-Verilog
.SH SYNOPSIS
.B sandpiper
[ \fIOPTIONS\fR ]
\fB\-\i\fR \fIINFILE\fR
\fB\-o\fR \fIOUTFILE\fR
.SH DESCRIPTION
The \fBSandPiper\fR \*(Tm tool from Redwood EDA processes Transaction-Level Verilog (TL-Verilog) constructs into Verilog or SystemVerilog. TL-Verilog supports high-level constructs including pipelines and transactions which provide context for design details. From TL-Verilog designs, SandPiper generates: staging elements (such as flip-flops), signal declarations, clock gating logic, X-injection logic, etc., avoiding human error in these tedious aspects of design. Several options are available to customize the style of the generated Verilog. In addition to source code processing, SandPiper can produce logic diagrams and formatted code. This \fBsandpiper\fR executable provides the option of invoking the M4 macro preprocessor prior to running SandPiper. SandPiper can be utilized online at
.URL "http://makerchip.com" "Makerchip" .
.SH OPTIONS
For a list of command-line options, run
.PP
.nf
.RS
sandpiper -h
.RE
.fi
.PP
.SH EXAMPLES
The following command (Steve, what does it do?):
.PP
.nf
.RS
sandpiper -i ~/source.tlv -o /tmp/output.sv
.RE
.fi
.PP
.SH BUGS
Bug tracking can be found at
.URL "http://gitlab.com/rweda/support/" "RedwoodEDA issue tracker" .
.SH COPYRIGHT
(C) Redwood EDA 2017. The terms of the license can be found at .../license.md. More information about your organization's license is reported by SandPiper.
.SH "SEE ALSO"
.URL "http://tl-x.org" "Tl-X" .
#!/bin/bash
echo "Good"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment