Search code examples
angularamazon-s3gitlab-cigitlab-ci-runnerbucket

Angular 2 deploy in server and add asset to go bucket via ci/cd and consume asset from bucket CDN


Here i am working wit CI/CD Using Gitlab CI. When i added this command npm run build:dev --progress false --output-hashing=all --deploy-url https://dev-static.abc.ro/ The --deploy-url is changing the path of all the assets that is fine

How can i add these asset folder or dist folder to go bucket via ci/cd using the credential of go bucket.

Here the commands which i am using to deploy project on my server

`
rm package-lock.json
npm install
npm install @angular/cli
npm run build:dev --progress false --output-hashing=all --deploy-url https://dev-static.abc.ro/

printf "\n"
printf "###############################################################################\n"
printf "# Remove current dist folder and Move files from temp-dist to dist  #\n"
printf "###############################################################################\n"

rm -rf dist/*
mv temp-dist/* dist/
`

Here the code outlook enter image description here


Solution

  • You can use the gulp for this Please the answer no 2 given in the following question

    How to upload image to digital Ocean Spaces using AWS SDK for Yii2?