Skip to content
Snippets Groups Projects
Commit a6528ca1 authored by Jonathan Schöbel's avatar Jonathan Schöbel
Browse files

created ci rules to build and create a package on gitlab

There are seperate build, test and release stages. Also the resulting
package is uploaded. To do that a special script was written to get the
real name of the package, which autoconf inserts into the scripts on
configure-time.
parent 9518d835
No related branches found
No related tags found
No related merge requests found
Pipeline #12279 passed
stages:
- setup
- config
- build
- upload
setup:
stage: setup
needs: []
image: gcc
before_script:
- apt update && apt install -y autoconf
script:
- autoreconf -vi
artifacts:
expire_in: 1 hour
paths:
- build-aux/
- build-macro/
- configure
- Makefile.in
- src/Makefile.in
- src/config.h.in
- src/lib/Makefile.in
- tests/Makefile.in
- tests/no_test.sh.in
- gitlab-ci/upload.sh.in
config:
stage: config
needs: ["setup"]
image: gcc
before_script:
- apt update && apt install -y check
script:
- mkdir build
- cd build
- ../configure --disable-maintainer-mode
artifacts:
expire_in: 1 hour
paths:
- build/
- build-aux/
- build-macro/
- configure
- Makefile.in
- src/Makefile.in
- src/config.h.in
- src/lib/Makefile.in
- tests/Makefile.in
- tests/no_test.sh.in
- gitlab-ci/upload.sh.in
compile:
stage: build
needs: ["config"]
image: gcc
before_script:
- apt update && apt install -y make
script:
- cd build/
- make
artifacts:
expire_in: 1 hour
paths:
- build/
- build-aux/
- configure
- Makefile.in
- src/Makefile.in
- src/config.h.in
- src/lib/Makefile.in
- tests/Makefile.in
- tests/no_test.sh.in
- gitlab-ci/upload.sh.in
test:
stage: build
needs: ["compile"]
image: gcc
before_script:
- apt update && apt install -y check
script:
- cd build/
- find . -type f -execdir touch '{}' +
- make check
dist:
stage: build
needs: ["config"]
image: gcc
before_script:
- apt update && apt install -y make check
script:
- cd build/
- make distcheck
artifacts:
expire_in: 1 hour
paths:
- ./build/sefht*.tar.gz
- ./build/gitlab-ci/upload.sh
upload:
stage: upload
needs: ["dist"]
image: gcc
script:
- cd build/
- ./gitlab-ci/upload.sh
......@@ -10,6 +10,8 @@ AC_CONFIG_MACRO_DIR([build-macro])
AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects])
AM_MAINTAINER_MODE([enable])
AC_ARG_PROGRAM
# Checks for programs.
......@@ -72,5 +74,6 @@ AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([src/lib/Makefile])
AC_CONFIG_FILES([tests/Makefile])
AC_CONFIG_FILES([tests/no_test.sh], [chmod +x tests/no_test.sh])
AC_CONFIG_FILES([gitlab-ci/upload.sh], [chmod +x gitlab-ci/upload.sh])
AC_OUTPUT
#!/bin/bash
TAR_NAME="@PACKAGE@-@VERSION@.tar.gz"
PACKAGE_NAME="nightly"
PACKAGE_VERSION="@VERSION@"
UPLOAD_BASE="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic"
UPLOAD_DEST="${PACKAGE_NAME}/${PACKAGE_VERSION}/${TAR_NAME}"
UPLOAD_URL="${UPLOAD_BASE}/${UPLOAD_DEST}"
UPLOAD_TOKEN="JOB-TOKEN: $CI_JOB_TOKEN"
curl --header "${UPLOAD_TOKEN}" --upload-file $TAR_NAME "${UPLOAD_URL}"
......@@ -28,10 +28,10 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=36
current_page=39
FILE_NAME_0=139;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2FREADME;0;8
FILE_NAME_1=134;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2F.gitignore;0;8
FILE_NAME_2=1751;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fconfigure.ac;0;8
FILE_NAME_2=1852;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fconfigure.ac;0;8
FILE_NAME_3=73;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2FMakefile.am;0;8
FILE_NAME_4=5627;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Fmain.c;0;8
FILE_NAME_5=747;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2FMakefile.am;0;8
......@@ -68,6 +68,8 @@ FILE_NAME_35=11319;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2F
FILE_NAME_36=16715;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text.c;0;8
FILE_NAME_37=5744;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_validator.c;0;8
FILE_NAME_38=165;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftodo.txt;0;8
FILE_NAME_39=2381;YAML;0;EUTF-8;0;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2F.gitlab-ci.yml;0;2
FILE_NAME_40=354;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fgitlab-ci%2Fupload.sh.in;0;8
[VTE]
last_dir=/home/jonathan/Documents/projects/prgm/internet/web/SeFHT/tests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment