This repository has been archived by the owner on Nov 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yaml
57 lines (53 loc) · 1.62 KB
/
.gitlab-ci.yaml
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
cache: &default-cache
key: '${CI_COMMIT_REF_SLUG}'
paths:
- generated/
stages:
- retrieve
- deploy
# ---
deploy:versions:
before_script:
- 'apk add --no-cache --no-progress ca-certificates git'
- 'git config --global user.email "${GIT_USER_EMAIL}"'
- 'git config --global user.name "${GIT_USER_NAME}"'
- 'git remote set-url origin "https://${GITLAB_USER}:${GITLAB_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"'
cache:
<<: *default-cache
policy: pull
image:
entrypoint: ['']
name: alpine:latest
only:
- master
retry:
max: 2
script:
- 'rm -f -r $(ls | grep -v generated)'
- 'mv generated/* ./'
- 'rm -f -r .gitignore .gitlab-ci.yaml .php_cs generated'
- 'git checkout --orphan generated'
- 'git add -A'
- 'git commit -m "$(date --utc ''+%Y-%m-%d %H:%M'')"'
- 'git push origin generated --force'
stage: deploy
retrieve:versions:
before_script:
- 'curl --location --output /usr/bin/composer "https://getcomposer.org/composer-stable.phar"'
- 'chmod +x /usr/bin/composer'
- 'composer config -g github-oauth.github.com "${GITHUB_TOKEN}"'
- 'curl --location --output /usr/local/bin/melody "http://get.sensiolabs.org/melody.phar"'
- 'chmod +x /usr/local/bin/melody'
cache:
<<: *default-cache
policy: push
except:
- generated
image:
entrypoint: ['']
name: registry.gitlab.com/timonier/php:cli
retry:
max: 2
script:
- 'bin/retrieve-versions'
stage: retrieve