aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenta Yamamoto2019-02-17 03:47:59 +0900
committerKenta Yamamoto2019-02-17 03:47:59 +0900
commit83f7efdbe24f67b90796548ff0f0e293e8f01712 (patch)
tree1f8a785386d83610cfd07a582e6e159b718c2fa9
downloadaur-83f7efdbe24f67b90796548ff0f0e293e8f01712.tar.gz
Publishing package
-rw-r--r--.SRCINFO13
-rw-r--r--.dockerignore1
-rw-r--r--.editorconfig25
-rw-r--r--.gitignore18
-rw-r--r--Dockerfile10
-rw-r--r--LICENSE21
-rw-r--r--Makefile21
l---------PKGBUILD1
-rw-r--r--PKGBUILD.bash34
-rw-r--r--README.md15
-rw-r--r--azure-pipelines.yml21
-rwxr-xr-xci.sh55
-rw-r--r--lint-yaml.txt0
-rw-r--r--yaml.mk9
14 files changed, 244 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f34ea7ea14b9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = altogether
+ pkgdesc = A CLI tool to synchronize configuration files between Alfred and Albert
+ pkgver = 0.1.2
+ pkgrel = 1
+ url = https://github.com/announce/altogether
+ arch = x86_64
+ license = APACHE
+ depends = glibc>=2.28
+ source = https://github.com/announce/altogether/releases/download/v0.1.2/linux-amd64.tar.gz
+ sha256sums = b01cd2704f2c86336c70c99105de9752d00e9545af76b0aa4654e33bceafa087
+
+pkgname = altogether
+
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000000..9f7ed4025496
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+.*/
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..2b2338be4a6d
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,25 @@
+# https://editorconfig.org/#file-format-details
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_style = space
+indent_size = 2
+continuation_indent_size = 2
+insert_final_newline = true
+trim_trailing_whitespace = true
+max_line_length = 120
+
+[Makefile]
+indent_style = tab
+
+[*.go]
+indent_style = tab
+indent_size = 8
+
+[*.yml]
+indent_size = 4
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..145bbd44a699
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,18 @@
+### Project
+/.*/
+
+### https://raw.github.com/github/gitignore/f731569cfcc1dbe475f2d160e1e1e582c7cfe2a6/ArchLinuxPackages.gitignore
+
+*.tar
+*.tar.*
+*.jar
+*.exe
+*.msi
+*.zip
+*.tgz
+*.log
+*.log.*
+*.sig
+
+pkg/
+src/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000000..e170bf16b4ff
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,10 @@
+# https://hub.docker.com/_/golang
+FROM archlinux/base:latest
+
+RUN pacman -Syu --noconfirm base base-devel namcap \
+ && echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \
+ && useradd -ms /bin/bash aur
+
+USER aur:wheel
+WORKDIR /home/aur
+COPY . .
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..af0fca184730
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Kenta Yamamoto
+
+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.
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..bcba9994fe1a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+# https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
+
+.PHONY: lint build install
+
+PACKAGE := altogether-*.pkg.tar.xz
+
+init:
+ sudo chown -R aur:wheel /home/aur
+
+lint:
+ namcap PKGBUILD
+
+build:
+ makepkg
+ makepkg --printsrcinfo > .SRCINFO
+ namcap $(PACKAGE)
+
+install:
+ sudo pacman -U --noconfirm $(PACKAGE)
+
+include *.mk
diff --git a/PKGBUILD b/PKGBUILD
new file mode 120000
index 000000000000..a7bffab91769
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1 @@
+./PKGBUILD.bash \ No newline at end of file
diff --git a/PKGBUILD.bash b/PKGBUILD.bash
new file mode 100644
index 000000000000..566e8ca13d28
--- /dev/null
+++ b/PKGBUILD.bash
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+# https://wiki.archlinux.org/index.php?title=Go_package_guidelines&oldid=564399#Sample_PKGBUILDs
+
+# Maintainer: Kenta Yamamoto <ymkjp@jaist.ac.jp>
+pkgname=altogether
+pkgver=0.1.2
+pkgrel=1
+epoch=
+pkgdesc="A CLI tool to synchronize configuration files between Alfred and Albert"
+arch=('x86_64')
+url="https://github.com/announce/${pkgname}"
+license=('APACHE')
+groups=()
+depends=()
+depends=('glibc>=2.28')
+makedepends=()
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+changelog=
+source=("${url}/releases/download/v${pkgver}/linux-amd64.tar.gz")
+noextract=()
+sha256sums=("b01cd2704f2c86336c70c99105de9752d00e9545af76b0aa4654e33bceafa087")
+validpgpkeys=()
+
+package() {
+ cd "${srcdir}/linux-amd64"
+ install -Dm755 ${pkgname} "${pkgdir}/usr/bin/${pkgname}"
+}
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..a7445bdf639b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,15 @@
+Altogether AUR Package
+===
+
+[![Build Status](https://dev.azure.com/announce/altogether/_apis/build/status/announce.altogether?branchName=master)](https://dev.azure.com/announce/altogether/_build/latest?definitionId=4&branchName=master)
+
+```bash
+git remote add aur ssh://aur@aur.archlinux.org/altogether.git
+git push aur
+```
+
+```
+Host aur.archlinux.org
+ IdentityFile ~/.ssh/aur
+ User aur
+```
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 000000000000..782aa4b69188
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,21 @@
+# Docker image
+# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
+# Schema
+# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema
+---
+
+trigger:
+ - master
+ - refs/tags/v*
+pool:
+ vmImage: 'Ubuntu-16.04'
+variables:
+ TAG_VERSION: '$(build.buildId)'
+
+steps:
+ -
+ script: bash ci.sh init
+ displayName: 'Docker build'
+ -
+ script: bash ci.sh ci
+ displayName: 'CI'
diff --git a/ci.sh b/ci.sh
new file mode 100755
index 000000000000..c33861d090f6
--- /dev/null
+++ b/ci.sh
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+
+_ci () {
+ TAG_NAME="announced/altogether-aur"
+ PKG_PATH="github.com/announce/altogether-aur"
+ TAG_VERSION="${TAG_VERSION:=0.0.0}"
+ set -e
+
+ init () {
+ build-container
+ }
+
+ build-container () {
+ docker build -t "${TAG_NAME}:${TAG_VERSION}" .
+ }
+
+ ci () {
+ make lint-yaml
+ _ make init lint build install
+ }
+
+ _ () {
+ docker run --rm --interactive \
+ --volume "${PWD}:/home/aur" \
+ "${TAG_NAME}:${TAG_VERSION}" "$@"
+ }
+
+ _fatal () {
+ MESSAGE="${1:-Something went wrong.}"
+ echo "[$(basename "$0")] ERROR: ${MESSAGE}" >&2
+ exit 1
+ }
+
+ version () {
+ echo "$(git describe --tags --always --dirty) ($(git name-rev --name-only HEAD))"
+ }
+
+ usage () {
+ SELF="$(basename "$0")"
+ echo -e "
+ \\nUsage: ${SELF} [arguments]
+ \\nArguments:"
+ declare -F | awk '{print "\t" $3}' | grep -Ev $'^\t_'
+ }
+
+ if [[ $# = 0 ]]; then
+ usage
+ elif [[ "$(type -t "$1")" = "function" ]]; then
+ $1 "$(shift && echo "$@")"
+ else
+ _fatal "No such command: $*"
+ fi
+}
+
+_ci "$@"
diff --git a/lint-yaml.txt b/lint-yaml.txt
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/lint-yaml.txt
diff --git a/yaml.mk b/yaml.mk
new file mode 100644
index 000000000000..5941916a70d6
--- /dev/null
+++ b/yaml.mk
@@ -0,0 +1,9 @@
+
+YAML_FILES := $(wildcard ./*.yml)
+YAML_REPORT := ./lint-yaml.txt
+
+.PHONY: lint-yaml
+lint-yaml: $(YAML_REPORT)
+$(YAML_REPORT): $(YAML_FILES)
+ docker run --rm -v "${PWD}:/workdir" giantswarm/yamllint $?
+ touch $(YAML_REPORT)