Commit 4e65fe52 authored by Sascha Pfeiffer's avatar Sascha Pfeiffer

some adjustments to the build pipeline

Signed-off-by: default avatarSascha Pfeiffer <sascha.pfeiffer@psono.com>
parent 3b23b052
variables:
CONTAINER_TEST_IMAGE: psono-docker-local.jfrog.io/psono/psono-client:$CI_BUILD_REF_NAME
CONTAINER_RELEASE_IMAGE: psono-docker-local.jfrog.io/psono/psono-client:latest
CONTAINER_TEST_IMAGE: psono-docker.jfrog.io/psono/psono-client:$CI_BUILD_REF_NAME
CONTAINER_RELEASE_IMAGE: psono-docker.jfrog.io/psono/psono-client:latest
stages:
- test
......@@ -8,7 +8,7 @@ stages:
- release
- deploy
unittests:
test-unittests:
except:
- schedules
stage: test
......@@ -22,7 +22,7 @@ unittests:
- apt-get install -y google-chrome-stable
- karma start ./unittests/karma-chrome-headless.conf.js
linter:
test-linter:
except:
- schedules
stage: test
......@@ -34,7 +34,7 @@ linter:
- addons-linter ./build/firefox
docker-image:
build-docker-image:
except:
- schedules
stage: build
......@@ -49,20 +49,20 @@ docker-image:
- docker info
- echo $CI_BUILD_TOKEN | docker login --username=gitlab-ci-token --password-stdin registry.gitlab.com
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker.jfrog.io
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker-local.jfrog.io
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker.jfrog.io
- docker build -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
firefox-extension:
build-firefox-extension:
except:
- schedules
stage: build
image: psono-docker.jfrog.io/ubuntu:16.04
script:
- pwd
- ls -la
- sh ./var/build-ubuntu.sh
- sh ./var/package-firefox-extension.sh
- curl -u gitlab:$artifactory_credentials -X PUT "https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/firefox-extension.zip" -T /builds/psono/psono-client/dist/chrome/psono.firefox.PW.zip
- mv /builds/psono/psono-client/build/firefox ../
- rm -Rf *
- rm -Rf .* 2> /dev/null || true
......@@ -73,15 +73,15 @@ firefox-extension:
- ./*
chrome-extension:
build-chrome-extension:
except:
- schedules
stage: build
image: psono-docker.jfrog.io/ubuntu:16.04
script:
- pwd
- ls -la
- sh ./var/build-ubuntu.sh
- sh ./var/package-chrome-extension.sh
- curl -u gitlab:$artifactory_credentials -X PUT "https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/chrome-extension.zip" -T /builds/psono/psono-client/dist/chrome/psono.chrome.PW.zip
- mv /builds/psono/psono-client/build/chrome ../
- rm -Rf *
- rm -Rf .* 2> /dev/null || true
......@@ -92,15 +92,15 @@ chrome-extension:
- ./*
webclient:
build-webclient:
except:
- schedules
stage: build
image: psono-docker.jfrog.io/ubuntu:16.04
script:
- pwd
- ls -la
- sh ./var/build-ubuntu.sh
- sh ./var/package-webclient.sh
- curl -u gitlab:$artifactory_credentials -X PUT "https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/webclient.zip" -T /builds/psono/psono-client/dist/webclient/psono.webclient.PW.zip
- mv /builds/psono/psono-client/build/webclient ../
- rm -Rf *
- rm -Rf .* 2> /dev/null || true
......@@ -111,6 +111,24 @@ webclient:
- ./*
release-artifacts:
except:
- schedules
stage: release
image: psono-docker.jfrog.io/ubuntu:16.04
script:
- apt-get update
- apt-get install -y curl
- curl -u gitlab:$artifactory_credentials -O https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/firefox-extension.zip
- curl -u gitlab:$artifactory_credentials -O https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/chrome-extension.zip
- curl -u gitlab:$artifactory_credentials -O https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/webclient.zip
- curl -u gitlab:$artifactory_credentials -X PUT "https://psono.jfrog.io/psono/psono/client/latest/firefox-extension.zip" -T ./firefox-extension.zip
- curl -u gitlab:$artifactory_credentials -X PUT "https://psono.jfrog.io/psono/psono/client/latest/chrome-extension.zip" -T ./chrome-extension.zip
- curl -u gitlab:$artifactory_credentials -X PUT "https://psono.jfrog.io/psono/psono/client/latest/webclient.zip" -T ./webclient.zip
only:
- /^v[0-9]*\.[0-9]*\.[0-9]*$/
release-docker:
except:
- schedules
......@@ -122,7 +140,7 @@ release-docker:
- docker info
- echo $CI_BUILD_TOKEN | docker login --username=gitlab-ci-token --password-stdin registry.gitlab.com
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker.jfrog.io
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker-local.jfrog.io
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker.jfrog.io
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
......@@ -139,14 +157,14 @@ deploy-security-scan-image:
- docker:dind
script:
- docker info
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker-local.jfrog.io
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker.jfrog.io
- echo $docker_hub_credentials | docker login --username=psonogitlab --password-stdin
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE psono/security-scans:psono-client-ce-$CI_BUILD_REF_NAME
- docker push psono/security-scans:psono-client-ce-$CI_BUILD_REF_NAME
deploy:
deploy-docker:
except:
- schedules
stage: deploy
......@@ -154,9 +172,9 @@ deploy:
services:
- docker:dind
script:
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker-local.jfrog.io
- echo $artifactory_credentials | docker login --username=gitlab --password-stdin psono-docker.jfrog.io
- echo $docker_hub_credentials | docker login --username=psonogitlab --password-stdin
- sh ./var/deploy.sh
- sh ./var/deploy-docker.sh
environment:
name: production
url: https://psono.pw
......@@ -164,14 +182,28 @@ deploy:
- /^v[0-9]*\.[0-9]*\.[0-9]*$/
deploy-github:
except:
- schedules
stage: deploy
image: psono-docker.jfrog.io/docker:git
services:
- docker:dind
script:
- sh ./var/deploy-github.sh
environment:
name: github
url: https://github.com/psono/psono-client
only:
- /^v[0-9]*\.[0-9]*\.[0-9]*$/
deploy-chrome:
except:
- schedules
stage: deploy
image: psono-docker.jfrog.io/ubuntu:16.04
script:
- sh ./var/build-ubuntu.sh
- sh ./var/package-chrome-extension.sh
- sh ./var/deploy-chrome-extension.sh
environment:
name: chrome-webstore
......@@ -179,14 +211,13 @@ deploy-chrome:
only:
- /^v[0-9]*\.[0-9]*\.[0-9]*$/
deploy-firefox:
except:
- schedules
stage: deploy
image: psono-docker.jfrog.io/ubuntu:16.04
script:
- sh ./var/build-ubuntu.sh
- sh ./var/package-firefox-extension.sh
- sh ./var/deploy-firefox-extension.sh
environment:
name: firefox-webstore
......
......@@ -344,7 +344,7 @@ gulp.task('chrome-deploy', function() {
extension1: {
publish: true,
appID: app_id,
zip: 'dist/chrome/psono.chrome.PW.zip'
zip: 'chrome-extension.zip'
}
},
uploadExtensions : ['extension1']
......@@ -382,7 +382,7 @@ gulp.task('firefox-deploy', function() {
algorithm: 'HS256' // HMAC-SHA256 signing algorithm
});
return run('curl "https://addons.mozilla.org/api/v3/addons/'+mozilla_addon_id+'/versions/'+ version +'/" -g -XPUT --form "upload=@dist/firefox/psono.firefox.PW.zip" -H "Authorization: JWT '+ token +'"').exec()
return run('curl "https://addons.mozilla.org/api/v3/addons/'+mozilla_addon_id+'/versions/'+ version +'/" -g -XPUT --form "upload=@firefox-extension.zip" -H "Authorization: JWT '+ token +'"').exec()
.pipe(gulp.dest('output'));
});
......
#!/usr/bin/env bash
cd /builds/psono/psono-client/
apt-get update
apt-get install -y curl
curl -u gitlab:$artifactory_credentials -O https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/chrome-extension.zip
gulp chrome-deploy
#!/usr/bin/env bash
apk add --update curl
# Deploy to Docker Hub
docker pull psono-docker.jfrog.io/psono/psono-client:latest
docker tag psono-docker.jfrog.io/psono/psono-client:latest psono/psono-client:latest
docker push psono/psono-client:latest
# Inform production stage about new image
curl -X POST https://hooks.microbadger.com/images/psono/psono-client/jMnJgDVZTpT4TUX-RlxTKa38Nc4=
curl -X POST $psono_image_updater_url
\ No newline at end of file
#!/usr/bin/env bash
cd /builds/psono/psono-client/
apt-get update
apt-get install -y curl
curl -u gitlab:$artifactory_credentials -O https://psono.jfrog.io/psono/psono/client/$CI_BUILD_REF_NAME/firefox-extension.zip
export mozilla_version=$(echo $CI_COMMIT_TAG | awk '{ string=substr($0, 2, 100); print string; }' )
gulp firefox-deploy
#!/usr/bin/env bash
apk add --update curl
# Deploy to Docker Hub
docker pull psono-docker-local.jfrog.io/psono/psono-client:latest
docker tag psono-docker-local.jfrog.io/psono/psono-client:latest psono/psono-client:latest
docker push psono/psono-client:latest
# Inform production stage about new image
curl -X POST https://hooks.microbadger.com/images/psono/psono-client/jMnJgDVZTpT4TUX-RlxTKa38Nc4=
curl -X POST $psono_image_updater_url
# Deploy to GitHub
echo "Clonging gitlab.com/psono/psono-client.git"
git clone https://gitlab.com/psono/psono-client.git
cd psono-client
......
#!/usr/bin/env bash
mkdir -p /builds/psono/psono-client/dist/webclient
cd /builds/psono/psono-client/build/webclient/
zip -r /builds/psono/psono-client/dist/webclient/psono.webclient.PW.zip *
cd /builds/psono/psono-client/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment