Created
September 28, 2018 13:29
-
-
Save kenvontucky/f863f5628b7015963a919b8880f95214 to your computer and use it in GitHub Desktop.
gitlab ci cd google app engine manual deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:latest | |
cache: | |
key: ${CI_COMMIT_REF_SLUG} | |
paths: | |
- node_modules/ | |
stages: | |
- test | |
- build | |
- deploy | |
job:test: | |
stage: test | |
before_script: | |
- apt-get update && apt-get install -y unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget | |
- npm install --silent | |
script: node_modules/.bin/ng test | |
job:e2e: | |
stage: test | |
before_script: | |
- apt-get update && apt-get install -y unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget | |
- npm install --silent | |
script: node_modules/.bin/ng e2e | |
release:build: | |
stage: build | |
script: node_modules/.bin/ng build --prod --aot | |
artifacts: | |
name: "project-$CI_COMMIT_REF_NAME" | |
paths: | |
- dist/ | |
only: | |
- tags | |
deploy:production: | |
stage: deploy | |
environment: | |
name: production | |
url: http://demo-app.com | |
before_script: | |
- wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-218.0.0-linux-x86.tar.gz | |
- tar -xzf google-cloud-sdk-218.0.0-linux-x86.tar.gz | |
- ./google-cloud-sdk/install.sh | |
dependencies: | |
- release:build | |
script: | |
- echo $GAE_KEY_FILE > gae_auth.json | |
- ./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file gae_auth.json | |
- ./google-cloud-sdk/bin/gcloud app deploy --project=$GAE_PROJECT_ID | |
when: manual | |
only: | |
- tags | |
Thanks for quick reply. I have last question regarding final outcome. Will your yml create docker image or only artifacts ?
Only artifacts are created under release:build.
thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, I'm not using any custom runner, the example uses the default gitlab runners. I suggest you to take a look at https://docs.gitlab.com/runner/configuration/advanced-configuration.html.