Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
zesje
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
157
Issues
157
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zesje
zesje
Commits
05431084
Verified
Commit
05431084
authored
Apr 27, 2020
by
Hugo Kerstens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run CI in docker image
parent
78ce7b42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
32 deletions
+40
-32
.gitlab-ci.yml
.gitlab-ci.yml
+28
-28
Dockerfile
Dockerfile
+12
-4
No files found.
.gitlab-ci.yml
View file @
05431084
...
...
@@ -2,57 +2,57 @@
image
:
gitlab.kwant-project.org:5005/zesje/zesje/test:latest
stages
:
-
build-env
-
build
-
test
# Special hidden job that is merged with JS jobs
.node_modules
:
&node_modules
# Cache the JS modules that yarn fetches
cache
:
untracked
:
true
paths
:
-
.yarn-cache
before_script
:
-
source activate zesje-dev
-
yarn install --cache-folder .yarn-cache
variables
:
TEST_IMAGE
:
CI_REGISTRY_IMAGE/test:${CI_COMMIT_REF_SLUG}
.python_packages
:
&python_packages
build-image
:
stage
:
build-env
image
:
name
:
gcr.io/kaniko-project/executor:debug-v0.16.0
entrypoint
:
[
"
"
]
artifacts
:
untracked
:
true
expire_in
:
1 hour
before_script
:
-
source activate zesje-dev
-
conda env update
build
:
<<
:
*node_modules
stage
:
build
-
mkdir -p /kaniko/.docker
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script
:
-
python3 -m compileall zesje
-
yarn build
artifacts
:
paths
:
-
zesje/static
expire_in
:
1 week
-
mkdir docker
-
cp Dockerfile docker/
-
cp environment.yml docker/
-
cp package.json docker/
-
/kaniko/executor
--context $CI_PROJECT_DIR/docker
--dockerfile $CI_PROJECT_DIR/docker/Dockerfile
--destination $TEST_IMAGE
--cache=true
test_js
:
<<
:
*node_modules
image
:
$TEST_IMAGE
stage
:
test
script
:
yarn test:js
script
:
-
yarn test:js
lint_js
:
<<
:
*node_modules
image
:
$TEST_IMAGE
stage
:
test
allow_failure
:
true
script
:
-
yarn lint:js
lint_py
:
<<
:
*python_packages
image
:
$TEST_IMAGE
stage
:
test
allow_failure
:
true
script
:
-
yarn lint:py
test_py
:
<<
:
*python_packages
image
:
$TEST_IMAGE
stage
:
test
script
:
-
yarn test:py:cov
...
...
Dockerfile
View file @
05431084
...
...
@@ -12,13 +12,21 @@ RUN apt-get update && \
WORKDIR
/app
ADD
environment.yml /app/environment.yml
# Setup PYTHON packages
ADD
environment.yml .
RUN
conda
env
create
# From https://medium.com/@chadlagore/conda-environments-with-docker-82cdc9d25754
RUN
echo
"source activate
$(
head
-1
/app/environment.yml |
cut
-d
' '
-f2
)
"
>
~/.bashrc
ENV
PATH /opt/conda/envs/$(head -1 /app/environment.yml | cut -d' ' -f2)/bin:$PATH
RUN
echo
"source activate zesje-dev"
>
~/.bashrc
ENV
PATH /opt/conda/envs/zesje-dev/bin:$PATH
RUN
rm
environment.yml
# Setup YARN packages
RUN
rm
/app/environment.yml
ADD
package.json .
RUN
yarn
install
RUN
rm
package.json
CMD
bash
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment