-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
79 lines (75 loc) · 4.2 KB
/
.gitlab-ci.yml
File metadata and controls
79 lines (75 loc) · 4.2 KB
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
stages:
- test
- build
variables:
REPO_SERVER_HOST: ${CI_SERVER_PROTOCOL}://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}
static-analyse:
image: registry.git.jeyserver.com/jalno/phpstan:master
stage: test
variables:
GIT_ROOT_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME/packages/backuping
before_script:
- cd $GIT_ROOT_PATH
- rm -fr base && git clone --depth 1 https://github.com/jalno/base.git base
- cd ${GIT_ROOT_PATH} && cp -Rf base/* . && cd packages
- rm -fr PhpParser && git clone --depth 1 ${REPO_SERVER_HOST}/yeganemehr/PhpParser.git
- rm -fr phpmailer && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/phpmailer.git
- rm -fr cronjob && git clone --depth 1 ${REPO_SERVER_HOST}/yeganemehr/cronjob.git
- rm -fr finder && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/finder.git
script:
- phpstan analyse -c $GIT_CLONE_PATH/phpstan.neon $GIT_CLONE_PATH
build-app:
image: docker:20.10
services:
- docker:20.10-dind
stage: build
variables:
DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
GIT_ROOT_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME/packages/backuping
before_script:
- apk --no-cache add git
- cd $GIT_ROOT_PATH
- rm -fr base && git clone --depth 1 https://github.com/jalno/base.git base
- cd ${GIT_ROOT_PATH} && cp -Rf base/* . && rm -fr base && cd packages
- rm -fr cronjob # remove the cronjob package from the static analyse stage
- rm -fr PhpParser && git clone --depth 1 ${REPO_SERVER_HOST}/yeganemehr/PhpParser.git
- rm -fr phpmailer && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/phpmailer.git
- rm -fr dockerize && git clone --depth 1 ${REPO_SERVER_HOST}/yeganemehr/dockerize.git
- rm -fr finder && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/finder.git
- rm -fr s3_api && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/s3_api.git
- rm -fr s3 && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/s3.git
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- cd $GIT_ROOT_PATH
- cp packages/dockerize/.dockerignore .
- docker build --pull -f packages/backuping/Dockerfile -t $DOCKER_IMAGE .
- docker push $DOCKER_IMAGE
build-app-stable-dependencies:
image: docker:20.10
services:
- docker:20.10-dind
stage: build
variables:
DOCKER_IMAGE: $CI_REGISTRY_IMAGE:stable-$CI_COMMIT_REF_SLUG
GIT_ROOT_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME/packages/backuping
before_script:
- apk --no-cache add git
- cd $GIT_ROOT_PATH
- rm -fr base && git clone --depth 1 https://github.com/jalno/base.git base && git -C ./base/ checkout ee33f396c4cc1c1d5c57b009b99bb93ad762114d
- cd ${GIT_ROOT_PATH} && cp -Rf base/* . && rm -fr base && cd packages
- rm -fr cronjob # remove the cronjob package from the static analyse stage
- rm -fr PhpParser && git clone --depth 1 ${REPO_SERVER_HOST}/yeganemehr/PhpParser.git && git -C ./PhpParser/ checkout 556e71cd8cc1ec99f78061e453e2192c7dccf154
- rm -fr phpmailer && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/phpmailer.git && git -C ./phpmailer checkout fdd5ad85e47b60fef08e4c19a9102e47b7618519
- rm -fr dockerize && git clone --depth 1 ${REPO_SERVER_HOST}/yeganemehr/dockerize.git && git -C ./dockerize checkout 9d53d047d5e448f5b6450e3e8e92a3d8eb28a686
- rm -fr finder && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/finder.git && git -C ./finder checkout 5d8f2037945a87252904f6be9a10a649db7686c6
- rm -fr s3_api && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/s3_api.git && git -C ./s3_api checkout 3c9f76e2478a4371c517edf483a63b86e1a8b6c5
- rm -fr s3 && git clone --depth 1 ${REPO_SERVER_HOST}/hosni/s3.git && git -C ./s3 checkout a6f00bfd0cd57caaf4c4a91457454a95af3f7925
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- cd $GIT_ROOT_PATH
- cp packages/dockerize/.dockerignore .
- docker build --pull -f packages/backuping/Dockerfile -t $DOCKER_IMAGE .
- docker push $DOCKER_IMAGE