Skip to content

Commit cf7ec66

Browse files
committed
Update Semaphore configuration
1 parent 4d642f1 commit cf7ec66

2 files changed

Lines changed: 38 additions & 69 deletions

File tree

.semaphore/production.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
version: v1.0
2-
name: "🚀 Deploy to production"
3-
2+
name: "\U0001F680 Deploy to production"
43
agent:
54
machine:
65
type: f1-standard-2
76
os_image: ubuntu2204
8-
97
fail_fast:
108
stop:
119
when: branch != 'main'
12-
1310
global_job_config:
1411
prologue:
1512
commands:
@@ -20,28 +17,25 @@ global_job_config:
2017
return 0
2118
}
2219
- run_or_pass "checkout"
23-
2420
blocks:
25-
- name: "🧱 Build & Push"
21+
- name: "\U0001F9F1 Build & Push"
2622
task:
2723
jobs:
2824
- name: Docker image
2925
commands:
30-
- echo "🔨 Building Docker image ${DOCKER_IMAGE}:${SEMAPHORE_GIT_SHA}"
31-
- echo "📤 Pushing image to registry..."
32-
33-
- name: "🚢 Deploy"
26+
- "echo \"\U0001F528 Building Docker image ${DOCKER_IMAGE}:${SEMAPHORE_GIT_SHA}\""
27+
- "echo \"\U0001F4E4 Pushing image to registry...\""
28+
- name: "\U0001F6A2 Deploy"
3429
task:
3530
jobs:
3631
- name: Update deployment
3732
commands:
38-
- echo "🚀 Deploying ${DOCKER_IMAGE}:${SEMAPHORE_GIT_SHA} to ${KUBE_NAMESPACE} namespace"
33+
- "echo \"\U0001F680 Deploying ${DOCKER_IMAGE}:${SEMAPHORE_GIT_SHA} to ${KUBE_NAMESPACE} namespace\""
3934
- echo "⏳ Waiting for rollout to complete..."
40-
41-
- name: "🩺 Check"
35+
- name: "\U0001FA7A Check"
4236
task:
4337
jobs:
4438
- name: Health check
4539
commands:
46-
- echo "🔍 Checking health at ${HEALTH_URL}"
40+
- "echo \"\U0001F50D Checking health at ${HEALTH_URL}\""
4741
- echo "✅ Deployment successful (simulated)"

.semaphore/semaphore.yml

Lines changed: 30 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
version: v1.0
2-
name: "💎 Ruby CI Pipeline"
3-
4-
# ---------------------------------------------------------------------
5-
# GLOBAL SETTINGS
6-
# ---------------------------------------------------------------------
2+
name: "\U0001F48E Ruby CI Pipeline"
73
agent:
84
machine:
9-
type: f1-standard-2
10-
os_image: ubuntu2404
11-
5+
type: e1-standard-2
6+
os_image: ubuntu2004
7+
containers:
8+
- name: main
9+
image: 'semaphoreci/ubuntu:20.04'
1210
fail_fast:
1311
stop:
1412
when: branch != 'main'
@@ -17,12 +15,9 @@ auto_cancel:
1715
when: branch != 'main'
1816
queued:
1917
when: branch = 'main'
20-
21-
# Common pre-steps for every job
2218
global_job_config:
2319
prologue:
2420
commands:
25-
# Helper: run a command, or sleep N seconds and pass
2621
- |
2722
run_or_pass() {
2823
echo "→ $*"
@@ -35,22 +30,15 @@ global_job_config:
3530
fi
3631
return 0
3732
}
38-
- export SLEEP_SEC="${SLEEP_SEC:-12}"
39-
40-
# Usual setup, protected by run_or_pass
33+
- 'export SLEEP_SEC="${SLEEP_SEC:-12}"'
4134
- run_or_pass checkout
4235
- run_or_pass "sem-service start postgres 17"
4336
- run_or_pass "sem-service start redis 7"
4437
- run_or_pass "sem-version ruby 3.2.2"
4538
- run_or_pass "sem-version node 20.11.0"
4639
- run_or_pass "cache restore"
47-
48-
# ---------------------------------------------------------------------
49-
# WORKFLOW
50-
# ---------------------------------------------------------------------
5140
blocks:
52-
# ---------------- SETUP ----------------
53-
- name: "🛠 Setup & Cache"
41+
- name: "\U0001F6E0 Setup & Cache"
5442
task:
5543
jobs:
5644
- name: Install Gems & JS deps
@@ -62,60 +50,49 @@ blocks:
6250
- run_or_pass "gem install --no-document semaphore_test_boosters"
6351
- run_or_pass "cache store"
6452
dependencies: []
65-
66-
# ------------- FRONT-END BUILD -------------
67-
- name: "🖼️ Webpacker Build"
53+
- name: "\U0001F5BC️ Webpacker Build"
6854
task:
6955
jobs:
7056
- name: Compile Assets
7157
commands:
7258
- run_or_pass "cache restore webpacker-assets"
73-
- run_or_pass "bundle exec rake webpacker:compile"
59+
- 'run_or_pass "bundle exec rake webpacker:compile"'
7460
- run_or_pass "cache store webpacker-assets public/packs"
75-
dependencies:
76-
- "🛠 Setup & Cache"
77-
78-
# ------------- CODE QUALITY -------------
79-
- name: "🔍 ESLint & Stylelint"
61+
dependencies: []
62+
- name: "\U0001F50D ESLint & Stylelint"
8063
task:
8164
jobs:
8265
- name: JS / CSS Lint
8366
commands:
8467
- run_or_pass "yarn run eslint ."
8568
- run_or_pass "yarn run stylelint '**/*.scss'"
8669
dependencies:
87-
- "🖼️ Webpacker Build"
88-
89-
- name: "🧹 RuboCop"
70+
- "\U0001F5BC️ Webpacker Build"
71+
- name: "\U0001F9F9 RuboCop"
9072
task:
9173
jobs:
9274
- name: Ruby Style Check
9375
commands:
9476
- run_or_pass "bundle exec rubocop"
9577
dependencies:
96-
- "🛠 Setup & Cache"
97-
98-
# ------------- SECURITY -------------
99-
- name: "🛡️ Brakeman"
78+
- "\U0001F6E0 Setup & Cache"
79+
- name: "\U0001F6E1️ Brakeman"
10080
task:
10181
jobs:
10282
- name: Static Analysis
10383
commands:
10484
- run_or_pass "bundle exec brakeman --force"
10585
dependencies:
106-
- "🛠 Setup & Cache"
107-
108-
- name: "🛡️ Bundler Audit"
86+
- "\U0001F6E0 Setup & Cache"
87+
- name: "\U0001F6E1️ Bundler Audit"
10988
task:
11089
jobs:
11190
- name: Gem CVE Check
11291
commands:
11392
- run_or_pass "bundle exec bundle-audit check --update"
11493
dependencies:
115-
- "🛠 Setup & Cache"
116-
117-
# ------------- TEST SUITE (Boosters) -------------
118-
- name: "🚦 RSpec Suite"
94+
- "\U0001F6E0 Setup & Cache"
95+
- name: "\U0001F6A6 RSpec Suite"
11996
task:
12097
env_vars:
12198
- name: RAILS_ENV
@@ -125,21 +102,19 @@ blocks:
125102
- name: PGUSER
126103
value: postgres
127104
jobs:
128-
- name: "🟢 RSpec Tests"
105+
- name: "\U0001F7E2 RSpec Tests"
129106
parallelism: 5
130107
commands:
131108
- run_or_pass "cache restore webpacker-assets"
132-
- run_or_pass "bundle exec rake db:setup"
133-
# Try to run split tests with Boosters; if unavailable, sleep and pass
109+
- 'run_or_pass "bundle exec rake db:setup"'
134110
- run_or_pass 'rspec_booster --job "$SEMAPHORE_JOB_INDEX/$SEMAPHORE_JOB_COUNT" --format RspecJunitFormatter --out report.xml --format documentation'
135111
dependencies:
136-
- "🧹 RuboCop"
137-
- "🛡️ Brakeman"
138-
- "🛡️ Bundler Audit"
139-
- "🖼️ Webpacker Build"
140-
112+
- "\U0001F9F9 RuboCop"
113+
- "\U0001F6E1️ Brakeman"
114+
- "\U0001F6E1️ Bundler Audit"
115+
- "\U0001F5BC️ Webpacker Build"
141116
promotions:
142-
- name: Production
143-
pipeline_file: production.yml
144-
auto_promote:
145-
when: "result = 'passed' and branch = 'master'"
117+
- name: Production
118+
pipeline_file: production.yml
119+
auto_promote:
120+
when: result = 'passed' and branch = 'master'

0 commit comments

Comments
 (0)