From cbae2f577e4205c7373519c764b8466bd6a93bdd Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 14 Jun 2020 19:59:32 -0400 Subject: [PATCH] Attempt to use inbuilt Docker tasks --- .ci/azure-pipelines-package.yml | 52 +++++++++++++++------------------ deployment/Dockerfile.docker | 1 + 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.ci/azure-pipelines-package.yml b/.ci/azure-pipelines-package.yml index 62f73e7f04..e48b24eb8b 100644 --- a/.ci/azure-pipelines-package.yml +++ b/.ci/azure-pipelines-package.yml @@ -52,37 +52,31 @@ jobs: vmImage: 'ubuntu-latest' steps: - - script: 'docker build -f deployment/Dockerfile.docker -t "jellyfin-web":"unstable-$(Build.BuildNumber)" .' - displayName: 'Build Dockerfile (unstable)' - condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package') + - task: Docker@2 + displayName: "Build and Push Docker image (unstable)" + condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') + inputs: + repository: "jellyfin/jellyfin-web" + command: buildAndPush + buildContext: '.' + Dockerfile: "deployment/Dockerfile.docker" + containerRegistry: Docker Hub + tags: | + unstable-$(Build.BuildNumber) + unstable - - script: 'docker push "jellyfin-web":"unstable-$(Build.BuildNumber)"' - displayName: 'Push Docker image (unstable)' - condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package') - - - script: 'docker manifest create --amend "jellyfin-web":"unstable" "jellyfin-web":"unstable-$(Build.BuildNumber)"' - displayName: 'Create Docker manifest (unstable)' - condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package') - - - script: 'docker manifest push --purge "jellyfin-web":"unstable"' - displayName: 'Push Docker manifest (unstable)' - condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package') - - - script: 'docker build -f deployment/Dockerfile.docker -t "jellyfin-web":"stable-$( sed "s|^refs/tags/v||g" <<<"$(Build.SourceBranch)" )" .' - displayName: 'Build Dockerfile (stable)' - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags') - - - script: 'docker push "jellyfin-web":"stable-$( sed "s|^refs/tags/v||g" <<<"$(Build.SourceBranch)" )"' - displayName: 'Push Docker image (stable)' - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags') - - - script: 'docker manifest create --amend "jellyfin-web":"stable" "jellyfin-web":"stable-$( sed "s|^refs/tags/v||g" <<<"$(Build.SourceBranch)" )"' - displayName: 'Create Docker manifest (stable)' - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags') - - - script: 'docker manifest push --purge "jellyfin-web-stable":"stable"' - displayName: 'Push Docker manifest (stable, latest)' + - task: Docker@2 + displayName: "Build and Push Docker image (stable)" condition: startsWith(variables['Build.SourceBranch'], 'refs/tags') + inputs: + repository: "jellyfin/jellyfin-web" + command: buildAndPush + buildContext: '.' + Dockerfile: "deployment/Dockerfile.docker" + containerRegistry: Docker Hub + tags: | + stable-$(Build.BuildNumber) + stable - job: Collect displayName: 'Collect Artifacts' diff --git a/deployment/Dockerfile.docker b/deployment/Dockerfile.docker index e0d0e4210d..1b3e215795 100644 --- a/deployment/Dockerfile.docker +++ b/deployment/Dockerfile.docker @@ -7,5 +7,6 @@ RUN apk add autoconf g++ make libpng-dev gifsicle alpine-sdk automake libtool ma WORKDIR ${SOURCE_DIR}/ COPY . . +RUN ls -al . RUN yarn install && mv dist ${ARTIFACT_DIR}