-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (54 loc) · 1.83 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
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: none
SCALAR_VERSION: "2.6.2"
stages:
- code
- base
core:
stage: code
image: 110459940082.dkr.ecr.us-east-1.amazonaws.com/lafayette/php73-wordpress:ac524617
before_script:
- git config --global url."https://github.com".insteadOf git://github.com
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@git.lafayette.edu/".insteadOf "git@git.lafayette.edu:"
script:
- git clean -ffd
artifacts:
expire_in: 1 week
paths:
- core/
variables:
GIT_SUBMODULE_STRATEGY: normal
.build_docker:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
.build_docker_base:
extends: .build_docker
script:
- echo "{\"credsStore\":\"ecr-login\"}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR/ --dockerfile $CI_PROJECT_DIR/Dockerfile --build-arg PHP_VERSION=$PHP_VERSION --build-arg CI_JOB_TOKEN --build-arg PHP_MEMORY_LIMIT=$PHP_MEMORY_LIMIT --destination $ECR_REPOSITORY:$SCALAR_VERSION
only:
changes:
- config/*
- core/*
- Dockerfile
- .gitlab-ci.yml
build_docker_base_staging:
extends: .build_docker_base
stage: base
variables:
AWS_ACCESS_KEY_ID: '$AWS_ACCESS_KEY_ID_STAGING'
AWS_SECRET_ACCESS_KEY: '$AWS_SECRET_ACCESS_KEY_STAGING'
ECR_REPOSITORY: '$ECR_REPOSITORY_BASE_STAGING'
PHP_MEMORY_LIMIT: '256M'
build_docker_base_prod:
extends: .build_docker_base
stage: base
variables:
AWS_ACCESS_KEY_ID: '$AWS_ACCESS_KEY_ID_PROD'
AWS_SECRET_ACCESS_KEY: '$AWS_SECRET_ACCESS_KEY_PROD'
ECR_REPOSITORY: '$ECR_REPOSITORY_BASE_PROD'
PHP_MEMORY_LIMIT: '1024M'
only:
- primary