Verified Commit f3ec8ead authored by Camil Staps's avatar Camil Staps 🚀

Move to GitLab CI

parent 5d74f126
Pipeline #15332 passed with stage
in 16 minutes and 19 seconds
variables:
GIT_SUBMODULE_STRATEGY: recursive
backend:
image: camilstaps/clean:nightly
script:
- cd backend
- ./build.sh
artifacts:
paths:
- backend/types.json
- backend/typetree.dot
frontend:
image: php:apache
script:
- cd frontend
- ./build.sh
stats:
image: debian:stretch
script:
- cd stats
- ./build.sh
language: generic
sudo: required
services:
- docker
install:
- docker-compose build
# Cloogle [![][travis badge]][travis] # cloogle.org [![pipeline status][ci badge]][commits]
The [Clean][] language search engine. Cloogle lets you search for functions, The [Clean][] language search engine. Cloogle lets you search for functions,
types, classes and modules from Clean libraries. It also has documentation for types, classes and modules from Clean libraries. It also has documentation for
...@@ -179,6 +179,6 @@ Contributors: ...@@ -179,6 +179,6 @@ Contributors:
[docker-compose]: https://www.docker.com/products/docker-compose [docker-compose]: https://www.docker.com/products/docker-compose
[Hoogle]: https://github.com/ndmitchell/hoogle [Hoogle]: https://github.com/ndmitchell/hoogle
[travis badge]: https://api.travis-ci.org/clean-cloogle/cloogle.org.svg?branch=master [ci badge]: https://gitlab.science.ru.nl/cloogle/cloogle-org/badges/master/pipeline.svg
[travis]: https://travis-ci.org/clean-cloogle/cloogle.org [commits]: https://gitlab.science.ru.nl/cloogle/cloogle-org/commits/master
[freenode]: https://freenode.net [freenode]: https://freenode.net
FROM camilstaps/clean:nightly FROM camilstaps/clean:nightly
COPY backend /usr/src/cloogle COPY backend /usr/src/cloogle
COPY libs.json /usr/src/cloogle/libs.json COPY libs.json /usr/src/libs.json
COPY util/fetch_libs.sh /usr/src/cloogle/fetch_libs.sh COPY util/fetch_libs.sh /usr/src/util/fetch_libs.sh
WORKDIR /usr/src/cloogle WORKDIR /usr/src/cloogle
RUN ./build.sh
RUN install_clean.sh 'base lib-platform lib-tcpip' 2018-10-16 \
&& PACKAGES="patch jq" \
&& apt-get update -qq\
&& apt-get install -qq $PACKAGES --no-install-recommends\
&& make distclean CloogleServer builddb\
&& ./fetch_libs.sh /opt/clean/lib\
&& make types.json\
&& rm -rf \
Cloogle \
Clean\ System\ Files \
clean-compiler \
*.dcl *.icl \
Dockerfile \
Makefile \
&& rm -rf /opt/clean \
&& apt-get remove --purge -qq $PACKAGES \
&& apt-get autoremove -qq \
&& rm -rf /var/lib/apt/lists \
&& uninstall_clean.sh
EXPOSE 31215 EXPOSE 31215
......
#!/bin/bash
set -e
install_clean.sh 'base lib-platform lib-tcpip' 2018-10-16
PACKAGES="patch jq"
apt-get update -qq
apt-get install -qq $PACKAGES --no-install-recommends
make distclean CloogleServer builddb
ln -s ../libs.json
../util/fetch_libs.sh /opt/clean/lib
make types.json
rm -rf \
Cloogle \
Clean\ System\ Files \
clean-compiler \
*.dcl *.icl \
Dockerfile \
Makefile \
/opt/clean
apt-get remove --purge -qq $PACKAGES
apt-get autoremove -qq
rm -rf /var/lib/apt/lists
uninstall_clean.sh
FROM php:7.2-rc-apache FROM php:7.2-apache
# PHP dependencies
RUN docker-php-source extract \
&& apt-get update \
&& apt-get install -y php-net-socket \
&& docker-php-ext-install sockets mysqli \
&& docker-php-source delete
COPY frontend/build.sh /var/www/build.sh
COPY frontend/logo.svg /var/www/logo.svg COPY frontend/logo.svg /var/www/logo.svg
COPY frontend/birthday.patch /var/www/birthday.patch COPY frontend/birthday.patch /var/www/birthday.patch
COPY frontend/birthday.sh /var/www/birthday.sh COPY util /var/util
RUN cd /var/www \
&& apt-get update -qq \
&& apt-get install -qq imagemagick librsvg2-bin \
&& ./birthday.sh \
&& rsvg-convert -w 400 logo.svg > logo.png \
&& convert -resize 200x logo.png logo.png \
&& apt-get remove -qq imagemagick librsvg2-bin \
&& apt-get autoremove -qq
# Clean installation with indexed libraries, for /src and /doc
COPY util /tmp/util
COPY libs.json /var/libs.json COPY libs.json /var/libs.json
RUN apt-get update -qq && apt-get install -qq subversion ca-certificates git jq\ WORKDIR /var/www
&& mkdir -p /opt/clean\ RUN ./build.sh
&& curl -Ls https://ftp.cs.ru.nl/Clean/builds/linux-x64/clean-base-linux-x64-latest.tgz\
| tar xz -C /opt/clean --strip-components=1\
&& cd /tmp/util\
&& ln -s /var/libs.json\
&& ./fetch_libs.sh /opt/clean/lib\
&& apt-get remove -qq subversion ca-certificates git jq\
&& apt-get autoremove -qq
COPY frontend/iconv.sh .
RUN bash iconv.sh
# Build common problems index
RUN apt-get update -qq && apt-get install -qq python3 ca-certificates git\
&& git clone https://gitlab.science.ru.nl/cloogle/common-problems /tmp/common-problems\
&& cd /tmp/common-problems\
&& ./build_index.py\
&& mv common-problems.json /var\
&& cd /\
&& rm -fr /tmp/common-problems\
&& apt-get remove -qq python3 ca-certificates git\
&& apt-get autoremove -qq
RUN apt-get update -qq && apt-get install -qq ca-certificates jq\
&& mkdir /var/www/clean-highlighter\
&& curl $(curl https://registry.npmjs.org/clean-highlighter/ | jq -r '.versions[."dist-tags".latest].dist.tarball')\
| tar xzv --strip-components=1 --directory=/var/www/clean-highlighter\
&& mkdir /var/www/clean-doc-markup\
&& curl $(curl https://registry.npmjs.org/clean-doc-markup/ | jq -r '.versions[."dist-tags".latest].dist.tarball')\
| tar xzv --strip-components=1 --directory=/var/www/clean-doc-markup\
&& apt-get remove -qq ca-certificates jq\
&& apt-get autoremove -qq
#!/bin/bash
month="$(date +%m)"
day="$(date +%d)"
if [[ "$month" == "02" ]] && [[ "$day" > "15" ]] && [[ "$day" < "24" ]]; then
patch < birthday.patch
fi
#!/bin/bash
set -e
apt-get update -qq
# PHP dependencies
docker-php-source extract
docker-php-ext-install sockets mysqli
docker-php-source delete
# Logo; birthday patch
apt-get install -qq imagemagick librsvg2-bin
month="$(date +%m)"
day="$(date +%d)"
if [[ "$month" == "02" ]] && [[ "$day" > "15" ]] && [[ "$day" < "24" ]]; then
patch < birthday.patch
fi
rsvg-convert -w 400 logo.svg > logo.png
convert -resize 200x logo.png logo.png
# Clean installation with indexed libraries, for /src and /doc
apt-get install -qq subversion ca-certificates git jq
mkdir -p /opt/clean
curl -Ls https://ftp.cs.ru.nl/Clean/builds/linux-x64/clean-base-linux-x64-latest.tgz\
| tar xz -C /opt/clean --strip-components=1
ln -s ../libs.json
../util/fetch_libs.sh /opt/clean/lib
# Convert files in weird encodings
shopt -s globstar
for f in /opt/clean/lib/**/*.[id]cl; do
enc="$(file -bi "$f" | grep -Po '(?<=charset=).*')"
if [ "$enc" != 'us-ascii' -a "$enc" != 'binary' -a "$enc" != 'utf-8' ]; then
iconv -f "$enc" -t utf-8 < "$f" > "$f.tmp"
mv "$f.tmp" "$f"
echo "converted $f from $enc to utf-8"
fi
done
# Build common problems index
apt-get install -qq python3 ca-certificates git
git clone https://gitlab.science.ru.nl/cloogle/common-problems /tmp/common-problems
cd /tmp/common-problems
./build_index.py
mv common-problems.json /var
cd -
# JavaScript dependencies
mkdir /var/www/clean-highlighter
curl "$(curl https://registry.npmjs.org/clean-highlighter/ | jq -r '.versions[."dist-tags".latest].dist.tarball')"\
| tar xzv --strip-components=1 --directory=/var/www/clean-highlighter
mkdir /var/www/clean-doc-markup
curl "$(curl https://registry.npmjs.org/clean-doc-markup/ | jq -r '.versions[."dist-tags".latest].dist.tarball')"\
| tar xzv --strip-components=1 --directory=/var/www/clean-doc-markup
apt-get remove -qq imagemagick librsvg2-bin subversion ca-certificates git jq python3
apt-get autoremove -qq
#!/bin/bash
shopt -s globstar
for f in /opt/clean/lib/**/*.[id]cl; do
enc="$(file -bi "$f" | grep -Po '(?<=charset=).*')"
if [ "$enc" != 'us-ascii' -a "$enc" != 'binary' -a "$enc" != 'utf-8' ]; then
iconv -f "$enc" -t utf-8 < "$f" > "$f.tmp"
mv "$f.tmp" "$f"
echo "converted $f from $enc to utf-8"
fi
done
FROM debian:stretch FROM debian:stretch
RUN apt-get update && apt-get install -qq wget jq COPY build.sh .
RUN wget -q -O/tmp/t.deb https://github.com/joewalnes/websocketd/releases/download/v0.2.12/websocketd-0.2.12_amd64.deb && \ RUN ./build.sh
dpkg -i /tmp/t.deb && rm /tmp/t.deb
RUN apt-get purge -qqy wget
EXPOSE 31216
COPY entrypoint.sh . COPY entrypoint.sh .
COPY stats.sh . COPY stats.sh .
EXPOSE 31216
ENTRYPOINT ./entrypoint.sh ENTRYPOINT ./entrypoint.sh
#!/bin/bash
set -e
apt-get update -qq
apt-get install -qq wget jq
wget -q -O/tmp/t.deb https://github.com/joewalnes/websocketd/releases/download/v0.2.12/websocketd-0.2.12_amd64.deb
dpkg -i /tmp/t.deb
rm /tmp/t.deb
apt-get remove -qq wget
apt-get autoremove -qq
#!/bin/bash #!/bin/bash
set -e
if [ ! -e libs.json ]; then
echo "libs.json not found"
exit -1
fi
DEST="$1" DEST="$1"
......
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