2021-03-23 04:43:13 +00:00
|
|
|
---
|
|
|
|
# NOTE: This file is generated from `bitbucket-pipelines.yml.j2` via `pipelines-generator.py`:
|
|
|
|
#
|
|
|
|
# python3 pipelines-generator.py > bitbucket-pipelines.yml
|
|
|
|
|
|
|
|
image: atlassian/docker-release-maker:latest
|
|
|
|
definitions:
|
|
|
|
services:
|
|
|
|
docker:
|
|
|
|
memory: 4096
|
|
|
|
|
|
|
|
options:
|
|
|
|
size: 2x
|
|
|
|
|
|
|
|
pipelines:
|
|
|
|
|
|
|
|
branches:
|
|
|
|
######################################################################
|
|
|
|
# Master branch: Do full release for each image flavour
|
|
|
|
######################################################################
|
|
|
|
master:
|
|
|
|
- step:
|
|
|
|
name: Check if pipelines config is up-to-date...
|
|
|
|
script:
|
|
|
|
- python3 pipelines-generator.py > bitbucket-piplines.yml.expected && diff bitbucket-pipelines.yml bitbucket-piplines.yml.expected
|
|
|
|
|
|
|
|
- parallel:
|
|
|
|
|
|
|
|
{% for (name, pdata) in images.items() %}
|
|
|
|
{% for (jdkver, appdata) in pdata.items() %}
|
|
|
|
{% for offset in range(0, batches) %}
|
|
|
|
|
|
|
|
- step:
|
|
|
|
name: {{ name }} JDK {{ jdkver }} - Batch {{ offset + 1 }}
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
|
|
|
|
- >
|
2021-03-29 03:25:28 +00:00
|
|
|
python /usr/src/app/make-releases.py \
|
|
|
|
--update \
|
|
|
|
--start-version='{{ appdata.start_version }}' \
|
|
|
|
--end-version='{{ appdata.end_version }}' \
|
2021-03-23 04:43:13 +00:00
|
|
|
{% if appdata.default_release %}
|
2021-03-29 03:25:28 +00:00
|
|
|
--default-release \
|
2021-03-23 04:43:13 +00:00
|
|
|
{% endif %}
|
2021-03-29 04:29:57 +00:00
|
|
|
--dockerfile='{{ appdata.dockerfile }}' \
|
2021-03-29 03:25:28 +00:00
|
|
|
--dockerfile-buildargs='BASE_IMAGE={{ appdata.base_image }}' \
|
|
|
|
--dockerfile-version-arg='CONFLUENCE_VERSION' \
|
|
|
|
--mac-product-key='confluence' \
|
2021-03-29 06:21:24 +00:00
|
|
|
--tag-suffixes='{{ appdata.tag_suffixes|join(',') }}' \
|
2021-03-29 03:25:28 +00:00
|
|
|
--concurrent-builds='1' \
|
|
|
|
--job-offset='{{ offset }}' \
|
|
|
|
--jobs-total='{{ batches }}' \
|
|
|
|
--docker-repos='{{ appdata.docker_repos|join(',') }}' \
|
2021-03-23 04:43:13 +00:00
|
|
|
--push
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
- step:
|
|
|
|
name: Update README
|
|
|
|
image: python:3.7-alpine3.9
|
|
|
|
script:
|
|
|
|
- apk add --no-cache git
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
- pip install -q requests
|
|
|
|
- export DOCKER_REPO='atlassian/confluence-server'
|
|
|
|
- python shared-components/image/push-readme.py
|
|
|
|
|
|
|
|
custom:
|
|
|
|
######################################################################
|
|
|
|
# Custom: Do full release for each image flavour
|
|
|
|
######################################################################
|
|
|
|
new-releases:
|
|
|
|
|
|
|
|
- parallel:
|
|
|
|
|
|
|
|
{% for (name, pdata) in images.items() %}
|
|
|
|
{% for (jdkver, appdata) in pdata.items() %}
|
|
|
|
{% for offset in range(0, batches) %}
|
|
|
|
|
|
|
|
- step:
|
|
|
|
name: {{ name }} JDK {{ jdkver }} - Batch {{ offset + 1 }}
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
|
|
|
|
- >
|
2021-03-29 03:25:28 +00:00
|
|
|
python /usr/src/app/make-releases.py \
|
|
|
|
--create \
|
2021-04-20 02:46:35 +00:00
|
|
|
--create-eap \
|
2021-03-29 03:25:28 +00:00
|
|
|
--start-version='{{ appdata.start_version }}' \
|
|
|
|
--end-version='{{ appdata.end_version }}' \
|
2021-03-23 04:43:13 +00:00
|
|
|
{% if appdata.default_release %}
|
2021-03-29 03:25:28 +00:00
|
|
|
--default-release \
|
2021-03-23 04:43:13 +00:00
|
|
|
{% endif %}
|
2021-03-29 04:29:57 +00:00
|
|
|
--dockerfile='{{ appdata.dockerfile }}' \
|
2021-03-29 03:25:28 +00:00
|
|
|
--dockerfile-buildargs='BASE_IMAGE={{ appdata.base_image }}' \
|
|
|
|
--dockerfile-version-arg='CONFLUENCE_VERSION' \
|
|
|
|
--mac-product-key='confluence' \
|
2021-03-29 06:21:24 +00:00
|
|
|
--tag-suffixes='{{ appdata.tag_suffixes|join(',') }}' \
|
2021-03-29 03:25:28 +00:00
|
|
|
--concurrent-builds='1' \
|
|
|
|
--job-offset='{{ offset }}' \
|
|
|
|
--jobs-total='{{ batches }}' \
|
|
|
|
--docker-repos='{{ appdata.docker_repos|join(',') }}' \
|
2021-03-23 04:43:13 +00:00
|
|
|
--push
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
custom-release:
|
|
|
|
- variables:
|
|
|
|
- name: CONFLUENCE_VERSION
|
|
|
|
- name: DOCKER_TAG
|
|
|
|
- step:
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
|
|
|
|
- >
|
|
|
|
docker build -t atlassian/confluence-server:${DOCKER_TAG}
|
|
|
|
--build-arg CONFLUENCE_VERSION=${CONFLUENCE_VERSION} .
|
|
|
|
- snyk auth @SNYK_TOKEN
|
|
|
|
- snyk container test atlassian/confluence-server:${DOCKER_TAG} --severity-threshold=high
|
|
|
|
- docker push atlassian/confluence-server:${DOCKER_TAG}
|
|
|
|
|
|
|
|
|
|
|
|
pull-requests:
|
|
|
|
######################################################################
|
|
|
|
# All other branches & PRs; run unit tests & functional tests
|
|
|
|
# against latest app version
|
|
|
|
######################################################################
|
|
|
|
'**':
|
|
|
|
- step:
|
2021-04-14 05:48:19 +00:00
|
|
|
name: Run unit tests
|
2021-03-23 04:43:13 +00:00
|
|
|
image: python:3.7-alpine3.9
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- apk add --no-cache git
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
- pip install -q -r shared-components/tests/requirements.txt
|
|
|
|
- export PYTHONPATH=./shared-components/tests:$PYTHONPATH
|
|
|
|
- export DOCKERFILE='Dockerfile'
|
|
|
|
- export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION'
|
|
|
|
- export MAC_PRODUCT_KEY='confluence'
|
2021-04-14 05:53:55 +00:00
|
|
|
- py.test -v tests/
|
|
|
|
- py.test -v shared-components/tests/
|
2021-03-23 04:43:13 +00:00
|
|
|
- export DOCKERFILE='Dockerfile-alpine'
|
2021-04-14 05:53:55 +00:00
|
|
|
- py.test -v tests/
|
|
|
|
- py.test -v shared-components/tests/
|
2021-03-23 04:43:13 +00:00
|
|
|
- step:
|
2021-04-14 05:48:19 +00:00
|
|
|
name: Run integration tests
|
2021-03-23 04:43:13 +00:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- apk add --no-cache git docker-compose jq curl
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
- export CONFLUENCE_VERSION=`curl -s https://marketplace.atlassian.com/rest/2/products/key/confluence/versions/latest | jq -r .name`
|
|
|
|
- docker build --build-arg CONFLUENCE_VERSION=${CONFLUENCE_VERSION} -t test-image .
|
|
|
|
- export IS_RELEASE=false
|
2021-04-14 02:28:44 +00:00
|
|
|
- /usr/src/app/post_build.sh test-image $IS_RELEASE
|
2021-03-23 04:43:13 +00:00
|
|
|
|