Skip to content

Commit 7cbe7ef

Browse files
author
CircleCI Bot
committed
🤖 Automated promotion
* release/v0.6.45: 🥚 🐔 Ensure new release version is numeric, optional leading 'v' Increase specificity of old release detection Formatting Use default curl parameters to download googleSDK Pin gitflow version to 1.11.0. Circumvent breaking change in latest version: petervanderdoes/gitflow-avh#394 Verbose notification for API builds
2 parents 567b451 + 6bba104 commit 7cbe7ef

File tree

5 files changed

+35
-28
lines changed

5 files changed

+35
-28
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defaults: &defaults
33
environment:
44
GOOGLE_PROJECT_ID: planet-4-151612
55
docker:
6-
- image: gcr.io/planet-4-151612/circleci-base:latest
6+
- image: gcr.io/planet-4-151612/circleci-base:develop
77
working_directory: /home/circleci/app
88

99
version: 2

src/circleci-base/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Planet 4 CircleCI build image
2-
# Branch: master
3-
# Commit: 74ddf4d1f2b5fa47fe5f0bf9e1e24a69008a78a0
4-
# Build: https://circleci.com/gh/greenpeace/planet4-circleci/1203
2+
# Branch: develop
3+
# Commit: f1f9cbf5f73c66abf7cd162be2c0a7d7d3019afd
4+
# Build: (local)
55
# ------------------------------------------------------------------------
66
# DO NOT MAKE CHANGES HERE
77
# This file is built automatically from ./templates/Dockerfile.in
@@ -37,8 +37,8 @@ RUN git clone https://github.com/sstephenson/bats.git && \
3737
export "DESIRED_VERSION=v2.12.3" && \
3838
curl -sS https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash - && \
3939
wget --no-check-certificate -q https://raw.githubusercontent.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh && \
40-
bash gitflow-installer.sh install stable && \
41-
rm gitflow-installer.sh && \
40+
bash gitflow-installer.sh install version 1.11.0 && \
41+
rm -fr git-flow gitflow-installer.sh && \
4242
curl -s https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 > /usr/local/bin/cloud_sql_proxy && \
4343
chmod 0755 /usr/local/bin/cloud_sql_proxy && \
4444
apt-get install -y --no-install-recommends \
@@ -63,7 +63,7 @@ RUN git clone https://github.com/sstephenson/bats.git && \
6363

6464
USER circleci
6565

66-
RUN curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 60 -L "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-231.0.0-linux-x86_64.tar.gz" | tar xz && \
66+
RUN curl "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-231.0.0-linux-x86_64.tar.gz" | tar xz && \
6767
CLOUDSDK_CORE_DISABLE_PROMPTS=1 ./google-cloud-sdk/install.sh \
6868
--usage-reporting false \
6969
--bash-completion false \

src/circleci-base/scripts/release-prepare-nro.sh

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,67 +13,73 @@ set -euo pipefail
1313
old_release=${1:-$(git-current-tag.sh)}
1414
new_release=${2:-$(increment-version.sh "$old_release")}
1515

16-
echo "--0.1 The old release is $old_release"
17-
echo "--0.2 The new release is $new_release"
16+
# Check for numeric value of new release version
17+
# Permits optional leading 'v' character
18+
[[ ${new_release#v} =~ ^[0-9] ]] || {
19+
echo "ERROR: release is not numeric: '${new_release#v}'"
20+
exit 1
21+
}
22+
23+
echo "-- 0.1 The old release is $old_release"
24+
echo "-- 0.2 The new release is $new_release"
1825

1926
merged=false
2027

2128
mkdir -p /tmp/workspace
2229

23-
echo "--1.0 Before the first if"
30+
echo "-- 1.0 Before the first if"
2431
if release-start.sh "$new_release"
2532
then
26-
echo "--1.1 New release branch created: release/$new_release"
33+
echo "-- 1.1 New release branch created: release/$new_release"
2734
merged=true
2835
else
29-
echo "--1.1 Release branch release/$new_release already exists"
36+
echo "-- 1.1 Release branch release/$new_release already exists"
3037
# Release branch already exists
3138
git checkout "release/$new_release"
3239

3340
# If there are any changes from develop
3441
# Merge changes from develop to release
3542
git merge -Xtheirs --no-edit --log -m ":robot: release/$new_release Merge develop" develop | tee /tmp/workspace/merge.log
36-
43+
3744
grep -q "Already up-to-date." /tmp/workspace/merge.log || {
38-
echo "--1.2 We merged changes from develop into release/$new_release"
45+
echo "-- 1.2 We merged changes from develop into release/$new_release"
3946
merged=true;
4047
}
4148
fi
4249

4350
# Perform NRO develop to release manipulations
4451
echo
45-
echo "---2. Performing automated release modifications ..."
52+
echo "-- 2.0 Performing automated release modifications ..."
4653
pin-composer-versions.sh
4754

4855
# If there are any local changes
4956
if ! git diff --exit-code
5057
then
51-
echo "---2.1 Staging modifications"
58+
echo "-- 2.1 Staging modifications"
5259
# Stage changes
5360
git add .
5461

5562
if [[ "$merged" = "true" ]]
5663
then
57-
echo "---2.1.1 Since we've merged changes from develop, let's amend that commit"
58-
git commit --amend --no-edit --allow-empty
64+
echo "-- 2.1.1 Since we've merged changes from develop, let's amend that commit"
65+
git commit --amend --no-edit
5966
else
60-
echo "---2.1.2 Create new commit with automated modifications"
61-
git commit -m ":robot: release/$new_release Automated modifications "
67+
echo "-- 2.1.2 Create new commit with automated modifications"
68+
git commit -m ":robot: release/$new_release Automated modifications"
6269
merged=true
6370
fi
6471
fi
6572

66-
echo "--3.0 Before the final if"
6773
if [[ "$merged" = "false" ]]
6874
then
6975
# No local changes
7076
repo=$(git remote get-url origin | cut -d'/' -f 2 | cut -d'.' -f1)
71-
echo "---3.1 No changes to merge. Triggering $repo@release/$new_release via API"
77+
echo "-- 3.1 No changes to merge. Triggering $repo@release/$new_release via API"
7278
trigger-build-api.sh "$repo" "release/$new_release"
7379
else
74-
echo "---3.2 Local changes have been merged, pushing changes to remote"
80+
echo "-- 3.2 Local changes have been merged, pushing changes to remote"
7581

76-
echo "---3.2.1 Remove all the build trigger notifications from the latest commit message"
82+
echo "-- 3.2.1 Remove all the build trigger notifications from the latest commit message"
7783
# Remove all the build trigger notifications from the latest commit message
7884
message=$(git show --format=%B | grep -v ":robot: Build trigger")
7985
git commit --amend -m "$message"
@@ -83,7 +89,7 @@ else
8389
git push -u origin "release/$new_release"
8490

8591
echo "---3.2.3 Check if old release branch still exists"
86-
gitlsremote=$(git ls-remote)
92+
gitlsremote=$(git ls-remote | grep release | grep -v "release/$new_release")
8793
if [[ $gitlsremote =~ release/$old_release ]]
8894
then
8995
# Delete the old release branch

src/circleci-base/scripts/trigger-build-api.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ json=$(jq -n \
1212
"branch": $VAL
1313
}')
1414

15+
echo "Build: ${user}/${repo}@${branch}"
1516

1617
curl \
1718
--header "Content-Type: application/json" \

src/circleci-base/templates/Dockerfile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ RUN git clone https://github.com/sstephenson/bats.git && \
2828
export "DESIRED_VERSION=v${HELM_VERSION}" && \
2929
curl -sS https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash - && \
3030
wget --no-check-certificate -q https://raw.githubusercontent.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh && \
31-
bash gitflow-installer.sh install stable && \
32-
rm gitflow-installer.sh && \
31+
bash gitflow-installer.sh install version 1.11.0 && \
32+
rm -fr git-flow gitflow-installer.sh && \
3333
curl -s https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 > /usr/local/bin/cloud_sql_proxy && \
3434
chmod 0755 /usr/local/bin/cloud_sql_proxy && \
3535
apt-get install -y --no-install-recommends \
@@ -54,7 +54,7 @@ RUN git clone https://github.com/sstephenson/bats.git && \
5454

5555
USER ${CIRCLECI_USER}
5656

57-
RUN curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 60 -L "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz" | tar xz && \
57+
RUN curl "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz" | tar xz && \
5858
CLOUDSDK_CORE_DISABLE_PROMPTS=1 ./google-cloud-sdk/install.sh \
5959
--usage-reporting false \
6060
--bash-completion false \

0 commit comments

Comments
 (0)