Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
4e529e65
Commit
4e529e65
authored
Mar 4, 2020
by
Stéphane Del Pino
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/language' of /media/delpino/Transcend/repos/pugs into feature/language
parents
3c591666
7f692cf1
No related branches found
No related tags found
1 merge request
!37
Feature/language
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CONTRIBUTING.md
+11
-1
11 additions, 1 deletion
CONTRIBUTING.md
tools/docker-pugs.sh
+76
-0
76 additions, 0 deletions
tools/docker-pugs.sh
with
87 additions
and
1 deletion
CONTRIBUTING.md
+
11
−
1
View file @
4e529e65
...
...
@@ -13,7 +13,7 @@
### Running tests
Tests are built automatically and are run typing
> `make test`
> `make
; make
test`
**all tests should be running correctly before any merge request**
...
...
@@ -26,6 +26,16 @@ Preferably, one should install [gcovr](http://www.gcovr.com) and build `pugs` sp
However coverage is computed at each
`push`
by the
`gitlab-ci`
.
----
## Update build environment using [Docker](http://www.docker.com)
This is the easiest way to keep your environment update to build
`pugs`
.
Running the
[
docker-pugs.sh
](
tools/docker-pugs.sh
)
script creates the image and
runs it in interactive mode. The image will runs the user's permissions and his
home directory is mounted.
**keep in mind that the produced executable will only run inside docker**
----
## Coding
...
...
This diff is collapsed.
Click to expand it.
tools/docker-pugs.sh
0 → 100755
+
76
−
0
View file @
4e529e65
#! /bin/sh
DOCKER
=
$(
command
-v
docker 2>/dev/null
)
if
[
"
${
DOCKER
}
"
=
""
]
then
echo
Could not find Docker on your system. Check your installation.
exit
1
fi
echo
"Using docker:
${
DOCKER
}
"
USABLE_DOCKER
=
$(
${
DOCKER
}
info
>
/dev/null 2>&1
&&
echo yes
)
if
[
"
${
USABLE_DOCKER
}
"
!=
"yes"
]
then
echo
"################### ABORTING ######################"
echo
"Cannot use Docker!"
echo
" - check that Docker server is running"
echo
" - check that you have permissions to use it"
echo
" (usually user must belong to the 'docker' group)"
echo
"###################################################"
exit
1
fi
USER
=
$(
id
-un
)
USER_ID
=
$(
id
-u
)
USER_GID
=
$(
id
-g
)
DOCKER_HOSTNAME
=
"
$(
hostname
)
-docker"
DOCKERFILE_DIR
=
/tmp/
${
USER
}
/pugs.docker
mkdir
-p
${
DOCKERFILE_DIR
}
DOCKERFILE
=
"
${
DOCKERFILE_DIR
}
/Dockerfile"
cat
>
${
DOCKERFILE
}
<<
EOF
FROM ubuntu:bionic
ENV USER="
${
USER
}
" USER_ID="
${
USER_ID
}
" USER_GID="
${
USER_GID
}
" HOSTNAME="
${
DOCKER_HOSTNAME
}
"
RUN echo "
${
DOCKER_HOSTNAME
}
" > /etc/hostname
RUN groupadd --gid "
${
USER_GID
}
" "
${
USER
}
"
RUN useradd --uid "
${
USER_ID
}
" --gid "
${
USER_GID
}
" --create-home --shell /bin/bash "
${
USER
}
"
RUN apt-get update && apt-get -y upgrade && apt-get -y remove g++ gcc && apt-get -y install cmake git make lcov bc gnupg gnupg2 gnupg1 wget
RUN echo 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main' > /etc/apt/sources.list.d/backports.list
RUN wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-get update && apt-get -y upgrade && apt-get -y install clang-8 clang-tools-8 clang-8-doc libclang-common-8-dev libclang-8-dev libclang1-8 clang-format-8 python-clang-8
RUN apt-get -y install libparmetis-dev sudo
RUN apt-get clean
RUN rm /usr/bin/cc
RUN echo "
${
USER
}
ALL=(ALL:ALL) NOPASSWD:ALL" > "/etc/sudoers.d/
${
USER
}
"
RUN ln -s /usr/bin/clang-format-8 /usr/bin/clang-format
ENV CC="clang-8" CXX="clang++-8"
EOF
if
[
-e
"
${
DOCKERFILE
}
"
]
then
echo
"Successfully built:
${
DOCKERFILE
}
"
else
echo
"Aborting: unable to build
${
DOCKERFILE
}
"
exit
1
fi
IMAGE_NAME
=
"pugs-docker-
${
USER
}
"
${
DOCKER
}
build
-t
"
${
IMAGE_NAME
}
:latest"
${
DOCKERFILE_DIR
}
${
DOCKER
}
run
--volume
=
${
HOME
}
:
${
HOME
}
-w
$(
pwd
)
--user
${
USER_ID
}
:
${
USER_GID
}
-ti
--entrypoint
/bin/bash
--hostname
=
"
${
DOCKER_HOSTNAME
}
"
"
${
IMAGE_NAME
}
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment