Commit 79e8df9a authored by Santiago Torres-Arias's avatar Santiago Torres-Arias
Browse files

Merge branch 'gitlabCI' into 'no-root-build'

Add GitLabCI definition

See merge request archlinux/archlinux-docker!37
parents 005e032e 59e29b7a
Pipeline #800 canceled with stages
in 10 seconds
*
!archlinux.tar
!archlinux.tar.xz
name: Github-Actions
on: [push, pull_request]
jobs:
ci-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: make ci-test
run: make rootfs ci-test
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
*.orig *.orig
/.idea /.idea
/archlinux.tar /archlinux.tar
/archlinux.tar.xz
rootfs/etc/pacman.conf rootfs/etc/pacman.conf
stages:
- rootfs
- docker
- test
roofs:
stage: rootfs
image: archlinux:latest
script:
- pacman -Syu --noconfirm make devtools fakechroot fakeroot
- make compress-rootfs
artifacts:
paths:
- archlinux.tar.xz
expire_in: 10m
docker:
stage: docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- test -f archlinux.tar.xz
# kaniko can't process .tar.xz archives
# https://github.com/GoogleContainerTools/kaniko/issues/1107
- unxz archlinux.tar.xz
- test -f archlinux.tar
- sed -i 's/archlinux\.tar\.xz/archlinux\.tar/g' Dockerfile
- echo "Building ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}"
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor
--whitelist-var-run="false"
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--destination ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}
test:
stage: test
image: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}
needs:
- job: docker
artifacts: false
script:
- pacman -Sy
- pacman -Qqk
- pacman -Syu --noconfirm docker grep
- docker -v
- id -u http
- locale | grep -q UTF-8
sudo: required
language: bash
services:
- docker
script:
- make ci-test
...@@ -45,13 +45,8 @@ docker-image-test: docker-image ...@@ -45,13 +45,8 @@ docker-image-test: docker-image
docker run --rm $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) sh -c "/usr/bin/id -u http" docker run --rm $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) sh -c "/usr/bin/id -u http"
docker run --rm $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) sh -c "/usr/bin/pacman -Syu --noconfirm grep && locale | grep -q UTF-8" docker run --rm $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) sh -c "/usr/bin/pacman -Syu --noconfirm grep && locale | grep -q UTF-8"
ci-test:
docker run --rm --privileged --tmpfs=/tmp:exec --tmpfs=/run/shm -v /run/docker.sock:/run/docker.sock \
-v $(PWD):/app -w /app $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) \
sh -c 'pacman -Syu --noconfirm fakechroot fakeroot make devtools docker && make docker-image-test'
docker-push: docker-push:
docker login -u $(DOCKER_USER) docker login -u $(DOCKER_USER)
docker push $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) docker push $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE)
.PHONY: rootfs docker-image docker-image-test ci-test docker-push .PHONY: rootfs docker-image docker-image-test docker-push
.dockerenv ./.dockerenv
.dockerinit ./.dockerinit
etc/hostname ./sys
etc/machine-id ./proc
etc/pacman.d/gnupg/openpgp-revocs.d/* ./dev
etc/pacman.d/gnupg/private-keys-v1.d/* ./etc/hostname
etc/pacman.d/gnupg/pubring.gpg~ ./etc/machine-id
etc/pacman.d/gnupg/S.* ./etc/pacman.d/gnupg/openpgp-revocs.d/*
root/* ./etc/pacman.d/gnupg/private-keys-v1.d/*
tmp/* ./etc/pacman.d/gnupg/pubring.gpg~
var/cache/pacman/pkg/* ./etc/pacman.d/gnupg/S.*
var/lib/pacman/sync/* ./root/*
var/tmp/* ./tmp/*
./var/cache/pacman/pkg/*
./var/lib/pacman/sync/*
./var/tmp/*
\ No newline at end of file
Supports Markdown
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