-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from sineverba/release-0.11.0
Release 0.11.0
- Loading branch information
Showing
11 changed files
with
187 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
version: v1.0 | ||
|
||
name: Build | ||
agent: | ||
machine: | ||
type: e1-standard-2 | ||
os_image: ubuntu2004 | ||
|
||
global_job_config: | ||
secrets: | ||
- name: ACCESS_TOKENS | ||
env_vars: | ||
- name: DOCKER_IMAGE | ||
value: registry.gitlab.com/cicdprojects/online-banking-frontend | ||
- name: GITLAB_REGISTRY | ||
value: registry.gitlab.com | ||
- name: BUILDX_VERSION | ||
value: 0.10.0 | ||
- name: BINFMT_VERSION | ||
value: qemu-v7.0.0-28 | ||
- name: NPM_VERSION | ||
value: 9.4.0 | ||
prologue: | ||
commands: | ||
- checkout | ||
- cp .env.bak .env | ||
- npm install -g npm@$NPM_VERSION | ||
- npm pkg set scripts.prepare="echo no-prepare" | ||
- npm install --omit=dev | ||
- npm run build | ||
|
||
blocks: | ||
- name: "Build" | ||
task: | ||
jobs: | ||
- name: Create Docker image | ||
commands: | ||
- docker login -u semaphore -p $GITLAB_TOKEN $GITLAB_REGISTRY | ||
- mkdir -vp ~/.docker/cli-plugins/ | ||
- >- | ||
curl | ||
--silent | ||
-L "https://github.com/docker/buildx/releases/download/v$BUILDX_VERSION/buildx-v$BUILDX_VERSION.linux-amd64" | ||
> ~/.docker/cli-plugins/docker-buildx | ||
- chmod a+x ~/.docker/cli-plugins/docker-buildx | ||
- docker buildx version | ||
- docker run --rm --privileged tonistiigi/binfmt:$BINFMT_VERSION --install all | ||
- docker buildx ls | ||
- docker buildx create --name multiarch --driver docker-container --use | ||
- docker buildx inspect --bootstrap --builder multiarch | ||
- >- | ||
docker buildx build | ||
--platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 | ||
--tag $DOCKER_IMAGE:$SEMAPHORE_GIT_TAG_NAME | ||
--tag $DOCKER_IMAGE:latest | ||
--push | ||
--file ./dockerfiles/production/build/docker/Dockerfile "." | ||
promotions: | ||
- name: Deploy | ||
pipeline_file: deploy.yml | ||
auto_promote: | ||
when: "result = 'passed' and tag =~ '.*'" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
version: v1.0 | ||
|
||
name: Deploy | ||
agent: | ||
machine: | ||
type: e1-standard-2 | ||
os_image: ubuntu2004 | ||
|
||
global_job_config: | ||
secrets: | ||
- name: ACCESS_TOKENS | ||
- name: VPS | ||
env_vars: | ||
- name: DOCKER_IMAGE | ||
value: registry.gitlab.com/cicdprojects/online-banking-frontend | ||
- name: GITLAB_REGISTRY | ||
value: registry.gitlab.com | ||
- name: BUILDX_VERSION | ||
value: 0.10.0 | ||
- name: BINFMT_VERSION | ||
value: qemu-v7.0.0-28 | ||
- name: FOLDER_APP | ||
value: online-banking-frontend | ||
- name: NPM_VERSION | ||
value: 9.4.0 | ||
prologue: | ||
commands: | ||
- checkout | ||
- cp .env.bak .env | ||
|
||
blocks: | ||
- name: "Deploy" | ||
task: | ||
jobs: | ||
- name: Deploy to Netlify | ||
commands: | ||
- npm install -g npm@$NPM_VERSION | ||
- npm pkg set scripts.prepare="echo no-prepare" | ||
- npm install --omit=dev | ||
- npm install netlify-cli -g | ||
- npm run build | ||
- netlify deploy -s $NETLIFY_BITBANK_SITE_ID --auth $NETLIFY_ACCESS_TOKEN -p --dir ./build | ||
- name: Deploy to Vercel | ||
commands: | ||
- npm install -g npm@$NPM_VERSION | ||
- npm pkg set scripts.prepare="echo no-prepare" | ||
- npm install --omit=dev | ||
- npm install -g vercel | ||
- VERCEL_PROJECT_ID=$VERCEL_BITBANK_PROJECT_ID VERCEL_ORG_ID=$VERCEL_ORG_ID npx vercel --token $VERCEL_TOKEN --confirm --prod | ||
- name: Deploy to VPS | ||
commands: | ||
- ssh-keyscan -p $VPS01_OCI_PORT -H $VPS01_OCI_URL >> ~/.ssh/known_hosts | ||
- chmod 0600 ~/.ssh/id_semaphore | ||
- ssh-add ~/.ssh/id_semaphore | ||
# 1 - Stop the container and remove it | ||
- >- | ||
ssh -t $VPS01_OCI_USERNAME@$VPS01_OCI_URL -p $VPS01_OCI_PORT | ||
"cd $FOLDER_APP && docker-compose stop && docker container rm $FOLDER_APP && exit" | ||
# 2 - Remove all tagged images | ||
- >- | ||
ssh -t $VPS01_OCI_USERNAME@$VPS01_OCI_URL -p $VPS01_OCI_PORT | ||
"docker images | grep $FOLDER_APP | tr -s ' ' | cut -d ' ' -f 2 | xargs -I {} docker rmi $DOCKER_IMAGE:{} && exit" | ||
# 3 - Pull the image | ||
- >- | ||
ssh -t $VPS01_OCI_USERNAME@$VPS01_OCI_URL -p $VPS01_OCI_PORT | ||
"docker pull $DOCKER_IMAGE:$SEMAPHORE_GIT_TAG_NAME && exit" | ||
# 4 - Replace the docker-compose with new tag image | ||
- >- | ||
ssh -t $VPS01_OCI_USERNAME@$VPS01_OCI_URL -p $VPS01_OCI_PORT | ||
"sed -i \"/image\: registry.gitlab.com\/cicdprojects\/$FOLDER_APP:/c\ image\: registry.gitlab.com\/cicdprojects\/$FOLDER_APP\:$SEMAPHORE_GIT_TAG_NAME\" $FOLDER_APP/docker-compose.yml && exit" | ||
# 6 - Restart the service | ||
- >- | ||
ssh -t $VPS01_OCI_USERNAME@$VPS01_OCI_URL -p $VPS01_OCI_PORT | ||
"cd $FOLDER_APP && docker-compose up -d && exit" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# 0.10.1 | ||
# 0.11.0 | ||
+ Upgrade dependencies + Refactor Semaphore | ||
|
||
## 0.10.1 | ||
+ Fix Semaphore | ||
|
||
## 0.10.0 | ||
|
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
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
File renamed without changes.
Oops, something went wrong.