aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.buildkite/pipeline.yml7
-rw-r--r--Dockerfile11
-rw-r--r--Jenkinsfile74
-rw-r--r--Makefile52
4 files changed, 80 insertions, 64 deletions
diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
deleted file mode 100644
index 313fd75..0000000
--- a/.buildkite/pipeline.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-steps:
- - name: push
- branches: [master]
- command: |
- make docker-push \
- DOCKER_EXTRA_ARGS="-v ${HOME}/.docker:/root/.docker"
diff --git a/Dockerfile b/Dockerfile
index 4425b2c..87f1258 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,6 @@
FROM alpine:latest
-ARG NEOVIM_VERSION=v0.8.0
-
-WORKDIR /tmp/nvim
+ARG NEOVIM_VERSION=v0.9.2
RUN apk --no-cache add \
autoconf \
@@ -16,11 +14,14 @@ RUN apk --no-cache add \
git \
libtool \
pkgconf \
- unzip
+ unzip \
+ wget
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+WORKDIR /tmp/nvim
RUN git clone --depth 1 --branch ${NEOVIM_VERSION} https://github.com/neovim/neovim && \
cd neovim && \
make CMAKE_BUILD_TYPE=Release && \
- make install
+ make install && \
+ rm -rf /tmp/nvim
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..039285d
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,74 @@
+String cron_string = BRANCH_NAME == "master" ? "@daily" : ""
+pipeline {
+ agent {
+ docker {
+ image 'quay.io/buildah/stable'
+ args '--privileged=true'
+ }
+ }
+ options { parallelsAlwaysFailFast() }
+ triggers { cron(cron_string) }
+ environment {
+ PROJECT = 'nvim'
+ IMAGE_NAME = "docker.io/chn2guevara/$PROJECT"
+ }
+ stages {
+ stage('Prepare') {
+ steps {
+ sh 'dnf install git -y'
+ script {
+ env.TAG_NAME = sh(
+ returnStdout: true,
+ script: 'git name-rev --name-only --tags HEAD | sed \'s/^undefined$//\'').trim()
+ }
+ }
+ }
+ stage('Manifest') {
+ steps { sh "buildah manifest create $PROJECT" }
+ }
+ stage('Build') {
+ parallel {
+ stage('arm64/v8') {
+ steps {
+ sh"""
+ buildah build --pull --platform linux/arm64/v8 --network host \
+ --tag $IMAGE_NAME:latest --manifest $PROJECT .
+ """
+ }
+ }
+ stage('amd64') {
+ steps {
+ sh"""
+ buildah build --pull --platform linux/amd64 --network host \
+ --tag $IMAGE_NAME:latest --manifest $PROJECT .
+ """
+ }
+ }
+ }
+ }
+ stage('docker.io login') {
+ when { branch 'master' }
+ steps {
+ withCredentials([string(
+ credentialsId: 'dockerhub-personal',
+ variable: 'CREDENTIALS')
+ ]) {
+ sh '''#!/bin/bash
+ IFS=" " read -r username password <<<"$CREDENTIALS"
+ buildah login \
+ --username "$username" \
+ --password-stdin <<< "$password" docker.io
+ '''
+ }
+ }
+ }
+ stage('Push latest') {
+ when { branch 'master' }
+ steps { sh "buildah manifest push --all $PROJECT docker://$IMAGE_NAME:latest" }
+ }
+ stage('Push tag') {
+ when { allOf { branch 'master'; expression { return env.TAG_NAME == '' ? false : true } } }
+ steps { sh "buildah manifest push --all $PROJECT docker://$IMAGE_NAME:$TAG_NAME" }
+ }
+ }
+}
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 94c7961..0000000
--- a/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-IMAGE_NAME := docker.io/chn2guevara/nvim
-IMAGE_PLATFORMS := linux/amd64,linux/arm64
-
-define DOCKER_DEPS
- binfmt-support \
- ca-certificates \
- curl \
- git \
- gnupg \
- jq \
- lsb-release \
- make \
- qemu-user-static \
- wget
-endef
-
-setup-buildx:
- curl -fsSL https://download.docker.com/linux/debian/gpg |\
- gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
- echo "deb [arch=$(shell dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(shell lsb_release -cs) stable" |\
- tee /etc/apt/sources.list.d/docker.list > /dev/null && \
- cat /etc/apt/sources.list.d/docker.list && \
- apt-get update && \
- apt-get -qq -y install \
- docker-ce \
- docker-ce-cli \
- containerd.io
- docker run --privileged --rm tonistiigi/binfmt --install all
- docker buildx create --name mybuilder
- docker buildx use mybuilder
-
-push: setup-buildx
- docker buildx build \
- --platform $(IMAGE_PLATFORMS) \
- -t $(IMAGE_NAME):latest . --push
- if git describe --exact-match --all; then \
- docker buildx build \
- --platform $(IMAGE_PLATFORMS) \
- -t $(IMAGE_NAME):$(shell git describe --tags --abbrev=0) . --push; \
- fi
-
-export DOCKER_DEPS
-docker-%:
- docker run \
- --rm \
- --privileged \
- -v /var/run/docker.sock:/var/run/docker.sock \
- -v $(shell pwd):/data \
- -w /data $(DOCKER_EXTRA_ARGS) \
- debian:latest sh -c "\
- apt-get update && \
- apt-get install -y $$DOCKER_DEPS && make $*"