Skip to content

Commit 6851bf8

Browse files
committed
Cleanup.
1 parent 20c5414 commit 6851bf8

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

pipe/pipe.sh

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@ export PROJECT_ENVIRONMENT=${BITBUCKET_DEPLOYMENT_ENVIRONMENT}
1919
export COMPOSE_PROJECT_NAME="${PROJECT_NAME}_${PROJECT_ENVIRONMENT}"
2020
export TIMESTAMP=$(date +%s)
2121

22+
valid_sentry_credentials() {
23+
if [[ -n "${SENTRY_RELEASE}" ]] && [[ -n "${SENTRY_ORG}" ]] && [[ -n "${SENTRY_AUTH_TOKEN}" ]]; then
24+
return 1
25+
fi
26+
27+
return 0
28+
}
29+
30+
create_sentry_release() {
31+
valid_sentry_credentials && return
32+
33+
sentry-cli releases new -p "${PROJECT_NAME}" "${SENTRY_RELEASE}"
34+
success "Created new Sentry release"
35+
36+
sentry-cli releases set-commits --auto "${SENTRY_RELEASE}"
37+
success "Associate commits with the release"
38+
}
39+
40+
finalize_sentry_release() {
41+
valid_sentry_credentials && return
42+
43+
sentry-cli releases finalize "${SENTRY_RELEASE}"
44+
success "Sentry release successfully finalized"
45+
}
46+
2247
build_push() {
2348
aws ecr get-login-password | docker login --username AWS --password-stdin ${DOCKER_REGISTRY_URL}
2449

@@ -27,6 +52,8 @@ build_push() {
2752
docker-compose build
2853
success "Successfully built"
2954

55+
create_sentry_release
56+
3057
PROJECT_NAME="${DOCKER_REGISTRY_URL}/${PROJECT_NAME}" \
3158
docker-compose push
3259
success "Successfully pushed to registry"
@@ -55,34 +82,7 @@ setup_ssh() {
5582
success "SSH key has been successfully set"
5683
}
5784

58-
valid_sentry_credentials() {
59-
if [[ -n "${SENTRY_RELEASE}" ]] && [[ -n "${SENTRY_ORG}" ]] && [[ -n "${SENTRY_AUTH_TOKEN}" ]]; then
60-
return 1
61-
fi
62-
63-
return 0
64-
}
65-
66-
create_sentry_release() {
67-
valid_sentry_credentials && return
68-
69-
sentry-cli releases new -p "${PROJECT_NAME}" "${SENTRY_RELEASE}"
70-
success "Created new Sentry release"
71-
72-
sentry-cli releases set-commits --auto "${SENTRY_RELEASE}"
73-
success "Associate commits with the release"
74-
}
75-
76-
finalize_sentry_release() {
77-
valid_sentry_credentials && return
78-
79-
sentry-cli releases finalize "${SENTRY_RELEASE}"
80-
success "Sentry release successfully finalized"
81-
}
82-
8385
deploy() {
84-
create_sentry_release
85-
8686
PROJECT_NAME="${DOCKER_REGISTRY_URL}/${PROJECT_NAME}" \
8787
DOCKER_HOST=${DOCKER_SWARM_HOST} \
8888
docker stack deploy --with-registry-auth --prune \

0 commit comments

Comments
 (0)