Skip to content

Commit 03997b8

Browse files
committed
Adding new 'init-builders' stage, which uses SQS and Auto Scaling EC2 builders, to spin up a builder for Linux and Windows. This is designed to save money, and not run our gitlab builders constantly.
1 parent 3f12f48 commit 03997b8

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.gitlab-ci.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
stages:
2+
- init-builders
23
- build-libopenshot-audio
34
- trigger-libopenshot
45

56
variables:
67
GIT_LOG_FORMAT: "- %h %ad %s [%aN]"
78

9+
init_linux_builder:
10+
stage: init-builders
11+
tags:
12+
- gitlab-server
13+
script:
14+
- send-ci-sqs linux
15+
16+
init_windows_builder:
17+
stage: init-builders
18+
tags:
19+
- gitlab-server
20+
script:
21+
- send-ci-sqs windows
22+
823
linux-builder:
924
stage: build-libopenshot-audio
25+
needs: [init_linux_builder]
1026
artifacts:
1127
expire_in: 6 months
1228
paths:
@@ -20,7 +36,9 @@ linux-builder:
2036
- PROJECT_SO=$(grep -E '^set\(PROJECT_SO_VERSION (.*)' ../CMakeLists.txt | awk '{print $2}' | tr -d ')')
2137
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID\nCI_PIPELINE_ID:$CI_PIPELINE_ID\nVERSION:$PROJECT_VERSION\nSO:$PROJECT_SO" > "install-x64/share/$CI_PROJECT_NAME.env"
2238
- git log $(git describe --tags --abbrev=0 @^)..@ --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
23-
when: always
39+
after_script:
40+
- if [ "$CI" = "true" ]; then sudo shutdown -h now; fi
41+
when: on_success
2442
except:
2543
- tags
2644
tags:
@@ -49,6 +67,7 @@ mac-builder:
4967

5068
windows-builder-x64:
5169
stage: build-libopenshot-audio
70+
needs: [init_windows_builder]
5271
artifacts:
5372
expire_in: 6 months
5473
paths:
@@ -65,14 +84,17 @@ windows-builder-x64:
6584
- New-Item -path "build/install-x64/share/" -Name "$CI_PROJECT_NAME.env" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$CI_PIPELINE_ID`nVERSION:$PROJECT_VERSION`nSO:$PROJECT_SO" -ItemType file -force
6685
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
6786
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
68-
when: always
87+
after_script:
88+
- if ($env:CI -eq "true") { shutdown /s /t 0 }
89+
when: on_success
6990
except:
7091
- tags
7192
tags:
7293
- windows
7394

7495
windows-builder-x86:
7596
stage: build-libopenshot-audio
97+
needs: [init_windows_builder]
7698
artifacts:
7799
expire_in: 6 months
78100
paths:
@@ -89,7 +111,9 @@ windows-builder-x86:
89111
- New-Item -path "build/install-x86/share/" -Name "$CI_PROJECT_NAME.env" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$CI_PIPELINE_ID`nVERSION:$PROJECT_VERSION`nSO:$PROJECT_SO" -ItemType file -force
90112
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
91113
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x86/share/$CI_PROJECT_NAME.log"
92-
when: always
114+
after_script:
115+
- if ($env:CI -eq "true") { shutdown /s /t 0 }
116+
when: on_success
93117
except:
94118
- tags
95119
tags:

0 commit comments

Comments
 (0)