Use better flags and conditionals in CI itself
This commit is contained in:
parent
847c9950d7
commit
f67b9a01fe
5 changed files with 22 additions and 8 deletions
|
@ -20,8 +20,13 @@ jobs:
|
||||||
- script: 'docker build -f deployment/Dockerfile.$(BuildConfiguration) -t jellyfin-web-$(BuildConfiguration) deployment'
|
- script: 'docker build -f deployment/Dockerfile.$(BuildConfiguration) -t jellyfin-web-$(BuildConfiguration) deployment'
|
||||||
displayName: 'Build Dockerfile'
|
displayName: 'Build Dockerfile'
|
||||||
|
|
||||||
- script: 'docker image ls -a && docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e GIT_BRANCH=$(Build.SourceBranch) -e BUILD_ID=$(Build.BuildNumber) jellyfin-web-$(BuildConfiguration)'
|
- script: 'docker image ls -a && docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e IS_UNSTABLE="yes" -e BUILD_ID=$(Build.BuildNumber) jellyfin-web-$(BuildConfiguration)'
|
||||||
displayName: 'Run Dockerfile'
|
displayName: 'Run Dockerfile (unstable)'
|
||||||
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/package')
|
||||||
|
|
||||||
|
- script: 'docker image ls -a && docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e IS_UNSTABLE="no" -e BUILD_ID=$(Build.BuildNumber) jellyfin-web-$(BuildConfiguration)'
|
||||||
|
displayName: 'Run Dockerfile (stable)'
|
||||||
|
condition: ne(variables['Build.SourceBranch'], 'refs/heads/package')
|
||||||
|
|
||||||
- task: PublishPipelineArtifact@1
|
- task: PublishPipelineArtifact@1
|
||||||
displayName: 'Publish Release'
|
displayName: 'Publish Release'
|
||||||
|
@ -35,11 +40,20 @@ jobs:
|
||||||
sshEndpoint: repository
|
sshEndpoint: repository
|
||||||
sourceFolder: '$(Build.SourcesDirectory)/deployment/dist'
|
sourceFolder: '$(Build.SourcesDirectory)/deployment/dist'
|
||||||
contents: '**'
|
contents: '**'
|
||||||
targetFolder: '/srv/repository/incoming/azure/$(BuildConfiguration)'
|
targetFolder: '/srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
|
||||||
|
|
||||||
- task: SSH@0
|
- task: SSH@0
|
||||||
displayName: 'Collect packages into repositories'
|
displayName: 'Collect packages into repositories (unstable)'
|
||||||
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/package')
|
||||||
inputs:
|
inputs:
|
||||||
sshEndpoint: repository
|
sshEndpoint: repository
|
||||||
runOptions: 'inline'
|
runOptions: 'inline'
|
||||||
inline: '/srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber) unstable'
|
inline: '/srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber) unstable'
|
||||||
|
|
||||||
|
- task: SSH@0
|
||||||
|
displayName: 'Collect packages into repositories (stable)'
|
||||||
|
condition: ne(variables['Build.SourceBranch'], 'refs/heads/package')
|
||||||
|
inputs:
|
||||||
|
sshEndpoint: repository
|
||||||
|
runOptions: 'inline'
|
||||||
|
inline: '/srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber)'
|
||||||
|
|
|
@ -9,7 +9,7 @@ pushd ${SOURCE_DIR}
|
||||||
cp -a yarn.lock /tmp/yarn.lock
|
cp -a yarn.lock /tmp/yarn.lock
|
||||||
|
|
||||||
# modify changelog to unstable configuration if IS_UNSTABLE
|
# modify changelog to unstable configuration if IS_UNSTABLE
|
||||||
if [[ ${GIT_BRANCH} == 'refs/heads/package' ]]; then
|
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
|
||||||
pushd fedora/
|
pushd fedora/
|
||||||
# get the last PR ID
|
# get the last PR ID
|
||||||
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
||||||
|
|
|
@ -9,7 +9,7 @@ pushd ${SOURCE_DIR}
|
||||||
cp -a yarn.lock /tmp/yarn.lock
|
cp -a yarn.lock /tmp/yarn.lock
|
||||||
|
|
||||||
# modify changelog to unstable configuration if IS_UNSTABLE
|
# modify changelog to unstable configuration if IS_UNSTABLE
|
||||||
if [[ ${GIT_BRANCH} == 'refs/heads/package' ]]; then
|
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
|
||||||
pushd debian/
|
pushd debian/
|
||||||
# get the last PR ID
|
# get the last PR ID
|
||||||
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
||||||
|
|
|
@ -9,7 +9,7 @@ pushd ${SOURCE_DIR}
|
||||||
cp -a yarn.lock /tmp/yarn.lock
|
cp -a yarn.lock /tmp/yarn.lock
|
||||||
|
|
||||||
# modify changelog to unstable configuration if IS_UNSTABLE
|
# modify changelog to unstable configuration if IS_UNSTABLE
|
||||||
if [[ ${GIT_BRANCH} == 'refs/heads/package' ]]; then
|
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
|
||||||
pushd fedora/
|
pushd fedora/
|
||||||
# get the last PR ID
|
# get the last PR ID
|
||||||
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
||||||
|
|
|
@ -7,7 +7,7 @@ set -o xtrace
|
||||||
pushd ${SOURCE_DIR}
|
pushd ${SOURCE_DIR}
|
||||||
|
|
||||||
# get version
|
# get version
|
||||||
if [[ ${GIT_BRANCH} == 'refs/heads/package' ]]; then
|
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
|
||||||
version="${BUILD_ID}"
|
version="${BUILD_ID}"
|
||||||
else
|
else
|
||||||
version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
|
version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue