-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
65 lines (62 loc) · 2.94 KB
/
bitbucket-pipelines.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
image: php:8.3.7-fpm-bullseye
definitions:
steps:
- step: &build-step
name: Build JS
caches:
- composer
- node
script:
# We actually just need to build the JS to public/build, but the JS build needs a JS package ziggy-js
# that is installed in composer vendor. So we also have to do composer install although this vendor dir
# will not get uploaded to app engine at deploy step.
- apt-get update
- apt-get install -y zip # needed for one of composer package
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.6.5
- composer install --no-dev
- curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
- apt-get install -y nodejs
- npm install
- npm run build
artifacts:
- public/build/**
pipelines:
branches:
dev:
- step: *build-step
- step:
name: Deploy to GAE dev environment
script:
# Populate app.yaml from the template of dev environment.
# Variables are taken from Bitbucket's Repository Variables.
- cp app.yaml.dev app.yaml
- cp additional-supervisord.conf.template additional-supervisord.conf # for queue worker
- sed -i 's|\<\(APP_KEY:\).*|\1 '"$DEV_APP_KEY"'|' app.yaml
- sed -i 's|\<\(CHATGPT_KEY:\).*|\1 '"$DEV_OPENAI_KEY"'|' app.yaml
- sed -i 's|\<\(MONGODB_SRV:\).*|\1 '"$DEV_MONGODB_SRV"'|' app.yaml
- sed -i 's|\<\(GOOGLE_CLIENT_ID:\).*|\1 '"$GOOGLE_CLIENT_ID"'|' app.yaml
- sed -i 's|\<\(GOOGLE_CLIENT_SECRET:\).*|\1 '"$GOOGLE_CLIENT_SECRET"'|' app.yaml
- pipe: atlassian/google-app-engine-deploy:1.5.0
variables:
KEY_FILE: $KEY_FILE
PROJECT: daftar-properti-dev-2
STOP_PREVIOUS_VERSION: "true"
staging:
- step: *build-step
- step:
name: Deploy to GAE staging environment
script:
# Populate app.yaml from the template of dev environment.
# Variables are taken from Bitbucket's Repository Variables.
- cp app.yaml.staging app.yaml
- cp additional-supervisord.conf.template additional-supervisord.conf # for queue worker
- sed -i 's|\<\(APP_KEY:\).*|\1 '"$STAGING_APP_KEY"'|' app.yaml
- sed -i 's|\<\(CHATGPT_KEY:\).*|\1 '"$STAGING_OPENAI_KEY"'|' app.yaml
- sed -i 's|\<\(MONGODB_SRV:\).*|\1 '"$STAGING_MONGODB_SRV"'|' app.yaml
- sed -i 's|\<\(GOOGLE_CLIENT_ID:\).*|\1 '"$STAGING_GOOGLE_CLIENT_ID"'|' app.yaml
- sed -i 's|\<\(GOOGLE_CLIENT_SECRET:\).*|\1 '"$STAGING_GOOGLE_CLIENT_SECRET"'|' app.yaml
- pipe: atlassian/google-app-engine-deploy:1.5.0
variables:
KEY_FILE: $STAGING_KEY_FILE
PROJECT: daftar-properti-staging
STOP_PREVIOUS_VERSION: "true"