10 changed files
azure-pipelines.yml | ||
build-local.sh | ||
counter.txt | ||
csv.env | ||
date.txt | ||
Dockerfile.cli + | ||
Dockerfile.web rename, edit | ||
entrypoint-cli.sh + | ||
entrypoint-web.sh rename, edit | ||
readme.md | ||
Add comment 1 trigger: none
Add comment 2 pr: none
Add comment 3 Minus schedules:
Add comment 4 Minus - cron: '0 7 * * TUE'
Add comment 5 Minus displayName: Regular build
Add comment 6 Minus branches:
Add comment 7 Minus include:
Add comment 8 Minus - main
Add comment 9 Minus
Add comment 10 3 parameters:
Add comment 11 Minus - name: buildPhpVersion
Add comment 12 Minus displayName: Build PHP version
Add comment 13 Minus type: string
Add comment 14 Minus default: 8.3
Add comment 15 Minus - name: buildImageType
Add comment 16 Minus displayName: Build image type
Add comment 17 Minus type: string
Add comment 18 Minus default: apache
Add comment 19 Minus - name: baseImage
Add comment 20 Minus displayName: Base image name
Add comment 21 Minus type: string
Add comment 22 Minus default: fireflyiii/base
Add comment 23 4 - name: repository
Add comment 24 5 displayName: Repository name
Add comment 25 6 type: string
Add comment 31 12 - name: platforms
Add comment 32 13 displayName: Build platforms
Add comment 33 14 type: string
Add comment 34 Minus default: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8,linux/386
Add comment 15 Plus default: linux/amd64,linux/arm64
Add comment 35 16
Add comment 36 17 jobs:
Add comment 37 18 - job: BuildImporter
Add comment 52 33 displayName: 'Prune and remove old builder.'
Add comment 53 34 - script: |
Add comment 54 35 sudo timedatectl set-timezone Europe/Amsterdam
Add comment 55 Minus cd ImportToolImage
Add comment 36 Plus cd ImportToolImage2
Add comment 56 37
Add comment 57 Minus # script for counter
Add comment 58 Minus git switch -c main
Add comment 59 Minus git branch --set-upstream-to=origin/main main
Add comment 38 Plus git pull origin main
Add comment 39 Plus git checkout main
Add comment 60 40 echo "Update counters"
Add comment 61 41 BUILDNR=$(<"counter.txt")
Add comment 62 42 BUILDNR=$((BUILDNR + 1))
Add comment 63 43 echo $BUILDNR > counter.txt
Add comment 64 44 echo $(date '+%d-%m-%Y %T %Z') > date.txt
Add comment 65 Minus echo "GOING TO BUILD BUILDNR #${BUILDNR}"
Add comment 45 Plus echo "Going to build #${BUILDNR}"
Add comment 66 46 git pull
Add comment 67 47 git config user.email "robot@firefly-iii.org"
Add comment 68 48 git config user.name "Firefly III build robot"
Add comment 84 64
Add comment 85 65 # docker login with token.
Add comment 86 66 echo 'Docker login...'
Add comment 87 Minus echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
Add comment 67 Plus echo "${DOCKERPASSWORD}" | docker login --username ${DOCKERUSERNAME} --password-stdin
Add comment 88 68 echo 'Done!'
Add comment 89 69
Add comment 90 Minus cd ImportToolImage
Add comment 70 Plus cd ImportToolImage2
Add comment 91 71 gpg --import ./release.gpg
Add comment 92 72 # start of script
Add comment 93 73 # label
Add comment 186 166 # build $LABEL when it's a develop version
Add comment 187 167 if [[ $VERSION == *"dev"* ]]; then
Add comment 188 168 echo "Will build development under tag '$LABEL'."
Add comment 189 Minus docker buildx build --pull --quiet \
Add comment 169 Plus docker buildx build --pull \
Add comment 190 170 --no-cache \
Add comment 171 Plus --quiet \
Add comment 191 172 --platform ${{ parameters.platforms }} \
Add comment 192 173 --build-arg VERSION \
Add comment 193 174 --build-arg version=$VERSION \
Add comment 194 175 --build-arg isodate=$ISODATE \
Add comment 195 176 --build-arg gitrevision=$GIT_HASH \
Add comment 196 Minus --build-arg build_version=$VERSION \
Add comment 197 Minus --build-arg build_base=apache \
Add comment 198 Minus --build-arg build_root_image=${{ parameters.baseImage }} \
Add comment 199 Minus --build-arg build_platform=${{ parameters.buildPhpVersion }} \
Add comment 200 Minus --build-arg apache_platform=${{ parameters.buildPhpVersion }} \
Add comment 201 Minus -t ${{ parameters.repository }}:$LABEL --push .
Add comment 177 Plus -t ${{ parameters.repository }}:$LABEL --push . -f Dockerfile.web
Add comment 178 Plus
Add comment 179 Plus echo "Will build development under tag '$LABEL-cli'."
Add comment 180 Plus docker buildx build --pull \
Add comment 181 Plus --no-cache \
Add comment 182 Plus --quiet \
Add comment 183 Plus --platform ${{ parameters.platforms }} \
Add comment 184 Plus --build-arg VERSION \
Add comment 185 Plus --build-arg version=$VERSION \
Add comment 186 Plus --build-arg isodate=$ISODATE \
Add comment 187 Plus --build-arg gitrevision=$GIT_HASH \
Add comment 188 Plus -t ${{ parameters.repository }}:$LABEL-cli --push . -f Dockerfile.cli
Add comment 202 189 fi
Add comment 203 190
Add comment 204 191 # build alpha or beta when it's alpha or beta
Add comment 205 192 if [[ $VERSION == *"beta"* || $VERSION == *"alpha"* ]]; then
Add comment 206 193 echo "Will build or alpha or beta version under tag '$LABEL' and '$VERSION'."
Add comment 207 Minus docker buildx build --pull --quiet \
Add comment 194 Plus docker buildx build --pull \
Add comment 208 195 --no-cache \
Add comment 196 Plus --quiet \
Add comment 209 197 --platform ${{ parameters.platforms }} \
Add comment 210 198 --build-arg VERSION \
Add comment 211 199 --build-arg version=$VERSION \
Add comment 212 200 --build-arg isodate=$ISODATE \
Add comment 213 201 --build-arg gitrevision=$GITREVISION \
Add comment 214 Minus --build-arg build_version=$VERSION \
Add comment 215 Minus --build-arg build_base=apache \
Add comment 216 Minus --build-arg build_platform=${{ parameters.buildPhpVersion }} \
Add comment 217 Minus --build-arg apache_platform=${{ parameters.buildPhpVersion }} \
Add comment 218 202 --tag ${{ parameters.repository }}:$LABEL \
Add comment 219 203 --tag ${{ parameters.repository }}:$VERSION \
Add comment 220 Minus --push .
Add comment 204 Plus --push . -f Dockerfile.web
Add comment 205 Plus
Add comment 206 Plus echo "Will build or alpha or beta version under tag '$LABEL-cli' and '$VERSION-cli'."
Add comment 207 Plus docker buildx build --pull \
Add comment 208 Plus --no-cache \
Add comment 209 Plus --quiet \
Add comment 210 Plus --platform ${{ parameters.platforms }} \
Add comment 211 Plus --build-arg VERSION \
Add comment 212 Plus --build-arg version=$VERSION \
Add comment 213 Plus --build-arg isodate=$ISODATE \
Add comment 214 Plus --build-arg gitrevision=$GITREVISION \
Add comment 215 Plus --tag ${{ parameters.repository }}:$LABEL-cli \
Add comment 216 Plus --tag ${{ parameters.repository }}:$VERSION-cli \
Add comment 217 Plus --push . -f Dockerfile.cli
Add comment 221 218 fi
Add comment 222 219
Add comment 223 220 # (does not support alpha or beta releases)
Add comment 242 239 echo "Will build production version as 'version-${split[0]}.${split[1]}'"
Add comment 243 240 echo "Will build production version as 'version-$currentversion'"
Add comment 244 241
Add comment 245 Minus # build major tag
Add comment 246 Minus
Add comment 247 Minus echo docker buildx build --pull --no-cache --platform ${{ parameters.platforms }} \
Add comment 242 Plus docker buildx build --pull --no-cache --platform ${{ parameters.platforms }} \
Add comment 243 Plus --quiet \
Add comment 248 244 --build-arg VERSION \
Add comment 249 245 --build-arg isodate=$ISODATE \
Add comment 250 246 --build-arg gitrevision=$GIT_HASH \
Add comment 251 247 --build-arg version=$VERSION \
Add comment 252 Minus --build-arg build_version=$VERSION \
Add comment 253 Minus --build-arg build_base=${{ parameters.buildImageType }} \
Add comment 254 Minus --build-arg build_root_image=${{ parameters.baseImage }} \
Add comment 255 Minus --build-arg build_platform=${{ parameters.buildPhpVersion }} \
Add comment 256 248 --tag ${{ parameters.repository }}:$LABEL \
Add comment 257 249 --tag ${{ parameters.repository }}:version-${split[0]} \
Add comment 258 250 --tag ${{ parameters.repository }}:version-${split[0]}.${split[1]} \
Add comment 259 251 --tag ${{ parameters.repository }}:version-$currentversion \
Add comment 260 Minus --push .
Add comment 252 Plus --push . -f Dockerfile.web
Add comment 253 Plus
Add comment 254 Plus echo "Will build production version as '$LABEL-cli'"
Add comment 255 Plus echo "Will build production version as 'version-${split[0]}-cli'"
Add comment 256 Plus echo "Will build production version as 'version-${split[0]}.${split[1]}-cli'"
Add comment 257 Plus echo "Will build production version as 'version-$currentversion-cli'"
Add comment 261 258
Add comment 262 259 docker buildx build --pull --no-cache --platform ${{ parameters.platforms }} \
Add comment 260 Plus --quiet \
Add comment 263 261 --build-arg VERSION \
Add comment 264 262 --build-arg isodate=$ISODATE \
Add comment 265 263 --build-arg gitrevision=$GIT_HASH \
Add comment 266 264 --build-arg version=$VERSION \
Add comment 267 Minus --build-arg build_version=$VERSION \
Add comment 268 Minus --build-arg build_base=${{ parameters.buildImageType }} \
Add comment 269 Minus --build-arg build_root_image=${{ parameters.baseImage }} \
Add comment 270 Minus --build-arg build_platform=${{ parameters.buildPhpVersion }} \
Add comment 271 Minus --tag ${{ parameters.repository }}:$LABEL \
Add comment 272 Minus --tag ${{ parameters.repository }}:version-${split[0]} \
Add comment 273 Minus --tag ${{ parameters.repository }}:version-${split[0]}.${split[1]} \
Add comment 274 Minus --tag ${{ parameters.repository }}:version-$currentversion \
Add comment 275 Minus --push .
Add comment 265 Plus --tag ${{ parameters.repository }}:$LABEL-cli \
Add comment 266 Plus --tag ${{ parameters.repository }}:version-${split[0]}-cli \
Add comment 267 Plus --tag ${{ parameters.repository }}:version-${split[0]}.${split[1]}-cli \
Add comment 268 Plus --tag ${{ parameters.repository }}:version-$currentversion-cli \
Add comment 269 Plus --push . -f Dockerfile.cli
Add comment 276 270
Add comment 277 271 fi
Add comment 278 272
Add comment 279 273 displayName: 'Build!'
Add comment 280 274 env:
Add comment 281 275 VERSION: ${{ parameters.buildVersion }}
Add comment 282 Minus DOCKER_USERNAME: $(DockerUsername)
Add comment 283 Minus DOCKER_PASSWORD: $(DockerPassword)
Add comment 276 Plus DOCKERUSERNAME: $(DockerUsername)
Add comment 277 Plus DOCKERPASSWORD: $(DockerPassword)
Add comment 284 278
Add comment 285 279 - checkout: self
Add comment 286 280 clean: true