Build pipeline fix (#938)
* updating the build pipeline for the QA env * changing the docker build context * removed commented code * moving commands to single line * fixing typo * removing unneeded build script
This commit is contained in:
parent
68f2de171e
commit
ad40c38ca3
|
@ -71,24 +71,31 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./build.sh
|
echo -e "# Building Web\n"
|
||||||
./build.sh
|
echo "Building app"
|
||||||
|
echo "npm version $(npm --version)"
|
||||||
|
npm install
|
||||||
|
npm run dist:selfhost
|
||||||
|
|
||||||
|
echo -e "\nBuilding docker image"
|
||||||
|
docker --version
|
||||||
|
docker build -t bitwarden/web .
|
||||||
|
|
||||||
- name: Tag rc branch
|
- name: Tag rc branch
|
||||||
if: github.ref == 'refs/heads/rc'
|
if: github.ref == 'refs/heads/rc'
|
||||||
run: ./build.sh tag rc
|
run: docker tag bitwarden/web bitwarden/web:rc
|
||||||
|
|
||||||
- name: Tag dev
|
- name: Tag dev
|
||||||
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
|
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
|
||||||
run: ./build.sh tag dev
|
run: docker tag bitwarden/web bitwarden/web:dev
|
||||||
|
|
||||||
- name: Tag beta
|
- name: Tag beta
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: ./build.sh tag beta
|
run: docker tag bitwarden/web bitwarden/web:beta
|
||||||
|
|
||||||
- name: Tag version
|
- name: Tag version
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: ./build.sh tag $($env:RELEASE_TAG_NAME.trimStart('v'))
|
run: docker tag bitwarden/web:$($env:RELEASE_TAG_NAME.trimStart('v'))
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
|
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
|
||||||
|
@ -99,35 +106,35 @@ jobs:
|
||||||
|
|
||||||
- name: Push rc images
|
- name: Push rc images
|
||||||
if: github.ref == 'refs/heads/rc'
|
if: github.ref == 'refs/heads/rc'
|
||||||
run: ./build.sh push rc
|
run: docker push bitwarden/web:rc
|
||||||
env:
|
env:
|
||||||
DOCKER_CONTENT_TRUST: 1
|
DOCKER_CONTENT_TRUST: 1
|
||||||
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
||||||
|
|
||||||
- name: Push dev images
|
- name: Push dev images
|
||||||
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
|
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
|
||||||
run: ./build.sh push dev
|
run: docker push bitwarden/web:dev
|
||||||
env:
|
env:
|
||||||
DOCKER_CONTENT_TRUST: 1
|
DOCKER_CONTENT_TRUST: 1
|
||||||
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
||||||
|
|
||||||
- name: Push beta images
|
- name: Push beta images
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: ./build.sh push beta
|
run: docker push bitwarden/web:beta
|
||||||
env:
|
env:
|
||||||
DOCKER_CONTENT_TRUST: 1
|
DOCKER_CONTENT_TRUST: 1
|
||||||
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
||||||
|
|
||||||
- name: Push latest images
|
- name: Push latest images
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: ./build.sh push latest
|
run: docker push bitwarden/web:latest
|
||||||
env:
|
env:
|
||||||
DOCKER_CONTENT_TRUST: 1
|
DOCKER_CONTENT_TRUST: 1
|
||||||
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
||||||
|
|
||||||
- name: Push version images
|
- name: Push version images
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: ./build.sh push $($env:RELEASE_TAG_NAME.trimStart('v'))
|
run: docker push bitwarden/web:$($env:RELEASE_TAG_NAME.trimStart('v'))
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
|
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
|
||||||
|
|
33
build.sh
33
build.sh
|
@ -1,33 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
if [ $# -gt 1 -a "$1" == "push" ]
|
|
||||||
then
|
|
||||||
TAG=$2
|
|
||||||
echo "# Pushing Web ($TAG)"
|
|
||||||
echo ""
|
|
||||||
docker push bitwarden/web:$TAG
|
|
||||||
elif [ $# -gt 1 -a "$1" == "tag" ]
|
|
||||||
then
|
|
||||||
TAG=$2
|
|
||||||
echo "Tagging Web as '$TAG'"
|
|
||||||
docker tag bitwarden/web bitwarden/web:$TAG
|
|
||||||
else
|
|
||||||
echo "# Building Web"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "Building app"
|
|
||||||
echo "npm version $(npm --version)"
|
|
||||||
npm install
|
|
||||||
npm run sub:update
|
|
||||||
npm run dist:selfhost
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "Building docker image"
|
|
||||||
docker --version
|
|
||||||
docker build -t bitwarden/web $DIR/.
|
|
||||||
fi
|
|
Loading…
Reference in New Issue