docker-atlassian-confluence.../bitbucket-pipelines.yml
Nasser Ghazali-Beiklar 5654d4c095 Merged in DCKUBE-111-security-scan (pull request #78)
DCKUBE-111 security scan

* DCKUBE-111 - Applied security scan to bitbucket pipeline - passed the test script to run.py and also directly ran snyk scanner on custom releases

* DCKUBE-111 - as script test has a default then no need to pass it as a parameter

* DCKUBE-111 - removed snyk auth

* DCKUBE-111 - Added snyk authentication before scan

* DCKUBE-111 - Fixed typo in image names

* DCKUBE-111 - Set environment variable as part of applying the review point on docker release maker to changed push_image and test to env var instead of parameters to run.py

* DCKUBE-111 - removed PUSH_IMAGE and INTEGRATION_TEST_SCRIPT from pipeline yaml file because are default values and are not needed to override with the same value

Approved-by: Adam Brokes
2021-02-17 06:44:12 +00:00

158 lines
6.8 KiB
YAML

image: atlassian/docker-release-maker:latest
pipelines:
custom:
new-releases:
- parallel:
- step:
name: Confluence Alpine
services:
- docker
script:
- git submodule update --init --recursive
- export START_VERSION='6'
- export END_VERSION='7'
- export DEFAULT_RELEASE='false'
- export DOCKER_REPO='atlassian/confluence-server'
- export DOCKERFILE='Dockerfile-alpine'
- export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION'
- export MAC_PRODUCT_KEY='confluence'
- export TAG_SUFFIXES='alpine,alpine-adoptopenjdk8'
- export CONCURRENT_BUILDS='3'
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
- python /usr/src/app/run.py --create
- step:
name: Confluence Ubuntu JDK 8
services:
- docker
script:
- git submodule update --init --recursive
- export START_VERSION='6'
- export END_VERSION='7.1'
- export DEFAULT_RELEASE='true'
- export DOCKER_REPO='atlassian/confluence-server'
- export DOCKERFILE_BUILDARGS='BASE_IMAGE=adoptopenjdk:8-hotspot'
- export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION'
- export MAC_PRODUCT_KEY='confluence'
- export TAG_SUFFIXES='adoptopenjdk8,jdk8,ubuntu,ubuntu-18.04-adoptopenjdk8'
- export CONCURRENT_BUILDS='3'
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
- python /usr/src/app/run.py --create
- step:
name: Confluence Ubuntu JDK 11
services:
- docker
script:
- git submodule update --init --recursive
- export START_VERSION='7.1'
- export END_VERSION='8'
- export DEFAULT_RELEASE='true'
- export DOCKER_REPO='atlassian/confluence-server'
- export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION'
- export MAC_PRODUCT_KEY='confluence'
- export TAG_SUFFIXES='jdk11,ubuntu'
- export CONCURRENT_BUILDS='3'
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
- python /usr/src/app/run.py --create --create-eap
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}
branches:
master:
- parallel:
- step:
name: Confluence Alpine
services:
- docker
script:
- git submodule update --init --recursive
- export START_VERSION='6'
- export END_VERSION='7'
- export DEFAULT_RELEASE='false'
- export DOCKER_REPO='atlassian/confluence-server'
- export DOCKERFILE='Dockerfile-alpine'
- export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION'
- export MAC_PRODUCT_KEY='confluence'
- export TAG_SUFFIXES='alpine,alpine-adoptopenjdk8'
- export CONCURRENT_BUILDS='3'
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
- python /usr/src/app/run.py --update
- step:
name: Confluence Ubuntu JDK 8
services:
- docker
script:
- git submodule update --init --recursive
- export START_VERSION='6'
- export END_VERSION='7.1'
- export DEFAULT_RELEASE='true'
- export DOCKER_REPO='atlassian/confluence-server'
- export DOCKERFILE_BUILDARGS='BASE_IMAGE=adoptopenjdk:8-hotspot'
- export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION'
- export MAC_PRODUCT_KEY='confluence'
- export TAG_SUFFIXES='adoptopenjdk8,jdk8,ubuntu,ubuntu-18.04-adoptopenjdk8'
- export CONCURRENT_BUILDS='3'
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
- python /usr/src/app/run.py --update
- step:
name: Confluence Ubuntu JDK 11
services:
- docker
script:
- git submodule update --init --recursive
- export START_VERSION='7.1'
- export END_VERSION='8'
- export DEFAULT_RELEASE='true'
- export DOCKER_REPO='atlassian/confluence-server'
- export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION'
- export MAC_PRODUCT_KEY='confluence'
- export TAG_SUFFIXES='jdk11,ubuntu'
- export CONCURRENT_BUILDS='3'
- echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin
- python /usr/src/app/run.py --update
- 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
pull-requests:
'**':
- step:
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'
- py.test tests/
- py.test shared-components/tests/
- export DOCKERFILE='Dockerfile-alpine'
- py.test tests/
- py.test shared-components/tests/
definitions:
services:
docker:
memory: 3072