Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarski committed Oct 26, 2019
2 parents fcff338 + ca5dec2 commit 375c08f
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 28 deletions.
81 changes: 56 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,68 @@ env:
- DEV_IMAGE_NAME=luckjs/ts-luck-ui-landing-page
- DEV_CONTAINER_NAME=luck-ui-landing-page_develop
- DEV_VIRTUAL_HOST=testdevelop.luck.org.pl

- PROD_IMAGE_NAME=luckjs/luck-ui-landing-page
- PROD_CONTAINER_NAME=luck-ui-landing-page_master
- PROD_VIRTUAL_HOST=luck.org.pl
jobs:
include:
- stage: build
- &build
stage: build
services:
- docker
- docker
script:
- docker build --build-arg CLIENT_URL=$CLIENT_URL --build-arg APPOLO_CLIENT_TOKEN=$APPOLO_CLIENT_TOKEN . -t $IMAGE_NAME
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push $IMAGE_NAME
- docker build --build-arg CLIENT_URL=$CLIENT_URL --build-arg APPOLO_CLIENT_TOKEN=$APPOLO_CLIENT_TOKEN . -t $IMAGE_NAME
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push $IMAGE_NAME
if: branch = develop
env: IMAGE_NAME=$DEV_IMAGE_NAME
- stage: deploy

- <<: *build
if: branch = master OR tag =~ ^v.*$
env: IMAGE_NAME=$PROD_IMAGE_NAME


- &deploy
stage: deploy
before_deploy:
- openssl aes-256-cbc -K $encrypted_83c7afdcaf7e_key -iv $encrypted_83c7afdcaf7e_iv
-in .travis/id_rsa.enc -out .travis/id_rsa -d
- eval "$(ssh-agent -s)"
- cp .travis/id_rsa ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add ~/.ssh/id_rsa
- chmod 700 ~/.ssh
- ssh-keyscan $HOST_IP > ~/.ssh/known_hosts
- openssl aes-256-cbc -K $encrypted_83c7afdcaf7e_key -iv $encrypted_83c7afdcaf7e_iv
-in .travis/id_rsa.enc -out .travis/id_rsa -d
- eval "$(ssh-agent -s)"
- cp .travis/id_rsa ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add ~/.ssh/id_rsa
- chmod 700 ~/.ssh
- ssh-keyscan $HOST_IP > ~/.ssh/known_hosts
script: skip
if: branch = develop
env:
- APPOLO_CLIENT_TOKEN=$APPOLO_CLIENT_TOKEN
- CLIENT_URL=$CLIENT_URL
- IMAGE_NAME=$DEV_IMAGE_NAME
- CONTAINER_NAME=$DEV_CONTAINER_NAME
- VIRTUAL_HOST=$DEV_VIRTUAL_HOST
- APPOLO_CLIENT_TOKEN=$APPOLO_CLIENT_TOKEN
- CLIENT_URL=$CLIENT_URL
- IMAGE_NAME=$DEV_IMAGE_NAME
- CONTAINER_NAME=$DEV_CONTAINER_NAME
- VIRTUAL_HOST=$DEV_VIRTUAL_HOST
deploy:
- provider: script
skip_cleanup: true
script: bash .travis/deploy.sh $HOST_IP $DOCKER_PASSWORD $DOCKER_USERNAME $IMAGE_NAME
$CONTAINER_NAME
on:
branch: develop
- provider: script
skip_cleanup: true
script: bash .travis/deploy.sh $HOST_IP $DOCKER_PASSWORD $DOCKER_USERNAME $IMAGE_NAME $CONTAINER_NAME
on:
branch: develop


- <<: *deploy
if: branch = master OR tag =~ ^v.*$
env:
- APPOLO_CLIENT_TOKEN=$APPOLO_CLIENT_TOKEN
- CLIENT_URL=$CLIENT_URL
- IMAGE_NAME=$PROD_IMAGE_NAME
- CONTAINER_NAME=$PROD_CONTAINER_NAME
- VIRTUAL_HOST=$PROD_VIRTUAL_HOST
deploy:
- provider: script
skip_cleanup: true
script: bash .travis/deploy.sh $HOST_IP $DOCKER_PASSWORD $DOCKER_USERNAME $IMAGE_NAME $CONTAINER_NAME
on:
branch: master
tags: true

6 changes: 4 additions & 2 deletions pages/index/WelcomeSection/InputWithButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from 'styled-components';
import { Flex, BaseInput, BaseButton } from '../../../components';
import media from '../../../utils/media';
import * as Theme from '../../../utils/theme';
import {useState} from "react"

const Container = styled(Flex)`
position: relative;
Expand Down Expand Up @@ -84,10 +85,11 @@ const Button = styled(BaseButton).attrs({ as: 'a' })<any>`
`;

const InputWithButton = ({ href, ...props }: any) => {
const [name, setName]=useState<string>("")
return (
<Container {...props}>
<Input placeholder={'Wpisz nazwę...'} {...Theme.textStyles.smallText} />
<Button href={href} {...Theme.textStyles.smallText}>
<Input onChange={(event) => setName(event.target.value)} placeholder={'Nazwa wydarzenia...'} {...Theme.textStyles.smallText} />
<Button href={`${href}?name=${name}`} {...Theme.textStyles.smallText}>
Utwórz
</Button>
</Container>
Expand Down
2 changes: 1 addition & 1 deletion pages/index/WelcomeSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const WelcomeSection = ({ ...pros }) => {
</LogoHeading>
<InputWithButton
pt={['40px', '40px', '50px', '70px']}
href="https://luck.org.pl/#/happening"
href="https://app.luck.org.pl"
/>
</Content>
<Bubbles />
Expand Down

0 comments on commit 375c08f

Please sign in to comment.