Skip to content

Commit

Permalink
changed project name
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFern committed Aug 8, 2019
1 parent 3223d6d commit 81e3428
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions .semaphore/deploy-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ blocks:
# See https://docs.semaphoreci.com/article/66-environment-variables-and-secrets
env_vars:
- name: CLUSTER_NAME
value: semaphore-demo-javascript-server
value: semaphore-demo-nodejs-k8s-server
prologue:
commands:
# Authenticate using the file injected from the secret
Expand All @@ -38,7 +38,7 @@ blocks:
- kubectl get pods

# Our deployment.yml instructs Kubernetes to pull container image
# named semaphoredemos/semaphore-demo-javascript-server:$SEMAPHORE_WORKFLOW_ID
# named semaphoredemos/semaphore-demo-nodejs-k8s-server:$SEMAPHORE_WORKFLOW_ID
# envsubst is a tool which will replace $SEMAPHORE_WORKFLOW_ID with
# its current value. The same variable was used in server-docker-build.yml
# pipeline to tag and push a container image.
Expand Down Expand Up @@ -66,6 +66,6 @@ blocks:
jobs:
- name: docker tag latest
commands:
- docker pull "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:$SEMAPHORE_WORKFLOW_ID"
- docker tag "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:$SEMAPHORE_WORKFLOW_ID" "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:latest"
- docker push "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:latest"
- docker pull "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:$SEMAPHORE_WORKFLOW_ID"
- docker tag "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:$SEMAPHORE_WORKFLOW_ID" "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:latest"
- docker push "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:latest"
6 changes: 3 additions & 3 deletions .semaphore/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ blocks:
# Use docker layer caching and reuse unchanged layers to build a new
# container image faster.
# To do that, we first need to pull a previous version of container:
- docker pull "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:latest" || true
- docker pull "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:latest" || true

# Build a new image based on pulled image, if present.
# Use $SEMAPHORE_WORKFLOW_ID environment variable to produce a
# unique image tag.
# For a list of available environment variables on Semaphore, see:
# https://docs.semaphoreci.com/article/12-environment-variables
- docker build --cache-from "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:latest" -t "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:$SEMAPHORE_WORKFLOW_ID" .
- docker build --cache-from "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:latest" -t "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:$SEMAPHORE_WORKFLOW_ID" .
- docker images

# Push a new image to container registry:
- docker push "gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:$SEMAPHORE_WORKFLOW_ID"
- docker push "gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:$SEMAPHORE_WORKFLOW_ID"

# The deployment pipeline is defined to run on manual approval from the UI.
# Semaphore will the time and the name of the person who promotes each
Expand Down
12 changes: 6 additions & 6 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: v1.0
# Name your pipeline. In case you connect multiple pipelines with promotions,
# the name will help you differentiate between, for example, a CI build phase
# and delivery phases.
name: Semaphore JavaScript Example Pipeline
name: Semaphore Nodejs Example Pipeline

# An agent defines the environment in which your code runs.
# It is a combination of one of available machine types and operating
Expand Down Expand Up @@ -48,9 +48,9 @@ blocks:
jobs:
- name: npm install and cache
commands:
- cache restore node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),node-modules-$SEMAPHORE_GIT_BRANCH,node-modules-master
- cache restore
- npm install
- cache store node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json) node_modules
- cache store

- name: Tests
task:
Expand Down Expand Up @@ -80,13 +80,13 @@ blocks:
# code analysis test
- name: Lint
commands:
- cache restore node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),node-modules-$SEMAPHORE_GIT_BRANCH,node-modules-master
- cache restore
- npm run lint

# unit tests
- name: Unit tests
commands:
- cache restore node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),node-modules-$SEMAPHORE_GIT_BRANCH,node-modules-master
- cache restore
- npm test

# end-to-end tests
Expand All @@ -96,7 +96,7 @@ blocks:
# environment as your code.
# See https://docs.semaphoreci.com/article/32-ubuntu-1804-image#databases-and-services
- sem-service start postgres
- cache restore node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),node-modules-$SEMAPHORE_GIT_BRANCH,node-modules-master
- cache restore
- cp ormconfig.ci.json ormconfig.json
- npm run migrate:up
- npm run test:e2e
Expand Down
14 changes: 7 additions & 7 deletions deployment.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: semaphore-demo-javascript-server
name: semaphore-demo-nodejs-k8s-server
spec:
replicas: 1
selector:
matchLabels:
app: semaphore-demo-javascript-server
app: semaphore-demo-nodejs-k8s-server
template:
metadata:
labels:
app: semaphore-demo-javascript-server
app: semaphore-demo-nodejs-k8s-server
spec:
containers:
- name: semaphore-demo-javascript-server
image: gcr.io/$GCP_PROJECT_ID/semaphore-demo-javascript-server:$SEMAPHORE_WORKFLOW_ID
- name: semaphore-demo-nodejs-k8s-server
image: gcr.io/$GCP_PROJECT_ID/semaphore-demo-nodejs-k8s-server:$SEMAPHORE_WORKFLOW_ID
env:
- name: NODE_ENV
value: "production"
Expand All @@ -24,10 +24,10 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: semaphore-demo-javascript-server-lb
name: semaphore-demo-nodejs-k8s-server-lb
spec:
selector:
app: semaphore-demo-javascript-server
app: semaphore-demo-nodejs-k8s-server
type: LoadBalancer
ports:
- port: 80
Expand Down

0 comments on commit 81e3428

Please sign in to comment.