-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
102 lines (89 loc) · 1.97 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
stages:
- build
- test
- deploy
variables:
PACKAGE: '/usr/local/lib/python3.9/site-packages'
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
QTAG: 'qe-7.2g'
QTAGNEW: 'qepy-7.2g-dev'
QEDIR: '/usr/src/app/q-e/'
PUBLIC: 'package'
build:
stage: build
except:
refs:
- github
- action
changes:
- "*.md"
- "doc/**/*"
image: $CONTAINER_IMAGE:$QTAG
script:
- git submodule update --init --recursive
- qedir=$QEDIR tddft=yes python -m pip install .
- mkdir $PUBLIC
- cd $PUBLIC
- PACKAGE=$(python -c 'import qepy, os; print(os.path.split(qepy.__path__[0])[0])')
- cp -r $PACKAGE/qepy* .
- ls *
artifacts:
name: "QEpy-$CI_COMMIT_REF_SLUG-${CI_COMMIT_SHA::9}"
paths:
- $PUBLIC
test:
stage: test
except:
refs:
- github
- action
changes:
- "*.md"
- "doc/**/*"
image: $CONTAINER_IMAGE:$QTAG
script:
- cp -r $PUBLIC/* $PACKAGE
- cd examples/test
- bash test.sh
test-mpi:
stage: test
except:
refs:
- github
- action
changes:
- "*.md"
- "doc/**/*"
image: $CONTAINER_IMAGE:$QTAG
script:
- cp -r $PUBLIC/* $PACKAGE
- cd examples/test
- export MPIRUN="mpirun --allow-run-as-root --oversubscribe"
- bash test.sh p
qe:
stage: test
only:
- docker
image: $CONTAINER_IMAGE:$QTAG
script:
- cp -r $PUBLIC/* $PACKAGE
- cd examples/test/qe
- bash test.sh
docker_image:
stage: deploy
only:
- docker
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker pull $CONTAINER_IMAGE:$QTAG || true
- docker run -t -d --name qepy_con $CONTAINER_IMAGE:$QTAG
- docker cp $PUBLIC/qepy qepy_con:$PACKAGE
- docker cp $PUBLIC/qepy-* qepy_con:$PACKAGE
- docker commit qepy_con $CONTAINER_IMAGE:$QTAGNEW
- docker push $CONTAINER_IMAGE:$QTAGNEW