Skip to content

Commit 0d781c6

Browse files
authored
Merge pull request #2 from k7hpn/release/1.1.0
- Add upload of images based on test branch - Add change log - Script outputs the current version with -h
2 parents c1250eb + 7f4d01b commit 0d781c6

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.1.0] - 2021-12-02
11+
12+
### Added
13+
14+
- This change log
15+
- Push Docker images for branch "test" as well
16+
- Script outputs the current version with -h
17+
18+
## [1.0.1] - 2020-12-23
19+
20+
### Fixed
21+
22+
- Fix bug with GHCR authentication
23+
24+
## [1.0.0] - 2020-12-22
25+
26+
### Added
27+
28+
- `build.bash` build script for consistent builds across platforms
29+
- Sample C# .NET Core project to exercise the build script
30+
- `azure-pipelines-yml` to show how to call the script from Azure
31+
- GitHub workflow `build.yml` to show how to call the script as a GitHub Action
32+
33+
[unreleased]: https://github.com/mcld/buildscript/compare/v1.1.0...HEAD
34+
[1.1.0]: https://github.com/mcld/buildscript/compare/v1.0.1...v1.1.0
35+
[1.0.1]: https://github.com/mcld/buildscript/compare/v1.0.0...v1.0.1
36+
[1.0.0]: https://github.com/mcld/buildscript/releases/tag/v1.0.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The `build.bash` script helps build Docker images and upload them to container r
44

55
- Run the exact same build process locally as runs in the CI environment and produces production Docker images.
66
- No script modifications necessary, configure for different systems with environment variables.
7-
- Builds for `develop` and `main` branches produce containers tagged with the branch name and pushed to container registries.
7+
- Builds for `develop`, `main`, and `test` branches produce containers tagged with the branch name and pushed to container registries.
88
- Branches named in the format `release/x.y.z` are pushed to container registries with that container tag as well as the container tag `latest`.
99
- Other branches go through the `build` stage in the `Dockerfile` but not further (and no image is uploaded).
1010
- Build environment information is brought in as container labels (Git commit id, build date, version) and you can easily add more.

build.bash

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Environment variables:
3838
- GHCR_PAT - optional - GitHub Container Registry Personal Access Token
3939
- GHCR_USER - optional - username to log in to the GitHub Container Registry
4040
41+
Version 1.1.0 released 2021-12-02
4142
EOF
4243
exit
4344
}
@@ -126,7 +127,10 @@ if [[ -z ${BLD_BRANCH} ]]; then
126127
fi
127128
fi
128129

129-
if [[ $BLD_BRANCH = "master" || $BLD_BRANCH = "main" || $BLD_BRANCH = "develop" ]]; then
130+
if [[ $BLD_BRANCH = "develop"
131+
|| $BLD_BRANCH = "main"
132+
|| $BLD_BRANCH = "master"
133+
|| $BLD_BRANCH = "test" ]]; then
130134
BLD_DOCKER_TAG=$BLD_BRANCH
131135
BLD_VERSION=${BLD_BRANCH}-${BLD_VERSION_DATE}
132136
BLD_PUSH=true
@@ -289,7 +293,7 @@ else
289293
--build-arg IMAGE_VERSION="$BLD_VERSION" \
290294
--target build .
291295
msg "${GREEN}===${NOFORMAT} Docker image built"
292-
msg "${ORANGE}===${NOFORMAT} Not pushing Docker image: branch is not main, develop, or versioned release"
296+
msg "${ORANGE}===${NOFORMAT} Not pushing Docker image: branch is not develop, main, test, or versioned release"
293297
fi
294298

295299
msg "${PURPLE}===${NOFORMAT} Build script complete in $((SECONDS - BLD_STARTAT)) seconds."

0 commit comments

Comments
 (0)